Skip to content

How Core Works

How StrataRouter Core routes queries using hybrid semantic search.

What is StrataRouter Core?

StrataRouter Core is the semantic routing engine that decides which handler should process a given query. It combines multiple algorithms for maximum accuracy and speed.

Three-Stage Pipeline

Every route call passes through three stages:

flowchart TB
    QE["Query Embedding"]

    subgraph ROUTER["Router Engine"]
        direction TB
        HNSW["HNSW Index"]
        HYB["Hybrid Scorer"]
        CAL["Calibrator"]
        HNSW --> HYB --> CAL
    end

    RESULT["Route Result"]

    QE --> ROUTER --> RESULT

Components

1. HNSW Index — Fast approximate nearest-neighbor search. Sub-millisecond query time. Hierarchical navigable small-world graphs with O(log N) complexity.

2. BM25 Scorer — Keyword-based sparse matching. Handles exact term matches. TF-IDF with length normalization. Discriminates between similar semantic routes.

3. Pattern Matcher — Deterministic string and regex pattern matching. Fast rule-based routing for known phrases. Override any semantic decision.

4. Score Fusion — Weighted combination of all signals. Learned weights: Dense (64%), Sparse (29%), Rule (7%). Sigmoid normalization.

5. Calibration — Isotonic regression per route. Maps raw fused scores to true probabilities. Expected Calibration Error (ECE) < 0.03.

Performance Summary

Metric Value
P50 Latency <2ms
P95 Latency <6ms
P99 Latency <10ms
Throughput 10,000+ req/s
Memory ~64MB (1K routes)
Accuracy 95.4%

Use Cases

StrataRouter Core is the foundation for customer support routing, intent classification, agent selection in multi-agent systems, query categorization, and any workflow requiring fast, accurate decision-making.

Next Steps