Skip to content

research(mhgar): Multi-Hop Graph-Anchored Retrieval — 7.97× recall gain over ANN in CrossCluster#640

Draft
ruvnet wants to merge 2 commits into
mainfrom
research/nightly/2026-07-04-multi-hop-graph-ann
Draft

research(mhgar): Multi-Hop Graph-Anchored Retrieval — 7.97× recall gain over ANN in CrossCluster#640
ruvnet wants to merge 2 commits into
mainfrom
research/nightly/2026-07-04-multi-hop-graph-ann

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds crates/ruvector-mhgar: three in-process Rust retrieval variants (VectorOnly, OneHopExpander, CoherenceGatedHopper) demonstrating Multi-Hop Graph-Anchored Retrieval
  • 7.97× recall improvement over pure ANN in the CrossCluster regime (0.113 → 0.900 Recall@10) at only 1.12× latency overhead
  • Documents and tests the reproducible research finding: graph expansion without graph-edge–weight scoring provides zero recall gain in CrossCluster
  • Adds ADR-272 and nightly research report with SOTA survey confirming no existing production system does in-process Rust ANN + graph-edge–weighted reranking

What 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_discount score 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. Only hop_discount > 0 creates 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)

Variant Recall@10 (CrossCluster) Mean latency vs baseline
VectorOnly 0.113 37 µs
OneHopExpander 0.900 42 µs +79 pp, 1.12×
CoherenceGatedHopper 0.898 56 µs +78 pp, 1.50×

Files Changed

  • crates/ruvector-mhgar/ — new crate (src/, tests/, examples/, bin/)
  • Cargo.toml — workspace member added
  • docs/adr/ADR-272-multi-hop-graph-ann.md — architecture decision record
  • docs/research/nightly/2026-07-04-multi-hop-graph-ann/README.md — full research report
  • docs/research/nightly/2026-07-04-multi-hop-graph-ann/gist.md — external sharing gist

Test Plan

  • cargo test -p ruvector-mhgar — 12 tests, all green
  • cargo run --release -p ruvector-mhgar --bin benchmark — both acceptance criteria PASS
  • cargo run --release -p ruvector-mhgar --example mhgar_demo — prints results for all three variants

Generated by Claude Code

claude and others added 2 commits July 4, 2026 07:45
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants