0

Basic Handoffs

awesome-llm-apps8_1_basic_handoffs

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

  1. Install OpenAI Agents SDK:

    pip install openai-agents
    
  2. Set up environment:

    cp ../env.example .env
    # Edit .env and add your OpenAI API key
    
  3. Run the agent:

    import asyncio
    from agent import main
    
    # Test basic handoffs
    asyncio.run(main())
    

๐Ÿ’ก Key Concepts

  • Handoff Definition: Adding agents to the handoffs parameter
  • 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

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)