Agent-to-agent task delegation and collaboration
The handoff system enables seamless task delegation between specialised agents, allowing complex workflows where each agent contributes their expertise.
Agents can transfer conversations to specialists based on context and requirements
Full conversation history and context are maintained during handoffs
Handoffs appear as tools that agents can invoke naturally
Dynamic routing based on conversation context and agent expertise
Parameter | Type | Description | Default |
---|---|---|---|
agent |
Agent | Target agent for handoff | Required |
tool_name_override |
str | Custom name for handoff tool | transfer_to_<agent_name> |
tool_description_override |
str | Custom description | Auto-generated |
on_handoff |
Callable | Callback function | None |
input_filter |
Callable | Filter for conversation data | None |
Use Pydantic models for typed handoff data:
Define specific expertise for each agent to ensure proper routing
Use input filters to manage conversation history size
Implement callbacks to handle failed handoffs gracefully
Limit handoff chains to prevent excessive delegation
The handoff system automatically enhances agent prompts: