Skip to main content

Agents

Agents are workflow-powered assistants that run as persistent pods with function calling, memory, and tools. Use this resource to create and configure an agent, control its pod, and manage conversation threads and chat (streamed). An agent's knowledge bases are on client.knowledge.

Access it as client.agents on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Quick start​

from strongly import Strongly

client = Strongly()

# List (auto-paginates as you iterate) # filters: status, search
for agent in client.agents.list():
print(agent.id)

Methods​

Core​

list​

list(*, status: str | None = None, search: str | None = None, limit: int | None = None) -> SyncPaginator[AgentSummary]

List agents, each as its summary (AgentSummary).

retrieve returns the full agent.

Parameters

  • status (str | None, optional): Filter by status ("running", "stopped", "starting").
  • search (str | None, optional): Search by agent name or description.
  • limit (int | None, optional): Maximum number of items to return (default: all matching items).

create​

create(*, name: str, description: str | None = None, personality: str | None = None, ai_model_id: str | None = None, operating_prompt_id: str | None = None, operating_prompt_name: str | None = None, reference_key: str | None = None, response_format: str | None = None, fallback_model_ids: Sequence[str] | None = None, context_policy: Mapping[str, Any] | None = None, session_policy: Mapping[str, Any] | None = None, heartbeat: Mapping[str, Any] | None = None, connectors: Sequence[Mapping[str, Any]] | None = None, training: Mapping[str, Any] | None = None, shared_linked_ids: Sequence[str] | None = None, built_in_tools: Mapping[str, Any] | None = None, allowed_features: Sequence[str] | None = None, workspace: Mapping[str, Any] | None = None, stan_aware: bool | None = None) -> Agent

Create an agent from Agent Builder input. It is created stopped; start it.

Inside an app, a client made with for_user creates the agent for the app's signed-in user: it is theirs (single-owner) and records the app (Agent.app_id), and uses what its app uses (its model, connectors and the rest resolve as the app's owner). To give the user a clone of the app's base instead, use clone.

Parameters

  • name (str): Agent name, unique per user.
  • description (str | None, optional): What the agent is for, shown in the agent list and on its Overview. None when omitted; change it later with update.
  • personality (str | None, optional): A short paragraph on the agent's voice and style.
  • ai_model_id (str | None, optional): The AI Gateway model the agent runs on (its id). An agent cannot start without one.
  • operating_prompt_id, operating_prompt_name (str | None, optional): The operating prompt: a Library prompt's id, or a reference prompt's name.
  • reference_key (str | None, optional): A reference agent template (client.agents.templates()).
  • response_format (str | None, optional): "json_object" for JSON output (every reply is a JSON object; the agent never stops to ask a clarifying question); "text" (default) otherwise.
  • fallback_model_ids (Sequence[str] | None, optional): Models the agent moves to, in order, when its model is unhealthy.
  • context_policy, session_policy, heartbeat (Mapping | None, optional): Context, session and heartbeat policies (see the REST reference).
  • connectors (Sequence[Mapping] | None, optional): Connector tile selections.
  • training (Mapping | None, optional): Library seeds: {"memory": [...], "rules": [...], "skills": [...], "tasks": [...]}.
  • shared_linked_ids (Sequence[str] | None, optional): Pools the agent also reads from, each one a pool you may use.
  • built_in_tools (Mapping | None, optional): {"disabled": [...]}: the built-in tool families it does not get.
  • allowed_features (Sequence[str] | None, optional): What the agent may do: the features that create or control platform resources it is granted (allowed_features lists them). Every feature when omitted: the agent is unrestricted until restricted with a shorter list.
  • workspace (Mapping | None, optional): {"config": {...}}: a workspace the agent runs code in.
  • stan_aware (bool | None, optional): Recommend STAN for things the agent can't do. Off when omitted: the agent says plainly what it can't do and never mentions STAN.

retrieve​

retrieve(agent_id: str) -> Agent

