Skip to content

Agents

Every AI assistant in abt is an agent: a Markdown file that combines instructions (the system prompt) with capabilities (tools, skills, MCP). That's the whole model—no classes to extend, no framework glue to write. You focus on what the agent should know and do; abt handles the LLM plumbing.

Your first agent

agents/hello.md:

---
description: A friendly greeter.
---

You are a concise assistant. Answer in one short paragraph.

Compile it:

abt compile --project-root .
Compiled 1 agent(s).
Manifest written to: /path/to/my-project/target/manifest.json
Compiled 1 file(s) to: /path/to/my-project/target/compiled/my-project  (agents: 1, prompts: 0)

abt run --dry-run shows the agent's plan without calling a model:

abt run -s hello -p "What can you do?" --project-root . --dry-run
● Run target  selector='hello'
  Execution order: hello

  ✓ hello  model=(profile default)  tools=0  skills=0  sys_prompt_chars=59

  Prompt stem/raw='What can you do?'  resolved_chars=16
────────────────────────────────────────────────────────
No LLM calls or test execution performed.

Drop --dry-run to run the agent. That calls the model, so the project needs a profiles.yaml with a model and credentials (abt init writes one; see Installation).

The filename stem is the agent id (hello). You can override it with name: in frontmatter if you want a different runtime name.

The agent name is passed with -s; -p supplies the user prompt — literal text, or a prompt stem that matches a file under prompts/. See Selectors. Terms such as delegating agent and plain agent are defined in the glossary.

Adding capabilities step by step

Start minimal, then add features as you need them:

Step 1 — Add tools

---
description: Answers weather questions.
tools:
  - get_weather
---

You answer weather questions with the `get_weather` tool.

get_weather is a function under tools/ decorated with @tool — Tools. abt compile fails on a tool name that matches no tool.

Step 2 — Add context (reference docs)

agents/on-call.md:

---
description: An on-call specialist.
tools:
  - fetch_logs
---

You handle data platform incidents.

{{ context.local('on_call_runbook', description='Team runbook') }}

Compile reads context/on_call_runbook.md, so create it too:

# On-call runbook

1. Check the failing DAG in the scheduler.
2. Page the data platform owner if it stays red for 30 minutes.

abt resolves the file at compile time and injects it into the prompt — Context. Without the file, abt compile fails. The last line of its output reads FileNotFoundError: Missing context definition(s) for: on_call_runbook — add context/<name>.md or fix provider kwargs.

Step 3 — Delegate to specialists

Delegation is declared structurally in frontmatter with subagents: — there is no Jinja call for it in the prompt body. agents/coordinator.md:

---
description: Coordinates investigation across multiple tools.
subagents:
  - github-investigator
  - montecarlo-investigator
---

Investigate code changes with `github-investigator` and data quality
issues with `montecarlo-investigator`.

Every name under subagents: must be an agent in the project. Without the two files below, compile stops with ERROR: Agent 'coordinator' delegates to unknown agent 'github-investigator'. agents/github-investigator.md:

---
description: Searches code and pull requests on GitHub.
---

You investigate code changes and pull requests.

agents/montecarlo-investigator.md:

---
description: Investigates data quality alerts.
---

You investigate data quality incidents.

Give the specialists tools from MCP integrations when you need them. See Subagents — but you don't need this until you have multiple specialists.

Step 4 — Wire data in, data out

Agents don't declare sources or exposures. Those are workflow nodes, wired in workflows/. An agent's frontmatter only references standalone retrievers/ and transformers/ resources by name. agents/standup-digest.md:

---
description: Summarizes yesterday's standup notes into a digest.
---

Summarize the standup notes you are given into a short, upbeat digest.

