Quick Start
1
Simple Usage
2
With Configuration
Multi-step routes and step-complete hooks:
How It Works
Choosing a Routing Approach
Pick the mechanism that matches how the decision is made.Configuration Options
RouterAgent — Model Selection
Best Practices
Keep classifier output constrained
Keep classifier output constrained
Instruct the classifier to reply with exact route keys — free-form labels break mapping.
Always provide a default route
Always provide a default route
Unhandled classifications should fall through to a general handler, not fail silently.
Use cost-optimized routing in production
Use cost-optimized routing in production
RouterAgent with routing_strategy="cost-optimized" saves cost on simple queries automatically.Enable hooks while debugging routes
Enable hooks while debugging routes
on_step_complete shows which handler ran — useful when classification is ambiguous.Related
Workflows
Workflow patterns and orchestration
AutoAgents
Automatically created and managed agents

