When a task is too complex for a single agent, distribute the work across specialized agents. Multi-agent systems combine the strengths of different agents — similar to a team with different roles.
| Scenario | Single Agent | Multi-Agent |
|---|---|---|
| Answering FAQ | ✅ | Overkill |
| Writing + reviewing code | ⚠️ | ✅ (Writer + Reviewer) |
| Research + analysis + report | ❌ | ✅ (Specialized agents) |
| Complex workflow with approval | ❌ | ✅ (Worker + Supervisor) |
An orchestrator agent delegates tasks to specialized worker agents.
CEO Agent
├── Research Agent → Collect data
├── Analysis Agent → Evaluate data
└── Writer Agent → Create report
Advantages: Clear control, easy debugging Disadvantages: Bottleneck at orchestrator, single point of failure
Agents communicate directly with each other without central control.
Advantages: Decentralized, scalable Disadvantages: Harder to debug, consensus finding complex
Agents work sequentially — one agent's output is the next agent's input.
Advantages: Easy to understand, reproducible Disadvantages: No parallelization, errors propagate
The orchestrator breaks the task into subtasks and assigns them to specialists.
Requests are routed to the appropriate agent based on skill profiles.
Multiple agents work on the same task. The final answer is determined by voting or merging — improves quality for critical decisions.
interface AgentMessage {
from: string // Sender agent
to: string // Receiver agent
type: 'task' | 'result' | 'question' | 'escalation'
content: string // Content
context: object // Relevant context
priority: number // Urgency
}
Practical tip: Start with the hierarchical pattern — one orchestrator + 2 workers. Only consider more complex topologies once you've mastered communication.