Glossary
Agent handoff
The transfer of control of a conversation or task from one AI agent to another, along with the context the receiving agent needs to continue.
An agent handoff is the moment one AI agent passes control of a conversation or task to another agent that is better suited to continue it. Unlike a subagent call, the first agent does not wait for a result: the receiving agent takes over, talks to the user or carries on with the work, and becomes responsible for what happens next. The quality of a handoff depends almost entirely on what context travels with it.
How a handoff works
Most multi-agent systems implement handoffs in the same way. Each agent is given the list of agents it is allowed to hand off to, and each of those appears to the model as a tool, such as transfer_to_billing. When the model decides the conversation belongs elsewhere, it calls that tool through ordinary function calling. The framework then swaps the active agent: the new agent’s system prompt, tools and model take effect, and the next turn is handled by the new agent.
OpenAI popularised this shape with its experimental Swarm library and then made handoffs a core primitive of the OpenAI Agents SDK, where an agent declares which other agents it can hand off to and can filter the history it passes along. LangGraph supports the same idea through graph edges and commands that move control between nodes, and most other agent frameworks have an equivalent. The LangGraph vs OpenAI Agents SDK comparison covers how the two differ in practice.
Three things move during a handoff. The first is control: which agent answers next. The second is context: what the new agent knows about the conversation so far. The third is responsibility: which agent owns the outcome, including any promises already made to the user. Frameworks handle the first automatically. The second and third are design decisions, and they are where most handoffs go wrong.
What context travels with a handoff
The simplest approach passes the full conversation history to the receiving agent. This is easy and usually works for short exchanges, but it has the usual costs of a long context window: more tokens on every turn, and earlier turns that may be irrelevant to the specialist. A billing agent does not need twenty turns of troubleshooting a login problem.
A second approach passes a structured handoff payload instead: a short summary written by the sending agent, plus fields such as the user’s identity, the reason for the transfer, what has been tried and any commitments made. This keeps the receiving agent’s context small and focused, which is context engineering applied at the boundary between agents. The risk is that the summary drops something that later turns out to matter, a problem the summarisation vs memory entry covers in detail.
A third approach keeps durable facts outside any one agent’s context altogether. Each agent writes what it learns about the user to a shared memory layer, and the receiving agent retrieves what is relevant to its own job. The handoff payload can then be very short, because the facts it would otherwise carry are already available. This is the approach that holds up best across many handoffs and across sessions.
Approach | What is passed | Strengths | Weaknesses |
|---|---|---|---|
Full history | Every message so far | Nothing is lost; simple to build | Token cost grows with every handoff; irrelevant turns distract the specialist |
Structured payload | Summary, reason, identity, open commitments | Small, focused context | Anything left out of the summary is gone |
Shared memory | A short payload plus a pointer to shared state | Facts survive any number of handoffs and later sessions | Needs a memory store that all agents can reach |
Filtered history | Recent turns or turns matching a filter | Middle ground on cost | Filters can drop the one turn that mattered |
Many production systems combine these: a structured payload for the reason and open commitments, a few recent turns for tone and continuity, and shared agent memory for everything durable.
Handoffs compared with other patterns
A handoff is one of several ways agents divide work, and the differences matter when you choose between them. With a subagent, the parent stays in charge and gets a result back. With a handoff, control moves and does not automatically come back. A supervisor agent sits between the two: it routes each turn or task to a worker and may hand control to a worker for a while, but it remains the place where routing decisions are made. Orchestration is the umbrella term for all of these.
Handoffs also happen between agents and people. Escalation to a human operator is a handoff with the same requirements: the person needs to know who the user is, what the problem is and what has already been tried. Human in the loop designs that treat the human as one more possible destination tend to produce better transfers than those that dump the transcript into a ticket.
Across organisational or vendor boundaries, handoffs need a shared protocol. The A2A protocol is one attempt to standardise how an agent in one system can pass a task to an agent in another, which is part of the wider question of agent interoperability.
Common failure modes
The most visible failure is the user repeating themselves. The receiving agent asks for an account number, a description of the problem or a preference that the user already gave, because none of it travelled. Users notice this immediately, and it is the failure that most undermines trust in customer support agents.
The second is lost commitments. The first agent promised a refund or a callback, and the second agent has no record of it. Payloads should carry open commitments as explicit fields, and those fields should be checked before the receiving agent replies.
The third is ping-pong. Two agents each decide the conversation belongs to the other and pass it back and forth. A cap on the number of handoffs per conversation, and a rule that an agent cannot hand back to the agent that just handed to it without new information, prevents most loops. Guardrails are a natural place for these rules.
The fourth is permission drift. The receiving agent may have tools the first agent lacked, such as issuing refunds. That is often the point of the handoff, but the decision to transfer should not be something a user can trigger simply by asking. Clear agent permissions per agent, and checks on the handoff reason, keep the boundary meaningful.
The fifth is opacity. When an answer goes wrong after three handoffs, you need to know which agent said what and what each one received. Agent tracing that records each transfer, its payload and the active agent per turn turns a confusing transcript into something you can debug.
A worked example
A software company runs a support assistant with three agents: a triage agent, a billing agent and a technical agent. A user writes that they were charged twice and that the export feature has stopped working since the charge.
The triage agent identifies two problems and decides billing is the more urgent. It hands off with a payload naming the user, the two issues, the order it chose and the fact that it told the user billing would be handled first. Before transferring, it writes the durable facts it learned, such as the user’s plan and the date of the double charge, to the shared memory for that user.
The billing agent retrieves those facts, confirms the duplicate charge, issues a refund and records that it did so. It then hands off to the technical agent with a short payload: billing resolved, refund issued, export problem outstanding. The technical agent retrieves the same user facts, sees that the export failure began on the date of a plan change, and checks whether the new plan includes the export feature. At no point does the user have to repeat their plan, the charge date or the original complaint.
If the same user writes again next week, any of the three agents can retrieve what happened, because the facts live outside the conversation. The what support agents get wrong without memory post covers this failure pattern from the user’s side.
Where Exabase fits
Exabase does not route between agents; your framework does that. Exabase is the shared state that makes handoffs carry less and lose less.
Exabase Memory gives every agent in the system the same view of a user. Any agent can send conversation content to the Memory API, which extracts facts, preferences and events, resolves contradictions when they change and returns only what is relevant to a query. The receiving agent in a handoff calls memory search with a question shaped by its own job, such as “billing history and plan for this user”, and gets a few hundred tokens of current facts instead of the full transcript (retrieving memories). Because newer facts supersede older ones when they are written, a user who upgraded last week is on the new plan for every agent, which addresses the entity resolution and stale-fact problems that full-history handoffs inherit.
Scoping keeps that memory safe to share. Creating one Base per user or per customer account and passing its ID with every call means all agents in a conversation see the same user’s facts and no one else’s, a direct form of memory isolation (memory scoping).
For material longer than a fact, such as a case summary or the notes from a troubleshooting session, the sending agent can write a note through Resources and pass its ID in the payload. The receiving agent, a later session or a person can read it, and Deep Search can find it again by meaning. The combination is described in the agent memory solution, and the multi-agent coordination use case shows the same pattern with more agents.
Frequently asked questions
What is the difference between a handoff and a subagent?
In a handoff, control moves to the receiving agent and stays there until it hands off again. With a subagent, the parent keeps control, delegates a task and receives a result back. Handoffs suit routing a conversation to a specialist; subagents suit delegating a self-contained piece of work.
What should a handoff payload contain?
At minimum: who the user is, why the transfer is happening, what has already been tried and any commitments made. Durable facts about the user are better kept in shared memory that the receiving agent can query, so the payload stays short.
Should I pass the full conversation history?
For short conversations, it is the simplest choice. For longer ones, full history adds cost and distraction with every handoff. A structured payload plus a few recent turns and shared memory usually gives better answers at lower cost.
How do I stop agents handing a conversation back and forth?
Cap the number of handoffs per conversation, require a reason for each one, and block an agent from handing straight back to the agent that just transferred to it unless something new has happened. Trace each transfer so loops are easy to find.
Can an agent hand off to a human?
Yes. Escalation to a person is a handoff with the same needs: identity, reason, history of attempts and open commitments. Writing that as a structured summary for the person works better than forwarding a raw transcript.
Do handoffs work across different agent frameworks?
Within one framework they are built in. Across frameworks or organisations you need a shared protocol, such as A2A, or a shared store that both sides can read, such as a common memory layer.
How does memory improve handoffs?
It removes the need to carry everything in the payload. Each agent retrieves the facts relevant to its own job from a shared, scoped store, so nothing has to be re-asked and facts survive across sessions. Exabase Memory does this with automatic extraction and contradiction resolution.
Related pages: Subagents, Supervisor agent, Multi-agent, Orchestration, Agent state, Conversational memory, Customer support agents use case, Chat history is not a user profile, Exabase vs Zep, Agent memory solution, Agent SDK.