research(nightly): hybrid sparse-dense search — BM25 + ANN with RRF and RSF (ADR-256)#576
Merged
Merged
Conversation
Three-pass research survey selecting hybrid sparse-dense (BM25 + ANN + RRF/RSF) as nightly topic. Covers SOTA, gap analysis vs. ruvector-core, industry comparison (Qdrant, Weaviate, Milvus, Vespa, LanceDB), practical and exotic applications, deep research notes, benchmark methodology, and full reference list. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01NFp4fjSarGCp2xpqJtqP2Z
New standalone crate implementing three hybrid sparse-dense search strategies: ScoreFusion (backward-compat with ruvector-core), RRF (Cormack 2009, k=60, rank-only), and RSF (Weaviate-style per-list min-max + configurable α). BM25 pre-computes TF at index time (O(|q|×P) query) fixing the re-tokenisation-at-query-time bug in ruvector-core (O(N×|d|)). Benchmark: 10K docs × 128-D, 20 topics, 500 queries, k=10. BM25: 77.3% recall@10, 57,174 QPS RSF: 76.6% recall@10, 360 QPS RRF: 50.5% recall@10, 360 QPS Score: 68.8% recall@10, 357 QPS Dense: 7.5% recall@10, 371 QPS No unsafe code. Compiles to WASM. 19 unit tests. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01NFp4fjSarGCp2xpqJtqP2Z
Architecture Decision Record for adding Reciprocal Rank Fusion and Relative Score Fusion to RuVector's hybrid search infrastructure. Documents: gap in ruvector-core (global normalisation + re-tokenisation bug), industry comparison, benchmark evidence, three-phase implementation plan, failure modes, security considerations, and migration path. Status: proposed. PoC in crates/ruvector-hybrid. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01NFp4fjSarGCp2xpqJtqP2Z
Public technical article covering RRF and RSF hybrid search fusion in Rust. Includes feature comparison table, Mermaid architecture diagram, real benchmark results, comparison with 9 vector databases, 8 practical + 8 exotic applications, deep research notes on BM25 dominance and normalisation theory, usage guide, optimization guide, and roadmap. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01NFp4fjSarGCp2xpqJtqP2Z
- centres[t] loop index → iter().enumerate() - percentile cast: drop .max(0) (usize is never negative, clippy::unnecessary_min_or_max) - percentile cast: #[allow] remaining cast lints (intentional saturating cast) - print_row: &mut Vec → &mut [_] - fusion.rs: 3.14 → 3.0 (clippy::approx_constant) - cargo fmt on entire crate Co-Authored-By: claude-flow <ruv@ruv.net>
…-06-17-hybrid-sparse-dense # Conflicts: # Cargo.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nightly research spike (2026-06-17) implementing hybrid sparse-dense retrieval in a new
standalone crate
ruvector-hybrid, with three fusion strategies benchmarked on a 10K-document128-D corpus.
ruvector-core::advanced_features::hybrid_searchcrates/ruvector-hybrid: working Rust PoC — zerounsafe, WASM-compilable, 19 unit testsKey Findings
ruvector-coredefault) is worst among hybrids (68.8%) on keyword-heavy workloads.ruvector-coreBM25 re-tokenises doc texts at query time (O(N×|d|)); this crate pre-computes TF at index time (O(|q|×P)), eliminating the regression.Files Changed
Test Plan
cargo test -p ruvector-hybrid— 19 unit tests passcargo run --release -p ruvector-hybrid— 7 acceptance tests pass, real benchmark numberscargo build --release -p ruvector-hybrid— clean build, zero warningsPhase 2 Work (not in this PR)
FusionStrategyenum toruvector-core::advanced_features::hybrid_searchsearch_rrf()andsearch_rsf()toHybridSearchstructReferences
docs/adr/ADR-256-hybrid-sparse-dense-search.mddocs/research/nightly/2026-06-17-hybrid-sparse-dense/README.mddocs/research/nightly/2026-06-17-hybrid-sparse-dense/gist.md🤖 Generated with claude-flow
https://claude.ai/code/session_01NFp4fjSarGCp2xpqJtqP2Z
Generated by Claude Code