Multi-Agent Patterns: Handoff
Intent
Transfer control of a live interaction between specialized agents while preserving necessary context—triage routing a customer to billing or technical support.
Introduction
Monolithic agents designed to handle everything often fail because their prompts contain too many instructions and too many tool schemas. When a single model has to choose between 40 different tools and read a 200-line prompt, its accuracy drops, and it is more likely to invoke the wrong tool. The Handoff pattern resolves this by breaking a monolithic agent into a network of small, specialized agents. Instead of running a complex routing workflow, agents are given a first-class primitive: the ability to execute a tool that transfers control to a successor agent.
The Routing Tool Primitive
In a handoff architecture, the transition from one agent to another is managed dynamically by the models themselves:
- Specialized Agents: Each agent is designed for a single topic (e.g., Triage, Billing, Technical Support, Returns). They have tiny system prompts and only the specific tools they need.
- Handoff Tools: Agents are configured with tool schemas that act as handoff mechanisms. For example, the Triage agent has a tool named
handoff_to_billing(). - Context Transfer: When an agent calls a handoff tool, the orchestration framework intercepts the request, pauses the current agent session, packages the conversation state (either full history or a distilled summary), and instantiates the successor agent.
Context Preservation vs. Context Filtering
When handoff occurs, the orchestration framework must decide how much conversation history to pass to the successor agent:
- Full Context Handoff: The entire message history is passed to the successor. This prevents the successor from repeating questions, but reintroduces the context window pressure the handoff pattern was meant to solve.
- Filtered/Summarized Handoff: The triage agent generates a structured summary of the user's intent and details (e.g.,
{ "user_id": "104", "issue": "double charge on July bill" }). Only this JSON summary and the active message are passed to the Billing agent. This keeps the successor's context clean, but can lead to information loss if details are omitted during synthesis.
Trade-offs
Handoffs enable lightweight, highly modular architectures, but shift the engineering challenge to transition boundaries:
High Model Focus & Accuracy
Keeping prompts and toolsets small makes models highly accurate at choosing tools and following instructions.
Easy Developer Maintenance
Adding new capabilities is as simple as writing a new specialized agent and adding its handoff tool to the triage list.
Context Transfer Complexity
Deciding how much context to pass is a major design challenge: too little and the agent repeats questions; too much and isolation benefits disappear.
Routing Loops
Without strict limits, agents can route a user back and forth in an infinite loop (e.g. Triage -> Tech -> Returns -> Triage).
Known Uses
Handoffs have become a primary design pattern in modern agentic customer support and developer SDKs:
- OpenAI Swarm: A lightweight multi-agent orchestration framework that treats agents and handoffs as first-class primitives [1].
- Agent2Agent (A2A) Protocol: An open protocol standardizing how agents discover each other and hand off tasks across process and organizational boundaries [2].
- Customer Support Routing: Production systems that triage incoming tickets and hand them off to specialized refund, billing, or tech agents.
References
-
[1]
OpenAI. (2024). Swarm: An Educational Framework for Exploring Multi-Agent Orchestration. GitHub Repository.
https://github.com/openai/swarm -
[2]
Google. (2025). Agent2Agent (A2A) Protocol Specification. Open Web Spec Documentation.
https://a2a-protocol.org