Multi-Agent Routing
When multiple agents are connected to the same channel, the gateway needs to decide which agent handles each incoming message. Hybrix provides three routing strategies to match different use cases.
Routing strategies
| Strategy | Best For | How It Works |
|---|---|---|
| role-based | Specialized teams | Routes based on agent roles and message content analysis |
| round-robin | Load balancing | Distributes messages evenly across available agents |
| intent | Smart dispatching | Uses a lightweight LLM classifier to detect intent and route accordingly |
Role-based routing
The default strategy. The gateway inspects incoming messages for keywords and patterns associated with each agent's role. A message mentioning “code review” routes to a code-reviewer agent, while a general question routes to a general-assistant.
{
"gateway": {
"routing": "role-based",
"fallbackAgent": "Atlas"
}
}If no role matches, the fallbackAgent handles the message. If no fallback is set, the first agent in the config is used.
Intent-based routing
The most intelligent strategy. A small, fast classifier model analyzes each message to determine the user's intent, then routes to the best-matched agent. This adds a small latency overhead (50-100ms) but provides the highest routing accuracy.
{
"gateway": {
"routing": "intent",
"intentModel": "claude-haiku",
"intents": {
"code-help": ["Atlas"],
"research": ["Scout"],
"creative": ["Muse"],
"default": ["Atlas"]
}
}
}Round-robin routing
Distributes messages evenly across agents. Useful when you have multiple identical agents for load balancing, or when you want to A/B test different models.
{
"gateway": {
"routing": "round-robin",
"stickySession": true
}
}With stickySession enabled, once a user is routed to an agent, subsequent messages in the same session continue going to that agent for conversation continuity.