Multi-Agent Systems
A coordinator agent delegates to specialist sub-agents via one
tool: agent_spawn.agent (alias Agent). Implementation:
internal/runtime/context/meta/agent.go and
AgentToolSpec() in injection/builtin.go.
Requires coordinator role. When spawn is enabled, kv is also
injected for session-tree key-value sharing.
YAML sketch
agents:
- id: coordinator
role: coordinator
system_prompt: "Delegate with the agent tool. Prefer fan-out."
- id: researcher
role: specialist
system_prompt: "Answer the delegated task briefly."
tools:
modules:
agent_spawn: {}
filesystem: {}
capabilities:
grant:
- module: agent_spawn
- module: filesystem
Specialists are other entries in agents[]. Exact grant / enable
wiring follows the running daemon policy builder.
agent modes (real params)
| Mode | Params |
|---|---|
| Spawn one | agent (or specialist), task (or prompt); optional memory_seed, type (isolated/fork), wait, timeout |
| Spawn many | agents: [{agent, task, ...}] |
| Wait one | run_id, wait: true |
| Wait many | run_ids: [...], wait: true |
| Status | run_id (prefer wait over polling) |
| List | list: true |
| Cancel | cancel: true, run_id (optional cancel_tree) |
Default spawn is non-blocking. There is no reassign
param in the Go handler. Catalog Spec lists only agent/task;
the live AgentToolSpec schema is what the LLM sees.
{"name": "agent", "arguments": {"agent": "researcher", "task": "Capital of France?", "wait": true}}
{"name": "agent", "arguments": {"agents": [{"agent": "researcher", "task": "A"}, {"agent": "researcher", "task": "B"}]}}
{"name": "agent", "arguments": {"run_ids": ["r1", "r2"], "wait": true}}
{"name": "agent", "arguments": {"list": true}}
type: "fork" (or inherit_context) inherits parent conversation
context; default is isolated (task + optional memory_seed only).
Related
- agent_spawn
- Flows for deterministic graphs
- Built-in tools