Uses
agent_framework.orchestrations.HandoffBuilder: the Triage agent classifies the issue and explicitly hands off control to either the Billing agent or the Tech Support agent. Shows explicithandoffevents in the trace.
A Triage agent receives a customer query, classifies it, and hands off to the appropriate specialist. Demonstrates agent-to-agent control transfer, critical for support, routing, and escalation workflows.
| Agent | Role | Instructions | Tools | Termination |
|---|---|---|---|---|
| Triage | Classifier | Acknowledge in one short line, then hand off ONCE to Billing or TechSupport. No follow-up questions. | None | After single handoff |
| Billing | Billing Specialist | Resolve refunds / charges / payments in 2–4 sentences and end with RESOLVED. |
None | When RESOLVED is emitted or max_rounds is reached |
| TechSupport | Tech Specialist | Resolve errors / setup / connectivity in 2–4 sentences and end with RESOLVED. |
None | When RESOLVED is emitted or max_rounds is reached |
The orchestration is bounded by max_rounds=3 to prevent loops on small local models.
Handoff/tool-calling reliability scales with model size. For best results:
phi-4-miniorqwen2.5-7b(recommended) — clean single handoff, reliable terminationqwen2.5-1.5b(default) — works, but may occasionally bounce between specialists
Set the model in .env via FOUNDRY_MODEL=phi-4-mini, or live-switch from the launcher settings panel.
python -m demos.handoff_support.run