Handoffs and routing
Handoffs and routing are the orchestration mechanisms that decide which agent should own the next step of a request and transfer the necessary state to that agent. Routing chooses the specialist; the handoff changes responsibility, carrying enough context, constraints, intermediate results, and authority for the specialist to continue safely.
Multi-agent systems need handoffs because one agent is rarely the best owner of every part of a task. A request may begin as vague intake, become a database question, then require billing or security judgement. If the same agent handles everything, it either needs too many tools and instructions or makes shallow decisions outside its scope. The orchestration problem is assigning work to the right specialist without losing the thread of the user’s intent.
Concretely, an orchestrator or current agent inspects the request and current state, then selects a destination agent using rules, model judgement, classifiers, tool results, or a mixture. It builds a state package containing the goal, relevant conversation, constraints, prior decisions, tool outputs, unresolved questions, and limits on what the next agent may do. The receiving agent works from that package, produces a result, and the orchestrator records it for later steps.
The trade-off is that every handoff is another place to lose information, add latency, duplicate work, or create confusing authority boundaries. Too little state forces the next agent to rediscover context; too much state distracts it or exposes irrelevant information. A common misunderstanding is that every specialist should see the whole transcript. Often the better design is a compact, task-specific brief with clear success criteria and explicit scope.
Engineers meet handoffs and routing when building agent supervisors, specialist workers, support triage bots, code assistants with separate planning and execution roles, or graph-based agent workflows. In practice, you debug routing decisions, state schemas, termination conditions, and ownership rules. Watch for ambiguous destinations, circular handoffs, missing context, conflicting instructions, and agents taking actions they were never meant to authorise.
Common questions
- How is routing different from ordinary prompt chaining?
- Prompt chaining usually means a predetermined sequence of calls, where each step follows the previous one. Routing is conditional: the next owner depends on the request, current state, tool outputs, and sometimes model judgement. A handoff also changes responsibility, not just formatting. The receiving agent is expected to continue the task within its own tools, instructions, and authority.
- What should be included in a handoff?
- Include the user’s goal, the relevant part of the conversation, constraints, decisions already made, intermediate results, tool outputs, open questions, and the receiving agent’s allowed scope. Exclude unrelated transcript, stale reasoning, and information the specialist cannot use. The honest answer is that it depends on the agent’s job: pass what changes its decision or execution.
- Who decides where a request goes next?
- It depends on the architecture. A central supervisor may route every request, the current agent may decide to hand off, or a graph workflow may encode permitted transitions. Some systems use deterministic rules for obvious cases and model-based classification for ambiguous ones. The important engineering choice is making the decision inspectable enough to debug when routing is wrong.
- What are the common failure modes?
- Common failures include sending work to the wrong specialist, omitting key context, passing so much context that the task becomes unclear, repeating work already done, and bouncing between agents without progress. Another serious failure is unclear authority: a specialist may use tools or make commitments outside its intended role unless the handoff defines boundaries.