Pattern · advanced
Multi-Agent Pattern
Multi-agent systems split work across specialized agents with defined roles, handoffs, and shared state.
- multi-agent
- orchestration
Multi-agent architectures assign work to multiple specialized agents that coordinate via messages, a supervisor, or shared state.
When to use
- Distinct skills (research vs writing vs QA)
- Different tool permission sets
- Parallelizable subtasks
When not to use
- One tool loop would suffice
- You cannot define handoff contracts
- Cost/latency budgets are tight
Common topologies
| Topology | Description |
|---|---|
| Supervisor | Manager delegates and merges |
| Peer swarm | Agents converse toward a goal |
| Pipeline | A → B → C sequential specialists |
| Hierarchical | Managers of managers |
Contracts that prevent chaos
- Shared state schema
- Explicit done definitions
- Single writer for critical fields
- Timeouts on waiting for peers
- Budget split across agents
Failure modes
- Infinite debates
- Duplicate side effects
- Contradictory outputs
- Privilege leakage via chat
Evaluation
Test handoffs, conflict resolution, and total cost vs single-agent baseline on the same tasks.
Frequently asked questions
When should you use multi-agent architectures?
Use multi-agent when specialization, privilege separation, or parallel workstreams clearly beat a single agent—otherwise the coordination cost usually wins.
Related reading
Routing and Handoffs Pattern
Routing patterns send tasks to the right agent, model, or workflow based on intent, risk, and skills.
Human-in-the-Loop Pattern
HITL patterns pause agents for human approval, clarification, or takeover on risky or ambiguous steps.
LangGraph vs CrewAI vs AutoGen
Vendor-neutral comparison of LangGraph, CrewAI, and AutoGen for building multi-step and multi-agent systems.