Sub topic 3
Why use more than one agent
This chapter assumes you can write basic Python, know how LLM messages and prompts work, can read JSON, and have seen tool calling. An agent here means a model, a set of instructions, some tools, and a loop that runs until the model gives a final answer.
Start with one agent
A single agent is the right default. It is simpler to build, cheaper to run, and easier to debug. Add more agents only when one agent starts failing in ways you can name.
Signs that one agent is not enough
Most reasons to split work fall into four groups.
- Too many tools. With 30 tools, the model often picks the wrong one or fills in arguments badly. Giving each agent 4 to 6 related tools improves selection.
- Conflicting instructions. A billing agent should be strict and formal. A brainstorming agent should be loose and creative. One prompt that tries to do both usually does each worse.
- Long, mixed context. When the history holds research notes, drafts, and policy text, the model loses track of what matters. A specialist that sees only its own task has less to ignore.
- Different needs per step. One step may need a large, expensive model. Another may need a small, fast one. Separate agents let you choose per step.
Separation also helps with permissions. An agent that can issue refunds can be a different agent from one that only reads order status.
What splitting looks like
Two patterns cover most designs. In a handoff, one agent transfers control of the conversation to another, and the new agent continues with the same message history. In an orchestrator design, a manager agent keeps control and calls specialist agents as if they were tools.
Later chapters build each pattern in code. For now, notice the difference in who holds control. After a handoff, the first agent is out of the loop. With an orchestrator, the manager stays in charge the whole time.
The costs of splitting
Every extra agent adds model calls, so cost and latency go up. Information can be lost at each boundary, because a specialist sees only what it is given. Failures become harder to trace, since a wrong answer may come from any agent in the chain. You also gain new failure modes, such as two agents handing the conversation back and forth forever.
| Factor | One agent | Several agents |
|---|---|---|
| Setup | Simple | More code and prompts |
| Cost per request | Lower | Higher |
| Debugging | One trace | Many traces to follow |
| Tool accuracy | Falls as tools grow | Stays high per agent |
| Prompt focus | Mixed goals | One goal per agent |
A quick test
Before adding an agent, ask three questions.
- Can I name the specific failure of the single agent, such as wrong tool choice or ignored instructions?
- Does the new agent have a distinct job, tool set, or permission level?
- Will the added cost and delay be acceptable to the user?
If you cannot answer yes to all three, keep one agent.
Exercise
A support bot has one agent with 25 tools covering orders, billing, and technical help. It often calls billing tools for shipping questions. Name one reason splitting could help and one cost you would accept.
Show answer
Splitting into agents with a smaller, related tool set each (for example orders, billing, technical) should reduce wrong tool choices, and each agent's prompt can stay focused. The cost is extra model calls, such as a triage step, which adds latency and spend, and the risk that context is lost when control moves between agents.