Concepts
Routing
How DriftOS makes routing decisions
DriftOS routes messages to semantic branches using one of two strategies: LLM-based (Core) or embedding-based (Embed).
DriftOS Core (LLM Routing)
How It Works
- Analyze - LLM examines message content, conversation history, and existing branches
- Decide - Returns STAY, BRANCH, or ROUTE with reasoning
- Execute - Creates branch if needed, assigns message, updates state
The Three Actions
STAY - Continue in current branch
Current: "dog-adoption"
Message: "What's the adoption fee?"
→ STAY (same topic)BRANCH - Create new branch
Current: "dog-adoption"
Message: "Tell me about black holes"
→ BRANCH (new topic detected)ROUTE - Switch to existing branch
Current: "black-holes"
Message: "Back to dogs—what was the fee?"
→ ROUTE to "dog-adoption" (returning to old topic)Performance
- Routing latency: 500-1000ms (Groq inference)
- Accuracy: High (LLM reasoning)
- Cost: ~$0.001 per routing decision
When to Use
Use DriftOS Core when:
- Accuracy is more important than latency
- You need nuanced understanding of topic shifts
- Your conversations have subtle context that embeddings might miss
- Users frequently switch back to old topics
DriftOS Embed (Embedding Routing)
How It Works
- Embed - Message is embedded using paraphrase-MiniLM-L6-v2
- Compare - Cosine similarity against current branch centroid
- Decide - Based on thresholds: STAY or BRANCH
- Update - Branch centroid updated with running average
The Two Actions
STAY - Continue in current branch
Current: "dog-adoption"
Message: "What's the adoption fee?"
Similarity: 0.87 (> 0.70 threshold)
→ STAYBRANCH - Create new branch
Current: "dog-adoption"
Message: "Tell me about black holes"
Similarity: 0.23 (<0.70 threshold)
→ BRANCHNote: DriftOS Embed does NOT have a ROUTE action. It creates new branches instead of switching to old ones.
Threshold Logic
similarity > 0.70 → STAY (same topic)
similarity <0.70 → BRANCH (new topic)Performance
- Routing latency: <200ms
- Embedding generation: ~30ms
- Zero LLM costs for routing decisions
- LLM used only for fact extraction (optional)
When to Use
Use DriftOS Embed when:
- Latency is critical (<200ms)
- You want zero LLM API costs for routing
- Your topic shifts are clear/obvious
- Conversations are generally sequential (no jumping back to old topics)
Comparison
| Feature | DriftOS Core | DriftOS Embed |
|---|---|---|
| Routing Engine | LLM (Groq) | Embeddings (local) |
| Speed | Fast (~100ms) | Faster (~50ms) |
| Accuracy | High (semantic) | Good (similarity) |
| ROUTE action | ✅ Yes | ❌ No (creates new branches) |
| Branch count | Lower | Higher |
| Cost per route | ~$0.001 | $0 |
| Best For | Nuanced conversations | High-volume apps |
Next Steps
- Choosing a Routing Engine - Detailed comparison
- Branches - How branches work
- Troubleshooting - Fix routing issues
