Intelligence
LiveHybrid Routing
Split workloads intelligently between edge and cloud based on query complexity, maximizing speed while maintaining quality.
Routing Architecture
Loading diagram...
Task Routing
| Task | Where | Why | Latency |
|---|---|---|---|
| Intent classification | Client | Speed, privacy | <100ms |
| Product embeddings | Client | Instant similarity search | <50ms |
| Simple refinements | Client | "cheaper", "different color" | <200ms |
| Complex reasoning | Server | Multi-step planning | 2-3s |
| Inventory updates | Server | Real-time accuracy | 500ms |
| Payment processing | Server | Security, compliance | 1-2s |
Routing Logic
// Simplified routing logic
function routeQuery(query: UserQuery): 'client' | 'server' {
// Check query complexity
const complexity = analyzeComplexity(query);
// Simple queries → Client
if (complexity.isSimpleRefinement) {
// "cheaper", "warmer", "different color"
return 'client';
}
if (complexity.isSemanticSearch) {
// "something like this", similarity queries
return 'client';
}
if (complexity.isIntentClassification) {
// Hover/scroll behavior analysis
return 'client';
}
// Complex queries → Server
if (complexity.requiresMultiStep) {
// "Plan an outfit for hiking next week"
return 'server';
}
if (complexity.requiresInventorySync) {
// Real-time stock checks
return 'server';
}
// Default: server for safety
return 'server';
}Expected Distribution
Client-Side (70-80%)
Simple refinements~40%
Semantic search~20%
Intent classification~15%
Similarity recommendations~5%
Server-Side (20-30%)
Complex planning~10%
Inventory sync~8%
Payment/checkout~5%
Federated learning~2%
Expected savings: 40-60% reduction in server costs through intelligent query routing.