Handoffs and multi-agent systems
Handoffs and multi-agent systems
One agent with ten tools and a page of instructions starts to make mistakes that two agents with five tools each do not. Lesson 09.02 gave the reason: every tool description and every instruction competes for the same attention. The fix is specialisation, and the mechanism the Agents SDK gives you for it is the handoff. A triage agent reads the message and transfers the conversation to a billing agent or a technical agent. From then on the specialist is talking to the customer, with the full history, and its own smaller set of tools.
A handoff is not a router you write. It is a tool the SDK synthesises: when you pass handoffs=[billing, technical], the triage agent's tool list gains transfer_to_billing and transfer_to_technical. The model calls one like any other tool, and the runner responds by switching the active agent rather than returning a tool result. The rest of the run happens under the new agent's instructions.
Continue reading
Pro unlocks every video lesson, the full notes and runnable code across the Python with AI course, from the language itself to agents, MCP, Langfuse and deployment.