Get detailed agent information including live status.

Parameters

  • agent_id (str): Agent workflow ID.

update​

update(agent_id: str, *, name: str | None = None, description: str | None = None, nodes: Sequence[Mapping[str, Any]] | None = None, connections: Sequence[Mapping[str, Any]] | None = None) -> Agent

Update an agent's name, description or graph (only the fields given change).

Answers the agent. Its brain settings are update_config, update_operating_prompt and update_model.

Parameters

  • agent_id (str): Agent workflow ID.
  • name, description, nodes, connections: Workflow-level fields to update.

delete​

delete(agent_id: str) -> None

Delete an agent - stops pod, removes agent mode, cleans up records.

Parameters

  • agent_id (str): Agent workflow ID.

Lifecycle & actions​

start​

start(agent_id: str) -> AgentLifecycleResult

Start an agent pod.

Creates a persistent Kubernetes pod running the agent server. The agent runs as its owner, whoever starts it (a clone as its user). Its owner, the owner of the app it belongs to and platform admins may start it; anyone else is refused (403).

Parameters

  • agent_id (str): Agent workflow ID.

Returns

  • AgentLifecycleResult: What the start did: agent_id, owner_id (the user it runs as), status (starting, or the live pod's status when it was already running), pod and mcp_register_failures.

stop​

stop(agent_id: str) -> AgentLifecycleResult

Stop a running agent pod.

Allowed for the same callers as start.

Parameters

  • agent_id (str): Agent workflow ID.

redeploy​

redeploy(agent_id: str) -> AgentLifecycleResult

Apply pending brain-config changes to a running agent.

Stops and re-starts the pod. Does nothing when no pod is running: the next start picks up the latest config either way. The restarted agent runs as its owner, whoever redeploys it; allowed for the same callers as start.

promote​

promote(workflow_id: str, *, description: str | None = None) -> Agent

Promote a workflow to agent mode and return the agent.

The workflow must contain at least one agent node. What the promotion warned about is in the agent's warnings.

Parameters

  • workflow_id (str): Workflow ID to promote.
  • description (str | None, optional): The agent's description. The workflow keeps its own when omitted.

Other​

add_member​

add_member(agent_id: str, *, user_id: str) -> Permissions

Share the agent with a user to clone: they can clone it, never use or change it.

An agent is shared only to clone (role "cloner"); a clone is never shared.

addons​

addons(agent_id: str) -> SyncPaginator[AgentAddon]

List the add-ons an agent uses and what each of its clones gets of each.

On a base, each add-on's clone_addon_mode ("For each clone"): "separate-space" (A separate space in this add-on: one add-on; each clone gets its own isolated database and login; lower cost) or "new-addon" (A new add-on per clone), or None until its owner chooses (the agent cannot be cloned until then). On a clone, what it holds of each of its base's add-ons. Only the agent's owner reads it.

allowed_features​

allowed_features(agent_id: str) -> SyncPaginator[AgentFeature]

List what an agent may do: each feature, and whether it is granted.

On a clone, its base's grants.

analytics​

analytics(agent_id: str, *, days: int = 30) -> AgentAnalytics

Get agent analytics - sessions, runs, success rate, tool use, daily activity.

Runs are every run of the agent: its chat turns, its heartbeat beats and its scheduled tasks' fires.

Parameters

  • agent_id (str): Agent workflow ID.
  • days (int, optional): Number of days to look back (default: 30).

approve_run​

approve_run(agent_id: str, run_id: str, tool_call_id: str) -> AgentRunOutcome

Confirm the delete or send an interactive chat run waits on.

The call runs and the run goes on. Only the run's user, the agent's owner or an admin may.

Raises a conflict error when the run is not waiting on that call.

attach_skill​

attach_skill(agent_id: str, *, skill_id: str, editable: bool | None = None, auto_connected: bool | None = None, connected_by: str | None = None) -> AgentSkill

Attach a skill to an agent; attaching it again answers the attachment unchanged.

Parameters

  • agent_id (str): The agent's ID.
  • skill_id (str): The skill to attach (required).
  • editable (bool | None, optional): Whether the agent may edit the skill; True when omitted.
  • auto_connected (bool | None, optional): Whether the agent attached it itself; True when omitted.
  • connected_by (str | None, optional): Who attached it (agent or user); agent when omitted.

cancel_run​

cancel_run(agent_id: str, run_id: str) -> AgentRunOutcome

Stop an agent run.

A chat turn in progress, or one waiting for a confirmation (that call never runs). Answers once the run has recorded its ending.

chat​

chat(agent_id: str, thread_id: str, message: str, *, interactive: bool = False, subject_id: str | None = None) -> Iterator[dict[str, Any]]

Send a message to an agent and stream the response.

Yields SSE events as dictionaries. Each event has an event field (e.g., "thread.message.delta") and a data field with the payload.

Parameters

  • agent_id (str): Agent workflow ID.
  • thread_id (str): Thread ID for the conversation.
  • message (str): Message to send.
  • interactive (bool, optional): True when your code shows its user a Confirm / Cancel for a delete or send: the run then pauses before a tool that declares it deletes or sends (event thread.run.confirmation_required with run_id, tool_call_id, tool, arguments, kind) until approve_run or cancel_run. Without it the run never waits; it follows the agent's rules.
  • subject_id (str | None, optional): Your app's own id for whom the message is about, kept as metadata.subjectId on the question and the answer (Apps.delete_agent_subject).

Yields

  • dict[str, Any]: SSE event dictionaries.

Examples

for event in client.agents.chat("wf_abc", "thread_123", "/help"):
if event.get("event") == "thread.message.delta":
content = event["data"]["delta"].get("content", "")
print(content, end="")
elif event.get("event") == "thread.run.completed":
print("\n--- Done ---")

clonable​

clonable() -> SyncPaginator[ClonableAgent]

List the bases shared with you to clone, each with your clone once you have one.

clone​

clone(base_agent_id: str) -> Agent

Clone a base into an agent of your own.

The base is one shared with you to clone (clonable), or, on a client made with for_user inside an app, one of the app owner's own agents: the app makes each of its users' clone this way. Everything the base provides is read-only on the clone; you add your own records. A user who has their clone of it already gets a conflict error naming it.

clones​

clones(agent_id: str) -> SyncPaginator[AgentClone]

List a base's clones, each with its user, its app and its sync state.

config​

config(agent_id: str) -> AgentConfig

Read the agent's configuration and whether it runs.

Its personality, operating prompt, context and session policies, heartbeat, sampling, models and connectors. apply_pending is True when a setting was saved after the running agent started: redeploy applies it.

Parameters

  • agent_id (str): The agent's ID.

create_thread​

create_thread(agent_id: str, *, title: str | None = None, subject_id: str | None = None) -> AgentThread

Create a new conversation thread.

Parameters

  • agent_id (str): Agent workflow ID.
  • title (str | None, optional): Thread title (default: "New Conversation").
  • subject_id (str | None, optional): Your app's own id for whom the conversation is about (1 to 200 letters, digits and _ . : -), kept as the thread's metadata.subjectId: Apps.delete_agent_subject deletes every thread and message tagged with it.

delete_thread​

delete_thread(agent_id: str, thread_id: str) -> None

Delete a conversation thread.

Parameters

  • agent_id (str): Agent workflow ID.
  • thread_id (str): Thread ID to delete.

delete_thread_message​

delete_thread_message(agent_id: str, thread_id: str, message_id: str) -> None

Delete one message of a conversation thread; the thread keeps the others.

A message's id is in retrieve_thread; a run's question and answer ids come in its thread.run.created and thread.message.completed events (data.message_id). The thread's user deletes it, and so does the owner of the app whose agent clone the thread is on.

Parameters

  • agent_id (str): Agent workflow ID.
  • thread_id (str): Thread ID.
  • message_id (str): ID of the message to delete.

demote​

demote(agent_id: str) -> Workflow

Turn an agent back into a regular workflow and return the workflow.

Only the mode changes: a deployed agent keeps running until it is stopped.

detach_skill​

detach_skill(agent_id: str, skill_id: str) -> None

Take a skill off an agent; the skill itself is kept.

Parameters

  • agent_id (str): The agent's ID.
  • skill_id (str): The attached skill's ID.

get_template​

get_template(key: str) -> dict[str, Any]

Get a reference agent's Agent Builder payload, to prefill create.

The payload is the Builder's own (personality, operating prompt, skills, rules, connectors), returned as sent.

Parameters

  • key (str): iris, atlas, sage or aria (from list_templates).

library_references​

library_references(agent_id: str) -> SyncPaginator[AgentLibraryReference]

List the Library items an agent reads and the version it reads of each.

A clone reads its base's items at the versions the base pins.

list_connectors​

list_connectors() -> list[AgentConnectorCategory]

List the connectors an agent can be given, by category, each with the fields it asks for.

The same connectors and fields the Agent Builder's Connect step offers: a connector backed by a workflow node asks for that node's connection fields. Pass one to create as {"tileId", "nodeType", "addOnType", "label", "category", "config"} with config keyed by its fields.

list_skills​

list_skills(agent_id: str) -> SyncPaginator[AgentSkill]

List the skills attached to an agent, each with the skill's name and description.

Parameters

  • agent_id (str): The agent's ID.

list_templates​

list_templates() -> list[AgentTemplateSummary]

List the reference agents an agent can be created from: each key and summary.

list_threads​

list_threads(agent_id: str, *, limit: int | None = None) -> SyncPaginator[AgentThread]

List conversation threads for an agent.

Parameters

  • agent_id (str): Agent workflow ID.
  • limit (int | None, optional): The most to return; all of them when omitted.

logs​

logs(agent_id: str, *, lines: int | None = None, container: str | None = None) -> AgentLogs

Recent log lines of an agent's pod, timestamped.

Parameters

  • agent_id (str): The agent's ID.
  • lines (int | None, optional): How many of the last lines (up to 2000); 200 when omitted.
  • container (str | None, optional): The pod's container; the agent runtime's when omitted.

name_available​

name_available(name: str, *, ignore_agent_id: str | None = None) -> bool

Whether an agent name is free for you (names are unique per user).

ignore_agent_id leaves one agent out, to check a rename.

permissions​

permissions(agent_id: str) -> Permissions

Return who the agent is shared with to clone (members with role "cloner").

remove_addon​

remove_addon(agent_id: str, addon_id: str) -> Agent

Take an attached add-on off an agent (agent.attachments.addons).

The add-on is not deleted; once nothing uses it, it can be. Returns the agent without it. A running agent loads the change at its next restart (redeploy).

remove_member​

remove_member(agent_id: str, user_id: str, *, clones: Literal['keep', 'suspend', 'delete'] | None = None) -> None

Stop sharing the agent with a user to clone.

When the user has a clone of it, clones says what happens to the clone, and is required (the platform refuses with 400, naming the clone, without it):

  • "keep": it keeps working as it is, its user's own, but no longer follows the base (it keeps its configuration and the versions of the base's Library items it reads now, still read-only).
  • "suspend": it is stopped and cannot run until the base is shared with the user again; its records are kept.
  • "delete": it is deleted with its user's own records.

