Subagents
Delegating tasks to specialized agents.
Overview
Subagents allow the main agent to delegate tasks to specialized agents:
- Complex research
- Code generation
- Data analysis
- Multi-step tasks
How It Works
Main Agent
│
├─── Research Subagent
│
├─── Coding Subagent
│
└─── Analysis SubagentThe main agent can spawn subagents for specific tasks.
Configuration
json5
{
subagents: {
enabled: true,
maxConcurrent: 3,
timeout: 120000,
agents: {
research: {
model: "claude-3-opus",
prompt: "You are a research specialist..."
},
coding: {
model: "claude-3-5-sonnet",
prompt: "You are a coding expert..."
}
}
}
}Use Cases
Complex Research
Delegate multi-source research to a subagent.
Code Generation
Use a coding-specialized subagent for programming tasks.
Data Analysis
Analyze data with a specialized analysis agent.
Execution
Subagents run asynchronously and return results to the main agent.
User Request
│
▼
Main Agent analyzes
│
├─── Spawns Research Subagent ───┐
│ │
│◄───────── Results ──────────────┘
│
▼
Main Agent responds