Flow
Each inbound message is evaluated in order. As soon as one layer can confidently handle it, routing stops and execution proceeds with a strict tool policy.
Layers
1) Deterministic Router (first)
Fast, rule-based dispatch for high-confidence actions: button clicks, active directives, prefix commands, and configured static rules.
todoist → immediate direct tool call, no LLM needed.2) Constrained LLM (second)
When context is tool-focused, the LLM runs with a strict RoutingPolicy: exact allowed_tools, blocked_tools, and reason.
3) Full LLM (last)
Fallback when deterministic and constrained routing do not apply. Semantic filtering can reduce the tool set first; if confidence is low, it falls back to unconstrained full LLM.
Context State
Router context is stored in session metadata with an explicit state machine:
- Idle: no active tool context.
- ToolFocused(tool, directives, ttl): directed flow with expiry and explicit transitions.
Simple Usage Examples
- “Run my daily briefing cron job”: deterministic route can dispatch directly to cron when a static rule/directive matches.
- “Show me cron failures from yesterday”: constrained LLM in a cron-focused context with strict tool allowlist.
- “What should I do this afternoon?”: full LLM path, optionally narrowed by semantic tool selection.
- Button follow-up flow: button payload routes direct, then context can remain tool-focused for next turns until TTL/override.
Router Configuration
Common routing controls in router config:
[router]
prefix = "!"
semanticTopK = 6
semanticPrefilterK = 16
semanticThreshold = 0.35
[[router.rules]]
trigger = "briefing"
tool = "cron"
params = { action = "list" }
[[router.rules]]
trigger = "todos"
tool = "todoist"
params = { action = "list" }
prefix = "!", typing !briefing lists cron jobs and !todos lists tasks. Both are deterministic dispatches with no LLM call.See Config for full schema and defaults.
Related guides: CLI Reference and Workspace Docs.