Sharing the base with the user again (add_member) makes a kept or suspended clone follow the base again.

remove_tool_workflow​

remove_tool_workflow(agent_id: str, workflow_id: str) -> Agent

Take a tool workflow off an agent (agent.attachments.tool_workflows).

The workflow is not deleted; once no agent lists it, it can be. Returns the agent without it. A running agent loads the change at its next restart (redeploy).

retrieve_thread​

retrieve_thread(agent_id: str, thread_id: str) -> AgentThread

Get one conversation thread of an agent with its messages, oldest first.

Parameters

  • agent_id (str): Agent workflow ID.
  • thread_id (str): Thread ID.

set_allowed_features​

set_allowed_features(agent_id: str, allowed_features: Sequence[str]) -> list[str]

Set what an agent may do: the complete list of features it is granted.

Anything that creates or controls platform resources (projects, workspaces, apps, addons, datasources, deployments, workflows, models, jobs, sharing, stan) is refused to it unless granted. A new agent is granted every feature until its owner restricts it; a base's clones have exactly its features. Refused on a clone. Returns the granted features.

set_clone_addon_mode​

set_clone_addon_mode(agent_id: str, addon_id: str, clone_addon_mode: CloneAddonMode | None) -> AgentAddon

Set what each clone of an agent gets of one of its add-ons ("For each clone").

