Quick Start
1
Create a Handoff
2
Configure Handoff Behavior
3
Execute a Handoff
User Interaction Flow
Handoff
Main struct for defining agent-to-agent transfers.Methods
HandoffConfig
Configuration for handoff behavior and safety.Configuration Options
Builder Methods
ContextPolicy
Controls how context is shared during handoffs.HandoffResult
Result returned from handoff execution.Factory Methods
Builder Methods
Safety Features
Cycle Detection
Prevents infinite loops between agents.Depth Limits
Limits how deep handoff chains can go.Best Practices
Use Summary context by default
Use Summary context by default
Reduces token usage while preserving essential context for the specialist.
Set appropriate depth limits
Set appropriate depth limits
Use 3-5 for most workflows. Higher values may indicate design issues.
Always enable cycle detection
Always enable cycle detection
Keep
detect_cycles: true to prevent infinite loops in complex agent networks.Use descriptive tool names
Use descriptive tool names
Override tool names to make LLM decisions clearer:
transfer_to_code_reviewer.Related
Agent-Team
Team orchestration
Workflows
Workflow patterns

