[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3

Handoffs & Multi-Agent Patterns

🤖 The Agents SDK 18 min 350 BASE XP

Agent-to-Agent Delegation

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)

Multi-Agent Patterns

PatternDescriptionUse Case
Manager/RouterCentral agent routes to specialistsCustomer support triage
PipelineAgents chain sequentiallyResearch → Write → Edit
Peer-to-PeerAgents hand off freely between each otherCollaborative problem solving
🎯 Cost Tip: Use cheaper models (GPT-5.4 Mini) for routing/triage agents, and premium models (GPT-5.4 Thinking) for specialist agents that need deep reasoning.
SYNAPSE VERIFICATION
QUERY 1 // 3
What happens during a handoff?
The first agent is destroyed
Control and conversation history transfer to the target agent
Both agents run in parallel
The user must restart the conversation
Watch: 139x Rust Speedup
Handoffs & Multi-Agent Patterns | The Agents SDK — OpenAI Academy