Demonstrates fundamental agent-to-agent task delegation using the OpenAI Agents SDK handoff system.
Sign in to save downloads to your library and vote.
Preview
Basic Handoffs
Demonstrates fundamental agent-to-agent task delegation using the OpenAI Agents SDK handoff system.
๐ฏ What This Demonstrates
- Agent Handoffs: Simple task delegation between specialized agents
- Automatic Tool Creation: Handoffs automatically create transfer tools
- Triage Patterns: Intelligent routing based on request type
- Specialized Agents: Different agents for billing and technical support
๐ Quick Start
-
Install OpenAI Agents SDK:
pip install openai-agents -
Set up environment:
cp ../env.example .env # Edit .env and add your OpenAI API key -
Run the agent:
import asyncio from agent import main # Test basic handoffs asyncio.run(main())
๐ก Key Concepts
- Handoff Definition: Adding agents to the
handoffsparameter - Tool Generation: Automatic creation of
transfer_to_*tools - Agent Specialization: Different expertise areas for different agents
- Intelligent Routing: LLM decides which agent to transfer to
๐งช Available Examples
Billing Agent Handoff
- "I was charged twice for my subscription"
- "Can you help me get a refund?"
- "What are my payment options?"
Technical Support Handoff
- "My app keeps crashing"
- "I can't upload photos"
- "The app won't load"
No Handoff Needed
- "What are your customer service hours?"
- "How do I contact support?"
- "What services do you offer?"
๐ป Agent Architecture
# Specialized agents
billing_agent = Agent(name="Billing Agent", instructions="Handle billing issues")
technical_agent = Agent(name="Technical Support Agent", instructions="Handle technical issues")
# Triage agent with handoffs
triage_agent = Agent(
name="Customer Service Triage Agent",
handoffs=[billing_agent, technical_agent] # Creates tools automatically
)
๐ Next Steps
- Advanced Handoffs - Custom configuration and callbacks
- Tutorial 9: Multi-Agent Orchestration - Complex workflows
Ingestion metadata
- Source catalog
- awesome-llm-apps
- Repository
- Shubhamsaboo/awesome-llm-apps ยท main
- File path
- ai_agent_framework_crash_course/openai_sdk_crash_course/8_handoffs_delegation/8_1_basic_handoffs/README.md
- Last refreshed
- 10/24/2026, 3:00:14 AM (5h ago)
- Refresh schedule
- Daily ยท 03:00 UTC
- Dedupe status
- Unique ยท deduped by (source, url)