What an agent is
An agent is an LLM session. It receives events, reasons inside a scoped session, calls tools, and emits events. An agent is defined inagents.yaml: its subscriptions, the events it may
emit, its tools, its model tier, and whether it keeps memory.
Agents never write entity state directly. They emit events; a system node handler decides
what gets written. So every state change stays in deterministic hands.
agents.yaml
ticket.assigned, keeps one durable conversation per flow instance (in a
per-ticket template flow, that means one per ticket), and may emit ticket.resolved (which
gives it an auto-generated emit_ticket_resolved tool). Its entity_writes let it write the
resolution field through a generated save_ticket_resolution tool, the only entity write it
is allowed.
memory: true needs something to key the conversation on — one conversation per flow
instance. So the agent must live in a flow that has instances (a template flow), not at the
root; a root-level agent with memory: true fails at boot with an error that says exactly
this.
(If “root” and “child” are new here: a Swarm system is a tree of flows. The top one is the
root; a flow it nests is a child. Composing flows covers how
flows nest; you only need the root-vs-child distinction for the rule above.)
Isolation and hierarchical addressing
Each agent runs in a scoped session and observes only the events it subscribes to. A coordinator addresses managers; managers address workers; workers do not share a context window. Messaging scope is enforced and flow-instance-local; there is no “message anyone” default. Per-workspace mounts extend the isolation to the filesystem and process level: each agent (or each flow instance) gets its own/workspace, invisible to the others. See
Agent workspaces and isolation for the mounts and scoping.
One role, many instances
When a single agent would be a bottleneck (it has to score 52 categories, or review 200 files), you run the role in parallel — declaratively.- Split the work — one event per item (
fan_out). - Each event gets its own flow instance, and each instance its own copy of the agent — its own session, workspace, and lifecycle.
- Results converge where a
joindecides when the batch is done, drops duplicates, and enforces a deadline.
Memory
memory is the one field that controls conversation persistence:
memory: false(the default): a fresh conversation per task. The agent sees the triggering event and its tools, does its work, and the conversation ends.memory: true: one durable conversation whose scope is derived from the flow’s instance model — exactly one conversation per (run, agent, flow instance). In amode: templateflow that means one conversation per instance/entity: the agent builds context for one ticket, one customer, one startup over multiple turns.
memory: true in a flow with no per-instance identity fails with an error that says exactly this
naming the fix.
The tools an agent can call
An agent only sees the tools it can use; the platform never injects the full registry. The surfaces are:- Declared tools: entries in the agent’s
toolslist, resolved against the registry (platform_builtin,mcp,http). - Universal tools:
agent_messageandmailbox_send, auto-granted to every agent. - Emit tools:
emit_{event_name}, auto-generated from the agent’semit_events. - Role-scoped entity tools:
read_*/save_*/update_*, generated from the flow’s entity contract and the agent’sentity_writesdeclaration. - Native tools:
bash,web_search,file_io, gated by thenative_toolsfield.