"separate-space": A separate space in this add-on (one add-on; each clone gets its own isolated database and login, made with the clone and removed with its data when the clone is deleted; the database's own permissions isolate it). "new-addon": A new add-on of the same type and size per clone, deleted with it. None unsets it. Only the agent's owner sets it, never on a clone; it is fixed while a clone holds what it gave. Clones never receive the add-on's own login. Returns the add-on's entry.

set_library_version​

set_library_version(agent_id: str, item_id: str, *, pinned_version: int | None) -> AgentLibraryReference

Pin one of an agent's Library references to a version, or (None) read the latest.

Pins on a source agent hold for every user's clone; a clone refuses its own. A version the item does not have is an error.

stats​

stats(*, search: str | None = None) -> AgentStats

Count the agents list lists, with the same search.

It counts them in all, by status, and the running ones by their last health check.

Every agent you have that matches is counted (not a page).

Parameters

  • search (str | None, optional): As list takes it (name or description).

Returns

  • AgentStats: total, by_status (as list shows each) and by_health (None before the first check), most first.

status​

status(agent_id: str) -> AgentStatus

Get the current status of an agent pod.

Parameters

  • agent_id (str): Agent workflow ID or pod ID.

sync​

sync(agent_id: str) -> CloneSyncOutcome

Sync now: a base's clones (every one out of sync), or one clone.

The clones take everything the base provides (its name and description, its configuration) and running ones are redeployed; a clone that fails stays out of sync with its error. A clone's name is its base's, or "<name> (2)" for a user who already has another agent of that name.

time_series​

time_series(agent_id: str, *, window: SeriesWindow | None = None, granularity: SeriesGranularity | None = None) -> ModelUseSeries

Get an agent's AI Gateway calls over time: requests, errors and tokens.

Counts the calls you may count (your own; an admin everyone's). Its cost is FinOps': client.finops.costs.trends(workload=agent_id).

Every hour (24h) or UTC day (7d, 30d) of the window is a point, from the one its start falls in to the current one; a quiet point counts zero.

Parameters

  • agent_id (str): The agent ID.
  • window ({"24h", "7d", "30d"} | None, optional): The window. The API's default is "30d".
  • granularity ({"hourly", "daily"} | None, optional): hourly for 24h, daily otherwise; the window's when left out (another is refused).

update_config​

update_config(agent_id: str, *, personality: str | None = None, stan_aware: bool | None = None, context_policy: Mapping[str, Any] | None = None, session_policy: Mapping[str, Any] | None = None, heartbeat_enabled: bool | None = None, heartbeat_cron: str | None = None, heartbeat_timezone: str | None = None, max_iterations: int | None = None, temperature: float | None = None, max_tokens: int | None = None, response_format: str | None = None, built_in_tools: Mapping[str, Any] | None = None, knowledge_base_ids: Sequence[str] | None = None, on_demand_mode: Literal['always-on', 'on-demand'] | None = None, idle_timeout_seconds: int | None = None) -> AgentConfig

Change an agent's brain settings; only those given change. Answers the configuration.

A running agent reads its settings when it starts, so call redeploy afterwards; only session_policy applies from the next message without it.

Parameters

  • agent_id (str): The agent's ID.
  • personality (str | None, optional): The agent's voice and style, up to 600 characters.
  • stan_aware (bool | None, optional): True to recommend STAN for things the agent can't do; False (the default for every agent) to say plainly what it can't do and never mention STAN.
  • context_policy (Mapping[str, Any] | None, optional): {"kind": "window" | "summarise" | "hierarchical", "tokenBudget", "keepRecent"}; tokenBudget may not exceed the model's context window. History that no longer fits the budget is dropped, whole turns only, under window (the latest turn is never cut); summarised by the agent's model into one running summary under summarise; and summarised, then its oldest part reduced to titles, under hierarchical. tokenBudget caps each request to the model: the agent's system prompt, its tool definitions, the summary or titles carried for older history, the kept history and the new message. The keepRecent most recent turns (a user message and every reply to it) stay verbatim while they fit the budget.
  • session_policy (Mapping[str, Any] | None, optional): &#123;"idleTimeoutSeconds", "maxSessionDurationSeconds", "maxConcurrentSessionsPerUser", "autoArchiveAfterDays", "allowPerSessionModelOverride"&#125;.
  • heartbeat_enabled (bool | None, optional): Wake the agent on heartbeat_cron to work its due heartbeat tasks.
  • heartbeat_cron (str | None, optional): A five-field cron, such as "0 9 * * 1-5".
  • heartbeat_timezone (str | None, optional): The IANA time zone the cron runs in, such as "America/New_York".
  • max_iterations (int | None, optional): Think-act-observe cycles per turn or heartbeat.
  • temperature (float | None, optional): Sampling temperature, 0 to 2.
  • max_tokens (int | None, optional): Most output tokens per reply: up to what the agent's model generates in one reply (model_max_output_tokens in its config); more is refused.
  • response_format (str | None, optional): json_object or text.
  • built_in_tools (Mapping[str, Any] | None, optional): {"disabled": [...]} with families from memory, rules, skills, tasks, prompts, artifacts and preferences.
  • knowledge_base_ids (Sequence[str] | None, optional): The knowledge bases the agent answers from: the complete list.
  • on_demand_mode (str | None, optional): always-on (one replica stays up) or on-demand (it sleeps after idle_timeout_seconds without a message and wakes on the next one, a task's fire, or its user signing in, so it is ready for their first question). Unchosen, an agent runs always on and the clone an app gives each user runs on demand. A base's clones follow it.
  • idle_timeout_seconds (int | None, optional): With on-demand: seconds without a message before it sleeps (at least 60).

Raises

  • ValidationError: A value the Agent Builder refuses.

update_model​

update_model(agent_id: str, model_id: str, fallback_model_ids: list[str] | None = None) -> AgentConfig

Swap the agent's primary model and its fallback models; answers the configuration.

Call redeploy afterwards to bring a running agent up on the new model.

Parameters

  • agent_id (str): The agent's ID.
  • model_id (str): The AI Gateway model; the agent's context budget must fit its window.
  • fallback_model_ids (list[str] | None, optional): The models to fall back to, in order; none when omitted.

update_operating_prompt​

update_operating_prompt(agent_id: str, operating_prompt_id: str | None) -> AgentConfig

Point the agent at a Library prompt as its operating instructions.

None returns it to the platform default. Answers the configuration; a running agent reads it at its next restart (redeploy).

Parameters

  • agent_id (str): The agent's ID.
  • operating_prompt_id (str | None): The Library system prompt's ID, or None for the platform default.

update_skill​

update_skill(agent_id: str, skill_id: str, *, editable: bool) -> AgentSkill

Set whether an agent may edit a skill attached to it; answers the attachment.

Parameters

  • agent_id (str): The agent's ID.
  • skill_id (str): The attached skill's ID.
  • editable (bool): Whether the agent may edit the skill.