Strata includes an intent-based routing system that automatically chooses between cheap and premium AI providers.
| Mode | Behavior |
|---|---|
premium_only |
Always use the premium provider (e.g., GPT-4o) |
cheap_only |
Always use the cheap provider (e.g., DeepSeek Flash) |
auto |
Automatically route based on intent and risk |
ask_each_time |
Prompt user to choose provider per message |
- Safety check: Destructive requests (delete, destroy, wipe) are immediately blocked
- Intent classification: Keyphrase-based matching against the user's message
- Risk assessment: Low/medium/high based on intent type
- Provider selection: Cheap for low-risk simple tasks, premium for complex/risky tasks
- Fallback: On cheap provider failure, automatically retry with premium
| Intent | Route | Risk | Examples |
|---|---|---|---|
create_note |
cheap | low | "create a note", "jot down", "save this" |
search_notes |
cheap | low | "find my notes about", "search for" |
tag_note |
cheap | low | "tag this as", "categorize these" |
extract_tasks |
cheap | low | "what are my action items?", "extract todos" |
summarize_note |
cheap | low | "summarize this", "tldr" |
rewrite_search |
cheap | low | "rewrite this search query" |
update_note |
premium | medium | "edit the note", "modify the note" |
complex_reasoning |
premium | medium | "synthesize across", "deep analysis" |
code_architecture |
premium | medium | "code review", "architecture", "refactor plan" |
unknown |
premium | low | Unmatched requests default to premium |
| Destructive | blocked | high | "delete", "destroy", "wipe" |
Default thresholds (configurable in Settings → Advanced):
- Cheap confidence threshold:
0.85— if confidence is below this, escalate to premium - Premium fallback threshold:
0.65— if confidence is below this, require confirmation
When enabled, every routing decision is logged to ai_route_logs:
SELECT * FROM ai_route_logs ORDER BY created_at DESC LIMIT 10;Logs include: intent, route, confidence, risk, provider used, fallback info, and token usage.
When "Show routing decisions in chat" is enabled, a subtle metadata line appears on assistant messages:
Handled by DeepSeek V4 Flash — Reason: simple note creation
Or on fallback:
Escalated to GPT-4o — Reason: complex code architecture request
- Delete/Destroy is blocked — AI cannot delete notes
- Update requires explicit request — AI won't modify notes unless asked
- Confirmation required for medium-risk updates and high-risk operations
- AI Edit Mode setting (read_only/confirm/auto_apply) gates all note modifications
- Fallback on failure — cheap provider failure always retries with premium
app/main/ai/evals/routing-examples.json contains 50+ routing examples for testing and validation. Each example includes expected intent, route, risk, and confirmation requirement.