Guide
Single agent vs multi-agent systems
Start with a single agent unless you can name a specific reason to split, such as conflicting instructions, separate permissions or subtasks that can run independently. Multi-agent designs add model calls, handoffs and new failure modes, so each split has to justify them.
What counts as an agent?
The word "agent" is used loosely, so a working definition helps. Here, an agent is a system in which a language model chooses at least some of its own actions, usually by calling tools in a loop. It decides on a step, observes the result and then decides what to do next until the task is complete or a limit is reached.
That differs from a fixed workflow, where the code determines the order of the steps and the model simply fills in parts of them. Many reliable AI features are workflows rather than agents, so check whether you need autonomy at all before comparing agent designs.
How a single agent works
A single agent has one set of instructions, one loop and access to all the tools, so how those tools are designed matters a great deal. A simplified version looks like this:
def run_agent(task, tools, max_steps=10):
messages = [system_prompt(tools), task]
for _ in range(max_steps):
reply = call_llm(messages)
if not reply.tool_calls:
return reply.text
results = run_tools(reply.tool_calls)
messages += [reply, results]
return "Stopped: step limit reached."
This is illustrative rather than tied to a particular library. The structure is small: one loop, a set of tools and a stopping condition.
All the context is in one place, there is no communication between components to get wrong, and a run's history can be read from start to finish. Its weaknesses tend to appear as the scope grows. Instructions become long and contradictory, the model has to choose among too many tools, and the accumulated context becomes large and noisy.
How a multi-agent system works
A multi-agent system divides the work among several agents, each with narrower instructions and its own tools. Common coordination patterns include:
- Supervisor. A central agent or orchestrator assigns tasks to specialists and combines their results. This is easy to reason about, though the supervisor can become a bottleneck.
- Handoff. An agent transfers control to another when the task moves outside its area, as in routing a conversation from general support to a billing specialist.
- Pipeline. Agents run in a fixed order, each working on the output of the one before it. This is predictable, but inflexible.
- Parallel fan-out. Several agents work on independent subtasks at once, and their results are merged. This can reduce overall waiting time when subtasks really are independent.
- Critic and worker. One agent produces a result and another reviews it, looping until it passes or a limit is reached.
An example of the same task in both designs
Imagine a tool that answers questions about a company's products and can also update a customer's order. A single agent would hold the product search and order tools together, with one set of instructions covering both. That may work well. A multi-agent version might give product questions to an agent with read-only search, and order changes to a second agent with write access and an approval step. The second design separates permissions more cleanly and lets each set of instructions stay short, but it needs routing logic and a handoff that preserves the conversation. Neither is correct in the abstract; the details of the task decide.
The trade-offs
| Concern | Single agent | Multi-agent |
|---|---|---|
| Build effort | Lower at first | Higher, as coordination must be designed |
| Context | Shared but can grow noisy | Focused, but details can be lost in handoffs |
| Model calls | Generally fewer | Generally more, raising cost |
| Latency | Usually simpler to control | Slower in sequence, possibly faster in parallel |
| Permissions | All tools in one place | Can be separated per agent |
| Debugging | One history to read | Needs tracing across agents |
| Testing | Fewer interactions to test | Parts testable separately, plus integration tests |
Errors compound. If an early agent misunderstands the task, later agents may build confidently on that mistake, and summarised handoffs can remove the very detail that would have revealed the problem. Each step also has its own chance of going wrong, so more steps means more ways for a run to fail.
When a single agent is enough
Stay with one agent when:
- The task falls within a single domain and has a manageable set of tools.
- Steps depend closely on one another and benefit from shared context.
- Low latency or cost matters a great deal.
- You are still discovering what users need, and simple changes are valuable.
Before splitting up an agent that is struggling, try improving what it already has. Clearer instructions, better tool descriptions, fewer overlapping tools and context trimming often solve the problem at a much lower cost.
When multiple agents are justified
Consider a multi-agent design when you can point to a specific reason:
- Distinct expertise. Subtasks need instructions that conflict or would be unwieldy if combined.
- Separate permissions. One part reads untrusted content while another can take sensitive actions. Keeping those apart can limit the damage from a prompt injection, although it does not remove the risk.
- Independent subtasks. Work can be done in parallel and merged without much coordination.
- Different models. Some steps can use a faster model, while others need a more capable one.
- Independent review. A separate critic with fresh context may catch problems the producing agent overlooks.
- Team ownership. Separate groups need to develop and test different capabilities independently.
A practical way to decide
- Can it be a plain workflow? If the steps are known in advance, write them as code and call the model only where needed.
- Try one agent. Give it a small set of well-described tools and evaluate it against realistic tasks.
- Find the specific failure. Use traces to establish whether the problem is wrong tool choice, context overload, conflicting instructions or something else.
- Fix it in the simplest way. Many problems will not require a new agent.
- Split only along a clear boundary. If a split is justified, separate out the one responsibility causing trouble, then evaluate again to confirm the change helped.
If you do go multi-agent
A few habits help regardless of the pattern you choose:
- Use structured handoffs. Pass defined fields rather than loose summaries wherever possible, and keep references to the original source material.
- Set hard limits. Cap steps, loops and spending per run, and define what happens when a cap is reached.
- Trace everything. Record each agent's input, output, tool calls and routing decisions.
- Control side effects. Validate tool inputs in code, and require human approval for actions that are sensitive or difficult to reverse.
- Prefer explicit orchestration. A clear control layer makes behaviour easier to test. See building an orchestrator with LangGraph.
For help assessing or building a design, see multi-agent systems development.
Choosing a library for this layer is a separate decision, and LangChain vs LangGraph compares two common options by the control flow you need.
Frequently asked questions
Is a multi-agent system more accurate than a single agent?
Not inherently. Focused roles and independent review can help on some tasks, but additional steps and handoffs also introduce new errors. The only reliable way to know is to evaluate both designs on your task.
How many agents should a system have?
As few as the task allows. There is no ideal number. Each added agent should have a clear responsibility and a demonstrated benefit that outweighs its added cost and complexity.
Can a single agent call sub-agents?
Yes. A common pattern exposes a specialist agent to a main agent as if it were a tool. This is effectively a simple supervisor design, and it can be a gentle first step beyond a single agent.
Do multi-agent systems need a framework?
No. They can be written in plain code. A framework becomes more attractive when you need features such as explicit state management, persistence, branching and human review, and do not want to build them yourself.