Lesson 23 of 30
One generalist agent juggling every tool and instruction isn't always the best design — splitting the work across several narrower specialist agents, coordinated by one that delegates, often works better, at the cost of more moving parts.
12 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
Why might splitting one generalist agent into several specialist agents improve reliability?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
A single agent (see the previous lesson) can, in principle, be handed every tool it might ever need and one long system prompt covering every situation. That works, but it doesn't scale gracefully — the more tools and instructions one agent juggles, the harder it is to keep its behavior reliable, since every added tool and instruction is a new way for the prompt to get confused about which rule applies when.
A multi-agent system splits that single generalist into several narrower specialist agents, each with a smaller, more focused toolset and prompt: a research agent that only searches and reads, a coding agent that only writes and edits code, a review agent that only critiques. Coordination between them typically takes one of two shapes:
The reasoning behind why this can outperform one generalist agent is the same reasoning behind why a team of specialists often outperforms one generalist on a complex task: a narrower prompt and toolset is easier to keep correct and predictable than one agent trying to be good at everything at once.
// Rough sketch of a supervisor pattern — conceptual, not a specific SDK's API
async function handleRequest(goal: string) {
const plan = await supervisorAgent.plan(goal);
// plan: [{ agent: "research", task: "find where this bug originates" },
// { agent: "coding", task: "write a fix for the identified cause" },
// { agent: "review", task: "check the fix and explain it clearly" }]
const results: Record<string, string> = {};
for (const step of plan) {
results[step.agent] = await specialists[step.agent].run(step.task, results);
}
return supervisorAgent.assemble(results);
}
Each specialist here can have a short, focused prompt ("you only research and report findings, you never write code") instead of one agent's prompt having to cover research and coding and review conventions all at once, with rules for when each applies.
"When would you use multiple agents instead of one?" is a real system-design question, and the honest answer — narrower, more reliable specialists at the cost of more orchestration and more total model calls — is what separates a candidate who's reasoned about the tradeoff from one who's just repeating that "multi-agent" sounds more sophisticated.