The notes arrive as a source node ahead of the agent, and the digest leaves through an exposure node after it. {{ upstream('standup_notes') }} goes in a prompts/*.md node between them, never in the agent body (compile rejects it there). The workflow wires the five nodes together:

# workflows/standup_digest.yaml
edges:
  - [START, standup_notes]                 # sources/standup_notes.yaml
  - [standup_notes, digest_task]           # prompts/digest_task.md
  - [digest_task, standup-digest]          # agents/standup-digest.md
  - [standup-digest, slack_digest_post]    # exposures/slack_digest_post.yaml
  - [slack_digest_post, END]

Each node name needs a file of its own. sources/standup_notes.yaml:

name: standup_notes
type: slack_channel_digest
credentials: slack
config:
  channel_id: C0EXAMPLE01
  lookback_hours: 24

prompts/digest_task.md:

Summarize yesterday's standup notes:

{{ upstream('standup_notes') }}

exposures/slack_digest_post.yaml:

name: slack_digest_post
type: slack
credentials: slack
config:
  channel_id: C0EXAMPLE02

abt compile and abt graph standup_digest run without Slack credentials, and abt graph prints the flow:

standup_digest

standup_notes → digest_task → standup-digest → slack_digest_post → END

abt dispatch -s standup_digest fetches the channel and posts the digest, so it needs a slack entry in profiles.yaml.

A ref can be a bare name, or a single-key mapping to bind runtime vars at the ref site — same syntax on retrievers:, transformers:. This is a fragment of an agent's frontmatter; it needs a retrievers/ticket.yaml (see Retrievers):

retrievers:
  - ticket:
      id: "{{ var('ticket_id') }}"

Sources and exposures are workflow nodes, not frontmatter fields: a source is wired ahead of the agent that reads it, and an exposure after the agent whose result it delivers. See Sources — workflow nodes and Exposures — workflow nodes.

Order between agents, and scheduling (trigger:), live in Workflows.

See Sources, Exposures, Retrievers, Transformers, Triggers, and Subagents for what subagents: does.

Name resolution

  • Default id = markdown filename stem (hello.md → hello).
  • name: in frontmatter overrides the stem.
  • Duplicate ids fail at compile (Duplicate agent name 'a': agents/dup.md (already defined in agents/a.md)).
  • A file whose frontmatter is not valid YAML fails compile with agents/<file>: invalid YAML frontmatter and the line and column of the parse error.
  • A file whose frontmatter has no description (or an empty one), a field that fails validation, or a key the table below doesn't list, fails compile. One error names every such file and the reason, for example agents/weather.md: unknown frontmatter key 'tols' (did you mean 'tools'?).
  • The file must open with --- on its first line, saved as UTF-8 (a byte order mark is fine; another encoding fails compile and names the file). Blank lines before it fail compile with the opening '---' must be on the first line. A text line before it, even a # agents/x.md comment, makes abt read the file as having no frontmatter, and it is not an agent: it is ignored without a warning.

All frontmatter fields

Field Required Notes
description Yes Short summary for humans and docs catalog
name No Override the filename-derived id
tools No Tool names from tools/ (see Tools). An entry can be a single-key map that sets per-tool approval or runtime caps — see Tool confirmation.
skills No Opt-in instruction packs (see Skills)
few_shots No YAML files under paths.few_shots (default few_shots/) with example turns. See Few-shot examples.
subagents No Agent ids this agent may delegate to as tools (plain strings, or single-key maps for per-dependency overrides) — see Subagents. Unrelated to run order; order lives in Workflows.
general_purpose_subagent No Set false to turn off the auto-injected general-purpose subagent for this agent. See Subagents.
checkpoint No Checkpoint backend config for the entry agent. See Checkpointing.
approvals No External approval config for the entry agent. See External approvals.
doctor No disable: [rule_id, ...] — silence those abt doctor rules for this agent only.
retrievers No Standalone retrievers/*.yaml refs for RAG-style context injection. See Retrievers
transformers No Standalone transformers/*.yaml refs applied to this agent's own result before any downstream exposure node dispatches it. See Transformers
model_id, temperature No Per-agent overrides (defaults from profile)
model_kwargs No Per-agent override of extra model constructor kwargs. Merges over the profile/project-level model_kwargs (lowest priority in the merge chain). Use it for reasoning_effort; it applies to this agent's own model only, not to a different helper model. See Configuration — config.
tags No Strings for abt list -s tag:<name> and catalog filters. Also stamped onto the tags key of the LangChain RunnableConfig on every run, so tracing backends (Braintrust, LangSmith, …) can read them.
meta No Static key/value dict stamped onto the metadata key of the LangChain RunnableConfig on every run, for tracing backends (Braintrust, LangSmith, …) to read. Not templatable — {{ var() }} is not rendered inside meta.
output_schema No Pydantic path for structured JSON output (see below). A workflow's conditional edge also reads it to branch (see Workflows).
recursion_limit No LangGraph step budget for this agent. Wins over agents.<name>.config.recursion_limit and config.recursion_limit in abt.yaml. Compile rejects a value too low for model_call_limit. See Configuration — recursion_limit.
middleware No Guardrail stack (run_timeout, model_call_limit, token_budget, loop_detection, …). See Declarative Middleware.
synthesis_model No A mapping (model: is required; max_tokens, temperature, max_context_messages and system_prompt are optional): the dedicated model for graceful-exit synthesis (timeout / token-budget / loop-detection synthesize triggers). Overrides project config.synthesis_model. See Configuration — config.
access No public | protected (default) | private — activation/export scope. See Access & groups.
group No Optional label. Organizes the docs catalog and scopes access: private activation to same-group agents. See Access & groups.
expose_fs_tools No false mounts filesystem middleware for workspace routing without surfacing read_file/ls/glob to the model. Unset (default) inherits the role default: true for an agent you run that declares subagents:, false for an agent called as a subagent.
on_success, on_failure No Lifecycle handler classes to run when the agent succeeds or fails. Each entry is a class name or a single-key map with __init__ kwargs — see Handlers.

model_id and the Deep Agents prompt suffix

An agent that declares subagents: runs on Deep Agents, which appends a model-specific instruction block to the system prompt for a few exact model strings, such as anthropic:claude-sonnet-4-6, anthropic:claude-haiku-4-5 and anthropic:claude-opus-4-7. The same model reached through another provider spelling, for example bedrock_converse:eu.anthropic.claude-sonnet-4-6, gets no suffix, so the prompt (and its token count) differs between the two. The suffix is not in target/compiled/; use abt compile --show-request to see the system blocks your model receives.

What the model receives

Your prompt body reaches the model unchanged, with <!-- ... --> comments removed at compile time (fenced code blocks and inline code keep theirs). The runtime adds more around it, and abt compile --show-request AGENT prints the result:

Addition When Rough size
Filesystem tools (ls, read_file, write_file, edit_file, delete, glob, grep) Agent with subagents: (supervisor) about 2,100 tokens
task tool and subagent descriptions Agent with subagents: about 400 tokens, more with many subagents
Skills block (locations, list, one-paragraph how-to) Agent with skills: about 100 tokens plus the skill list
Output-schema tool output_schema: set size of the schema

Variables in frontmatter. {{ var('name') }} is substituted at compile time on four scalar fields (model_id, temperature, recursion_limit, output_schema), on on_success/on_failure handler kwargs, and on ref-site vars: of retrievers:/transformers:. Other fields do not accept a {{ var() }} template. See Jinja variables.

Exposure timing

An exposure fires when its own predecessor completes, not when the whole dispatch finishes. Where an exposure sits in the workflow graph decides what it sends. The rule and a worked example are in Exposures — exposure timing.

Access & groups

access sets who may activate an agent from another agent's subagents: edge; group labels it (and, for private, scopes that access). The model is dbt-shaped:

This does not restrict direct invocation. abt run -s <agent-name> and abt watch run any agent in the manifest by name, regardless of access/group — those fields are enforced only on the compile-time activation graph (below), never on the CLI entrypoint. Don't treat access: private as a security boundary for who can run an agent directly.

access Meaning
public Consumable by other projects via Loom (the export gate is exactly access == "public").
protected (default) Local-only. Any agent in the same project may subagents: it.
private Local-only and, when a group is set, only agents in the same group may subagents: it. A private agent with no group is unrestricted.

Enforcement happens at compile time. A cross-group activation of a private target fails with Agent 'other' (group='other') delegates to private agent 'priv' (group='billing'). A private agent may only be delegated to by agents in the same group. Workflow edges are not checked against access/group.

agents/refund-policy.md is private to billing:

---
description: Internal refund-policy lookup.
access: private
group: billing
---

You answer questions about the refund policy.

agents/refund-handler.md is in the same group, so it may activate it:

---
description: Resolves a refund request.
group: billing
subagents: [refund-policy]
---

You resolve refund requests. Ask `refund-policy` when the policy is unclear.

Both files compile together. An agent in a different group (or none) that lists subagents: [refund-policy] fails to compile with the error above.

Structured output (contracts)

When to use: you need the agent to return machine-readable JSON that downstream systems or downstream workflow nodes depend on. Without a contract, you rely on the LLM's formatting discipline. A workflow's conditional edge (when:/cases: or conditions:) reads this — see Workflows.

Step 1 — Write a Pydantic model under contracts/:

# contracts/summary.py
from pydantic import BaseModel, Field

class SummaryResponse(BaseModel):
    summary: str
    confidence: float = Field(description="Confidence from 0 to 1")

Step 2 — Reference it in frontmatter:

---
description: Summarize as structured JSON.
output_schema: summary.SummaryResponse
---

Return only JSON matching the contract.

summary.SummaryResponse resolves to contracts/summary.py → class SummaryResponse. No __init__.py needed.

When the run succeeds, RunResult.structured contains the validated model_dump() dict, and target/run_results/<run_id>/run_results.json includes structured.

In a workflow: when a predecessor node produced structured, the downstream agent's thread context contains JSON (not free-form text) inside the <upstream_agent> block — giving a stable shape to parse.

Advanced: output_schema validation uses model_cls.model_validate(...) after streaming finishes. If validation fails, the run is ok: false with field-level Pydantic errors. The runtime passes the class to LangChain as response_format so provider-native structured output is used where available.

Bedrock note: Avoid Pydantic ge/le/gt/lt constraints on float fields — Bedrock rejects minimum/maximum in JSON Schema. Use the description to communicate the range instead. See strict_tools for grammar-limit details.

Real-world example: incident triage

# contracts/incident.py
from pydantic import BaseModel, Field

class InvestigationResult(BaseModel):
    root_cause: str = Field(description="One-sentence root cause")
    evidence: list[str] = Field(description="PR URLs, log snippets")
    solution: str = Field(description="Concrete fix or next step")
    confidence: float = Field(description="Confidence from 0 to 1")

Delegating agent frontmatter:

output_schema: incident.InvestigationResult

A downstream workflow node now receives validated JSON instead of unstructured prose.

Few-shot examples

A few-shot file is a YAML list of turns, stored under few_shots/ (or paths.few_shots). Each item has exactly one key:

  • human: — a user message.
  • agent: — the assistant's reply.
  • tool: — a tool call with name:, optional args:, and result:. abt expands it into the tool-call turn and its reply.
# few_shots/refund_examples.yaml
- human: "Tour cancelled, still no refund for my 84 EUR."
- agent: '{"route": "refund"}'

Reference the file by its path relative to the few-shots folder:

---
description: Routes refund requests.
few_shots:
  - refund_examples.yaml
---

A path that doesn't exist is skipped at run time with a warning, and a malformed file fails the run.

Tool confirmation (experimental)

Experimental

The approval gate is experimental: tool confirmation, external approvals (approvals:), the provider interface and the on_missing_gate default may change in a minor release.

Require a human to approve specific tool calls before they execute. Declare confirmation inline per tool using a single-key map in tools::

For out-of-band approvals (Slack reactions, Jira comments, or custom providers) during abt dispatch runs, see External approvals. The same confirmation_required: true flag is the switch both systems look at; the gate is chosen by the runtime surface.

tools:
  - read_logs          # plain string — no confirmation
  - restart_service:   # single-key map — confirmation required
      confirmation_required: true
      approval_timeout: 300       # seconds the human has to decide (omit = wait forever)
      on_approval_timeout: deny   # deny | approve
      execution_timeout: 60       # seconds the tool body may run (see Tool runtime caps)
  - execute_runbook:
      confirmation_required: true
      on_missing_gate: raise   # deny | approve | raise

approval_timeout and execution_timeout cap different things. approval_timeout caps only the human wait (stops the moment the reviewer reacts). execution_timeout caps the tool call itself — see Tool runtime caps — and applies whether or not the tool needs approval. On an approval-gated tool, the execution_timeout clock starts only after approval is granted, so reviewer wait time never counts against it. Neither is the run_timeout middleware, which caps the whole agent run (middleware: - run_timeout: ...).

When confirmation_required: true the middleware intercepts the tool call and asks the active gate for a human decision. The gate depends on the surface:

Surface Gate
abt run on a TTY CliConfirmationGate — click.confirm in the terminal
abt docs serve chat AsyncQueueConfirmationGate — Approve / Deny buttons in the browser
abt dispatch with approvals: configured ExternalApprovalGate — Slack / Jira / custom provider (see External approvals)
Non-interactive (CI, cron, SDK) without approvals: no gate — falls back to on_missing_gate policy, which denies the call by default

Policy fields

Field Default Description
confirmation_required true Set false to explicitly opt out (e.g. override a project default)
approval_timeout null (wait forever) Seconds the confirmation gate may wait for a human decision. Only the human wait is counted; never the tool body.
on_approval_timeout deny What to do when approval_timeout elapses: deny returns an error to the model; approve lets the tool run
on_missing_gate deny What to do when no gate is attached: deny (model gets an error naming the tool and how to allow it), approve (headless runs proceed), raise (abort the run loudly)

execution_timeout is not a confirmation field. It lives on the same tool entry but is resolved independently — see Tool runtime caps.

on_missing_gate explained

Non-interactive callers (scheduled runs, abt dispatch, SDK scripts, unit tests) run without a gate. The agent's frontmatter still says confirmation is required, but there is no human. Choose:

  • deny (default) — return an error ToolMessage that names the tool and how to allow it; the model can continue or report why it could not complete. A headless run never executes a gated tool unless you opt in.
  • approve — execute without prompting. Use when headless automation is safe and you only want the prompt when a human is present.
  • raise — abort the entire run with a RuntimeError. Use when running headlessly is always a bug (production deployments, blast-radius operations).

Project-level defaults

Set defaults in abt.yaml so you don't repeat policy dials on every agent:

config:
  confirmation:
    defaults:
      approval_timeout: 600      # how long the human has to decide
      on_approval_timeout: deny  # what happens when the human doesn't
      on_missing_gate: raise     # what happens in headless runs

execution_timeout is not a confirmation policy field — set it under config.tools.defaults, see Tool runtime caps.

Per-tool frontmatter always wins over project defaults.

To let one headless run execute gated tools without editing YAML, use an existing switch:

Entry point Opt-in
abt run --yes (-y); SDK: auto_approve_tools=True
abt dispatch, abt watch --bypass-approvals approve or ABT_BYPASS_APPROVALS=approve (see Bypass modes)
Any on_missing_gate: approve on the tool or under config.confirmation.defaults, or ABT_CONFIRMATION_ON_MISSING_GATE=approve

To disable all confirmation (CI / dev loop) export ABT_CONFIRMATION_ENABLED=false.

Environment variables

Variable Type Effect
ABT_CONFIRMATION_ENABLED bool false disables all confirmation globally
ABT_CONFIRMATION_APPROVAL_TIMEOUT float Override default approval_timeout (seconds) — human-wait budget
ABT_CONFIRMATION_ON_APPROVAL_TIMEOUT deny\|approve Override default on_approval_timeout
ABT_CONFIRMATION_ON_MISSING_GATE deny\|approve\|raise Override default on_missing_gate

The tool-body runtime cap has its own env var, ABT_TOOL_EXECUTION_TIMEOUT — see Tool runtime caps.

Background (async) subagents

By default every subagent call blocks the parent's turn until it finishes. Mark a subagent mode: async to dispatch it in the background instead: the parent's turn ends immediately and it retrieves the result later via check_subagent_task. Reserve async for subagents expensive enough that blocking the parent on them is wasteful:

subagents:
  - sub-a-104                  # unchanged: sync, blocking
  - name: sub-b-104
    mode: async                # opt-in per subagent

Project-wide default (abt.yaml):

config:
  subagents:
    defaults:
      mode: sync   # sync | async | fork
Variable Type Effect
ABT_SUBAGENTS_MODE sync | async | fork Dispatch mode for subagents without their own mode:; overrides abt.yaml when set

Precedence: per-subagent mode: > ABT_SUBAGENTS_MODE > config.subagents.defaults.mode > sync (framework default).

Fork subagents

A normal subagent only sees the task text the parent wrote for it. Mark it mode: fork and it starts from the parent's conversation instead (as compacted so far), then the task. Use it when the task leans on facts already established, such as identifiers, figures or earlier findings, and re-stating them in the task text would be wasteful or lossy:

subagents:
  - name: fork-demo-worker
    mode: fork     # blocks like sync, but continues the parent's conversation

A remote (loom) subagent cannot be forked: abt warns and runs it sync.

Limitation: the in-flight asyncio.Task is process-local, not checkpointed. If the abt process restarts while a background task is running, check_subagent_task reports that task as lost rather than hanging — there is no cross-restart durability. This applies equally to tasks started via a code-interpreter's programmatic tool call bridge (which bypasses the checkpointed graph state) — a process-local metadata table is the source of truth every tool reads from, so those tasks are just as visible to check_subagent_task/cancel_subagent_task/update_subagent_task as ones started normally.

Notification is mandatory, not configurable: BackgroundSubagentMiddleware always nudges the model on every subsequent turn while a background task is still running or has finished and gone unread — similar to how Claude Code surfaces background-task completion. There is no opt-out; an unread finished task (or a still-running one) always resurfaces in the next turn's system prompt.

Updating a running task: call update_subagent_task(task_id, additional_instructions) to interrupt a still-running task and restart it with the same task_id and additional_instructions appended to its original task description. This is the ephemeral, in-process equivalent of interrupting and re-running a remote job on the same thread: the new run sees the full original task plus the new instructions, because it's built from the combined description. Only valid while the task's status is still running; a finished, cancelled, or timed-out task must be restarted with a fresh start_subagent_task call.

Task metadata: every task the model can query carries created_at, last_checked_at (set on every check_subagent_task call), and last_updated_at (set whenever the task's status or result changes — start, update-restart, or any terminal transition), in addition to status, description, and result.

Hard timeout: a background subagent's run is capped by a wall-clock timeout — it has no server-side owner to kill it otherwise. A task that exceeds the cap is force-stopped and reported with status timeout the next time it's checked.

config:
  subagents:
    defaults:
      timeout_seconds: 900   # hard cap for background subagent runs (default: 900 = 15 min)
Variable Type Effect
ABT_SUBAGENTS_TIMEOUT_SECONDS float Hard timeout (seconds) for background subagents; overrides abt.yaml when set

Precedence: ABT_SUBAGENTS_TIMEOUT_SECONDS > config.subagents.defaults.timeout_seconds > 900.0 (framework default).

Hard guarantee — no lost work: the CLI process can never exit while a background subagent is still running, even if the model finishes its turn without checking it. AbtRunner.ainvoke drains every live background task to completion before returning, regardless of whether the parent run succeeded or raised — asyncio.run() would otherwise cancel any task still pending in its loop at shutdown. The only way to skip the drain is a genuine process interrupt (Ctrl-C / SIGTERM).

Tool runtime caps

execution_timeout caps only the tool body — how long tool.ainvoke(...) may run before the middleware cancels it and returns a terminal ToolMessage whose content begins with [ABT_EXECUTION_TIMEOUT]. That prefix is how downstream nodes and the stream processor recognise the cancellation, so the LLM does not silently retry.

It applies independently of confirmation: set it on any tool that can hang (network calls, subprocesses, flaky third-party APIs), whether or not a human has to approve the call first. If no execution_timeout is set, the tool can run until the run's hard timeout; with a run_timeout middleware it is also cancelled at the graceful deadline.

Per-tool

Set execution_timeout on the same tool entry — next to (or instead of) any confirmation keys:

tools:
  - read_logs:
      execution_timeout: 30           # no approval needed, just cap runtime
  - restart_service:
      confirmation_required: true     # human approval
      approval_timeout: 300           # … with a 5 min human-wait budget
      execution_timeout: 60           # … and a 1 min tool-body budget after approval

Project-wide safety net

Set a default in abt.yaml and every tool on every agent inherits it (per-tool entries still win):

config:
  tools:
    defaults:
      execution_timeout: 300   # no tool on any agent may hang past 5 min

config.tools is a separate top-level block from config.confirmation — runtime caps and approval policy are configured independently.

Environment variable

Variable Type Effect
ABT_TOOL_EXECUTION_TIMEOUT float Override default execution_timeout (seconds) for every tool on every agent; per-tool frontmatter and config.tools.defaults still win.

Python-defined agents

You can skip Markdown entirely for agents built in Python:

# agents/hello_py.py
from abt import agent

@agent(
    description="Minimal Python-defined agent.",
    temperature=0.2,
)
def hello_py():
    """You are a helpful assistant. Reply in one short sentence."""
  • Function name = default agent id.
  • Docstring = system prompt (or the return value of the function if it's non-empty and has no required parameters).
  • Everything else (tools, output_schema, …) is passed as kwargs to @agent(...).

When to use Python agents: when your system prompt is generated dynamically at compile time, or when you want the agent config close to the Python code it depends on. For most agents, Markdown is simpler.

See Inline profiles for programmatic use without a profiles.yaml on disk.