When one agent stops being enough
The first agent you build will do one thing well. The second will do two things badly. That is the moment to split responsibilities instead of adding instructions to one prompt, provided the split buys different context, different permissions or real parallelism.
The supervisor pattern
A supervisor receives the user goal and decides which specialist should act. Each specialist, such as a research agent or an analysis agent, owns a narrow toolset: data access, external APIs or a human feedback channel. The supervisor merges results and decides whether the goal is met.
for _ in range(MAX_TURNS):
message = llm.chat.completions.create(model=MODEL, messages=messages, tools=TOOLS).choices[0].message
if not message.tool_calls:
return message.content # the supervisor has its answer
messages.append(message.model_dump(exclude_none=True))
for call in message.tool_calls:
output = SPECIALISTS[call.function.name](**json.loads(call.function.arguments))
messages.append({"role": "tool", "tool_call_id": call.id, "content": output})The specialists are the supervisor's tools, each a model call with its own instructions, so control comes back to the supervisor after every step and the code decides when to stop. Handing the whole conversation to a specialist instead would give up that control for as long as the specialist holds it. The full example runs both steps with a turn limit, in Python on the OpenAI SDK and in TypeScript over the REST API, and refuses tools and arguments it does not recognise.
Contracts between agents
In production the pattern depends on the contract between agents more than on the prompt: typed inputs, typed outputs and a trace identifier that follows the request through every hop.
Trade-offs
- Latency grows with every hop. Run specialists in parallel where the plan allows it.
- Cost multiplies. Use a smaller model for routing and a larger one only where judgment matters.
- Debugging needs a timeline view, because logs alone are not enough. Emit spans per agent step.
Where to put humans
Any step that writes to a system of record, spends money or sends a message to a customer should pause for approval until you have months of evidence that it does not need to. Make that evidence a log of whether reviewers approved, edited or rejected each action, and lift the gate for an action type once edits and rejections stop. A gate approved without reading protects nothing, so show reviewers the sources the agent used.
Key takeaways
- Use a clear orchestration pattern, such as a supervisor or a fixed workflow.
- Give every agent one job and one set of tools.
- Put a human feedback step where the cost of a wrong answer is high.
- Trace every hop. Multi-agent systems fail quietly between agents.
Terms in this piece
About this architecture pattern
- Format
- Architecture pattern
- Level
- Practitioner
- Read
- 2 min read
- Published
- Sep 26, 2026
- Disciplines
Reusable shapes with their trade-offs.
More on these topics
Article · · 3 min read
The first AI skill is knowing when to leave the model out
Many model calls in production could be a simple rule. How to tell when a problem needs a model and when it does not.
Comparison · · 8 min read
Direct APIs, MCP tools and Code Mode: three ways an agent reaches your systems
How I choose between hand-written tools, MCP tool calls and Code Mode by where the plan runs, and why I built codemcp to test it.
Decision note · · 2 min read
We built our own TypeScript orchestrator, and stayed on it
Why our enterprise AI platform runs agents on a TypeScript execution layer we started almost two years ago, and why reaching near-parity with the frameworks argued for staying.
Discussion