Pattern · Agents
Supervisor and sub-agents
A lead agent splits work into parts, runs sub-agents with fresh contexts in parallel, and merges their summaries.
Say it in the interview
I would start with one agent and only split when parts are independent or the context overflows; then a lead plans, sub-agents run in parallel with their own tools, and each returns a short sourced summary.
When to use it
- Independent parts that can run in parallel
- One context window cannot hold everything
How it works
- Lead agent: plan the parts → Sub-agent A (own context and tools)
- Lead agent: plan the parts → Sub-agent B (own context and tools)
- Lead agent: plan the parts → Sub-agent C (own context and tools)
- Sub-agent A (own context and tools) → short summary → Lead merges and checks conflicts
- Sub-agent B (own context and tools) → short summary → Lead merges and checks conflicts
- Sub-agent C (own context and tools) → short summary → Lead merges and checks conflicts
Trade-offs
- Parallel and clean contexts
- Several times the tokens of one agent
- Harder to debug
Pitfalls interviewers probe
- Multi-agent where one agent would do
- Sub-agents returning whole transcripts instead of summaries