š§ Intelligent Routing
/development-tools/intelligent-routing
The Route system uses Q-Learning to automatically assign tasks to the best agent based on learned performance patterns.
How Routing Works
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā INTELLIGENT ROUTING ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā ā
ā Task: "Fix authentication bug" ā
ā ā ā
ā ā¼ ā
ā āāāāāāāāāāāāāāāāāāā ā
ā ā Analyze Task ā ā Complexity, domain, keywords ā
ā āāāāāāāāāā¬āāāāāāāāā ā
ā ā ā
ā ā¼ ā
ā āāāāāāāāāāāāāāāāāāā ā
ā ā Q-Learning ā ā Historical success rates per agent ā
ā ā Lookup ā ā
ā āāāāāāāāāā¬āāāāāāāāā ā
ā ā ā
ā ā¼ ā
ā āāāāāāāāāāāāāāāāāāā ā
ā ā Recommend: ā ā
ā ā security-arch ā ā 94% confidence (auth domain expert) ā
ā āāāāāāāāāāāāāāāāāāā ā
ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāRoute Commands
| Command | What It Does | Example |
|---|---|---|
route task | Get agent recommendation | npx ruflo@latest route task "implement OAuth2" |
route explain | Understand routing decision | npx ruflo@latest route explain "task" |
route coverage | Route based on test coverage | npx ruflo@latest route coverage |
Example: Route a Task
bash
npx ruflo@latest route task "refactor authentication to use JWT"
Coverage-Aware Routing
Routes tasks to agents based on test coverage gaps:
bash
npx ruflo@latest route coverage
Routing Hooks
bash
npx ruflo@latest hooks route "implement caching layer" --include-explanation
npx ruflo@latest hooks post-task --task-id "task-123" --success true --agent coderHow Q-Learning Improves Over Time
| Iteration | Action | Result |
|---|---|---|
| 1 | Route "auth task" ā coder | ā Failed (missing security context) |
| 2 | Route "auth task" ā security-architect | ā Success |
| 3 | Route "auth task" ā security-architect | ā Success |
| N | Route "auth task" ā security-architect | 94% confidence (learned) |
The system remembers what works and applies it to future similar tasks.