10.03

Handoffs and multi-agent systems

skillmaxingPython with AIHandoffs and multi-agent systems
Visual lesson

Handoffs and multi-agent systems

Included with Pro · 4:45
Lessons · 987 words

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.

Triage routes to a specialist
Figure 1Triage routes to a specialistTriage has no tools of its own. Its only job is to choose.

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.

Pro

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.

Unlock full access to
Python with AIAI researchComplete system design
30% off with LAUNCH30ends in 7h 40m
Buy now
View all plans ·Already Pro? Sign in
124 online