- Breaking complex tasks into specialized subtasks.
- Parallel processing of independent work items.
- Role-based delegation (researcher, writer, reviewer).
- Isolating concerns with specialized tools and expertise.
Quick Start
Define subagents in your agent configuration:images/main/main.py
images/main/Dockerfile
autonomy.yaml
- Delegate research to the
researchersubagent - Delegate writing to the
writersubagent - Combine their responses
Configuring Subagents
Subagents are defined in thesubagents parameter:
Configuration Options
Required:instructions- System instructions defining the subagent’s role and behavior
model- Model to use. Defaults to parent’s model if not specifiedauto_start- Automatically start subagent on first delegation. Default:Falsetools- List of tools available to the subagentmax_iterations- Maximum reasoning loops. Default: 10max_execution_time- Timeout in seconds. Default: 60max_messages_in_short_term_memory- Message limit. Default: 100max_tokens_in_short_term_memory- Token limit. Default: 8000enable_long_term_memory- Enable persistent memory. Default:Falserunner_filter- Filter for distributing subagents across nodes
Subagent Tools
When you configure subagents, the parent agent automatically gets access to delegation tools:start_subagent
Start a subagent manually:auto_start: True instead.
delegate_to_subagent
Delegate a single task to a subagent:role- The subagent role name (must match a key insubagentsconfig)task- Task description or prompt to send to the subagent
delegate_to_subagents_parallel
Delegate multiple tasks to parallel subagent instances:role- The subagent role nametasks- List of task descriptions
list_subagents
List configured and running subagents:stop_subagent
Stop a running subagent:Delegation Patterns
Sequential Delegation
Delegate tasks one at a time in sequence:Parallel Delegation
Process multiple independent tasks concurrently:Role-Based Delegation
Different subagents for different expertise:Auto-Start Behavior
Subagents start automatically on first use:auto_start: True:
- Parent calls
delegate_to_subagent(role="researcher", ...) - Framework automatically starts the subagent if not running
- Task is delegated
- No need to explicitly call
start_subagent()
auto_start: False (default):
- Parent must explicitly call
start_subagent(role="researcher")first - Then can call
delegate_to_subagent(role="researcher", ...) - Useful when you want explicit control over lifecycle
auto_start: True for simpler agent logic.
Parallel Processing
Process multiple tasks concurrently withdelegate_to_subagents_parallel:
- Independent tasks complete dramatically faster
- Scales to dozens of concurrent tasks
- Automatic cleanup after completion
Runner Distribution
For true parallelism across multiple nodes, use runner filters:- Select which nodes run subagents
- Distribute work across multiple machines
- Format:
"key1=value1,key2=value2" - Subagent-specific
runner_filteroverrides agent-levelsubagent_runner_filter
autonomy.yaml:
Subagent Memory
Subagents have their own isolated memory:- Each subagent instance maintains its own conversation history
- Parent agent’s memory is separate from subagent memory
- Subagents don’t see parent’s conversation history
- Results return to parent as tool responses
- Each parallel instance has completely isolated memory
- Instance A does not see Instance B’s history
- Each task starts with a clean slate
Complete Example
Build a research and writing system with parallel processing:images/main/main.py
autonomy.yaml
secrets.yaml
- Coordinator breaks topic into 3 research questions
- Creates 3 researcher instances working in parallel
- Each researcher uses web search to find current information
- Coordinator synthesizes findings
- Delegates to writer for final article
- Returns polished, well-researched article

