Handoffs are the primary mechanism for multi-agent collaboration. When Agent A encounters a task outside its expertise, it delegates to Agent B by executing a handoff — a typed tool call that transfers control and conversation history.
from agents import Agent, Runner
billing_agent = Agent(
name="Billing Agent",
instructions="Handle billing questions, refunds, and subscription changes.",
model="gpt-5.4"
)
tech_agent = Agent(
name="Tech Support",
instructions="Handle technical issues, bugs, and feature requests.",
model="gpt-5.4"
)
triage_agent = Agent(
name="Triage Agent",
instructions="Determine if the user needs billing help or technical support. Hand off accordingly.",
handoffs=[billing_agent, tech_agent],
model="gpt-5.4-mini" # Use cheaper model for routing
)
result = await Runner.run(triage_agent, "I was charged twice last month")
# Triage → Billing Agent (automatic handoff)
| Pattern | Description | Use Case |
|---|---|---|
| Manager/Router | Central agent routes to specialists | Customer support triage |
| Pipeline | Agents chain sequentially | Research → Write → Edit |
| Peer-to-Peer | Agents hand off freely between each other | Collaborative problem solving |