Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
frankensearch
Two-tier hybrid search for Rust: sub-millisecond initial results, quality-refined rankings in ~150ms.
Overview
frankensearch is the main library crate that re-exports and unifies all workspace sub-crates into a single, ergonomic API. It combines lexical (Tantivy BM25) and semantic (vector cosine similarity) search via Reciprocal Rank Fusion (RRF), with a two-tier progressive embedding model that delivers results in two phases:
- Phase 1 (Initial): Fast embedder (potion-128M, 256d, ~0.57ms) produces results immediately via brute-force vector search + optional BM25 fusion.
- Phase 2 (Refined): Quality embedder (MiniLM-L6-v2, 384d, ~128ms) re-scores the top candidates for higher relevance.
Consumers receive results progressively via SearchPhase callbacks, so UIs can display fast results while quality refinement runs in the background.
Query --+-> Fast Embed (256d) -> Vector Search --+-> RRF Fusion -> Phase 1
| |
+-> Tantivy BM25 (optional) -------------+
|
Quality Embed (384d)
|
Score Blend
|
Phase 2 Results
Key Types
IndexBuilder/IndexBuildStats- build a search index from documentsTwoTierSearcher- progressive two-phase search orchestratorTwoTierConfig/TwoTierMetrics- search configuration and per-search diagnosticsSearchPhase- progressive result delivery (Initial / Refined / RefinementFailed)EmbedderStack- fast + optional quality embedder pair with auto-detectionTwoTierIndex/VectorIndex- two-tier and low-level vector index typesScoredResult/FusedHit/VectorHit- result types with provenance trackingFederatedSearcher/FederatedFusion- multi-index federated searchEmbedder/LexicalSearch/Reranker- core traits for pluggable backendsQueryClass- automatic query classificationCanonicalizer/DocumentFingerprint- text normalization and change detection
Feature Flags
| Feature | Description |
|---|---|
hash (default) |
FNV-1a hash embedder, zero dependencies |
model2vec |
potion-128M static embedder (fast tier) |
fastembed |
MiniLM-L6-v2 ONNX embedder (quality tier) |
lexical |
Tantivy BM25 full-text search |
rerank |
FlashRank cross-encoder reranking |
ann |
HNSW approximate nearest-neighbor index |
download |
Model auto-download from HuggingFace |
storage |
FrankenSQLite document metadata + embedding queue |
durability |
RaptorQ self-healing for persistent index artifacts |
fts5 |
FrankenSQLite FTS5 lexical backend |
graph |
Graph-boosted ranking using document relationships |
semantic |
hash + model2vec + fastembed |
hybrid |
semantic + lexical |
persistent |
hybrid + storage |
durable |
persistent + durability |
full |
durable + rerank + ann + download + graph |
full-fts5 |
full + fts5 |
Recommended Combinations
- Development/testing:
default(hash only, no downloads) - Production semantic:
semantic+download - Persistent hybrid search:
persistent - Maximum durability:
durableorfull
Usage
use Arc;
use *;
use ;
use Embedder;
run_test_with_cx;
Async Runtime
frankensearch uses asupersync exclusively -- not tokio. All async methods take &Cx (capability context) as their first parameter. The Cx is provided by the consumer's asupersync runtime; frankensearch never creates its own runtime.
Performance
Measured on a single core (no GPU), 10K document corpus:
| Operation | Embedder | Latency |
|---|---|---|
| Hash embed (256d) | FNV-1a | ~11 us |
| Fast embed (256d) | potion-128M | ~0.57 ms |
| Quality embed (384d) | MiniLM-L6-v2 | ~128 ms |
| Vector search (10K, top-10) | brute-force | ~2 ms |
| RRF fusion (500+500) | - | ~1 ms |
| Full pipeline (hash, 10K) | hash only | ~3 ms |
Dependency Graph Position
This is the top-level library crate that unifies the workspace:
frankensearch-core (always)
frankensearch-embed (always)
frankensearch-index (always)
frankensearch-fusion (always)
frankensearch-lexical (feature: lexical)
frankensearch-rerank (feature: rerank)
frankensearch-storage (feature: storage)
frankensearch-durability (feature: durability)
License
MIT