research(mhgar): Multi-Hop Graph-Anchored Retrieval — 7.97× recall gain over ANN in CrossCluster#640
Draft
ruvnet wants to merge 2 commits into
Draft
research(mhgar): Multi-Hop Graph-Anchored Retrieval — 7.97× recall gain over ANN in CrossCluster#640ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
Implements three retrieval variants — VectorOnlyRetriever, OneHopExpander, and CoherenceGatedHopper — demonstrating that graph expansion provides ~79 pp recall gain over pure ANN in the CrossCluster regime, but ONLY when graph-edge weights influence reranking (hop_discount > 0). Naive cosine re-ranking after graph expansion gives zero gain; this is documented in a committed test. Key design: num_seeds_to_expand=1 prevents cross-cluster noise flooding; expansion_threshold=0.50 accounts for ANN selection bias in the coherence gate. Benchmark (50 hubs × 10 sats, D=64, 200 queries): OneHopExpander: 0.900 recall vs 0.113 baseline (7.97×), 42 µs CoherenceGatedHopper: 0.898 recall vs 0.113 baseline (7.94×), 56 µs Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01CPsfgW1ifLBUuJuQ9EBn6Y
ADR-272 records the decision: in-process Rust ANN + graph-edge-weighted reranking (hop_discount) fills the gap left by all 2026 Python GraphRAG systems (HippoRAG2, PathRAG, BridgeRAG) which use pure cosine reranking after graph expansion — providing zero gain in CrossCluster. Research README covers: SOTA survey, design rationale, benchmark numbers, threshold calibration finding (ANN selection bias), and future directions. Gist covers the core finding and numbers for external sharing. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01CPsfgW1ifLBUuJuQ9EBn6Y
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
crates/ruvector-mhgar: three in-process Rust retrieval variants (VectorOnly, OneHopExpander, CoherenceGatedHopper) demonstrating Multi-Hop Graph-Anchored RetrievalWhat is MHGAR?
Pure ANN fails for entities that are relationally connected to a relevant hub but live in a different embedding-space region (drug + adverse-effect compounds, legal case + cited precedents, product + accessories). MHGAR solves this by coupling ANN with 1-hop or multi-hop graph traversal, then reranking graph-found entities with a multiplicative
hop_discountscore that reflects trust in the graph edge weight.Key Research Finding
With
hop_discount = 0.0, graph expansion + cosine re-ranking is indistinguishable from VectorOnly in CrossCluster — the expanded satellites rank identically to noise. Onlyhop_discount > 0creates the score differential needed to surface graph-reachable entities. This is committed as a regression test (naive_expansion_no_discount_matches_vector_only).Benchmark Results (50 hubs × 10 sats, D=64, 200 queries)
Files Changed
crates/ruvector-mhgar/— new crate (src/, tests/, examples/, bin/)Cargo.toml— workspace member addeddocs/adr/ADR-272-multi-hop-graph-ann.md— architecture decision recorddocs/research/nightly/2026-07-04-multi-hop-graph-ann/README.md— full research reportdocs/research/nightly/2026-07-04-multi-hop-graph-ann/gist.md— external sharing gistTest Plan
cargo test -p ruvector-mhgar— 12 tests, all greencargo run --release -p ruvector-mhgar --bin benchmark— both acceptance criteria PASScargo run --release -p ruvector-mhgar --example mhgar_demo— prints results for all three variantsGenerated by Claude Code