P930 min
Multi-Agent Systems
Multi-agent systems solve complex tasks through specialization and hierarchical orchestration. Learn the SDK's built-in delegation model, dynamic workflows, and when to build custom patterns beyond them.
SDK Focusagents{}AgentDefinitionhooks.SubagentStart/StopStop hook cleanupWorkflow toolultracodemaxTurns
Why Multi-Agent?
- Specialization - Different agents focus on different domains
- Parallelism - Multiple agents work at the same time
- Failure isolation - Bound one worker's failure when the orchestrator has fallbacks
- Scalability - Add agents as needed
Collaboration Patterns
Hierarchical (Manager-Worker)
Peer-to-Peer
text
┌───┐ ┌───┐
│ A │ ←→ │ B │
└───┘ └───┘
↑ ╲ ╱ ↑
│ ╲╱ │
│ ╱╲ │
↓ ╱ ╲ ↓
┌───┐ ┌───┐
│ C │ ←→ │ D │
└───┘ └───┘