Skip to content

feat: add ruvector-mrl Matryoshka Resolution Index (2.0–3.5× ANN speedup)#609

Draft
ruvnet wants to merge 2 commits into
mainfrom
claude/elegant-heisenberg-99pxl3
Draft

feat: add ruvector-mrl Matryoshka Resolution Index (2.0–3.5× ANN speedup)#609
ruvnet wants to merge 2 commits into
mainfrom
claude/elegant-heisenberg-99pxl3

Conversation

@ruvnet

@ruvnet ruvnet commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds crates/ruvector-mrl: a new Rust library crate implementing Matryoshka Resolution Index (MRL-aware two-stage ANN) for MRL-trained embeddings (OpenAI text-embedding-3, Cohere embed-v3, Nomic embed-v1.5)
  • Two index variants: MrlLinear (brute-force prefix scan + full-dim rerank) and MrlGraph (greedy kNN graph on prefix space + full-dim rerank)
  • Two-experiment benchmark binary documenting the training-dependency finding: MRL speedup requires Matryoshka-trained embeddings
  • ADR-269 and nightly research documentation

Benchmark Results (2026-06-26, release build, N=5000, D_FULL=128, D_FAST=32)

Experiment A — Random Gaussian (no MRL structure)

Variant Recall@10 Speedup QPS
FlatFull 1.000 1.0× 2,241
MrlLinear 0.284 1.9× 4,296
MrlGraph 0.211 3.6× 8,155

Experiment B — MRL-Simulated (α=0.25, prefix is informative)

Variant Recall@10 Speedup QPS
FlatFull 1.000 1.0× 2,327
MrlLinear 1.000 2.0× 4,625
MrlGraph 0.943 3.5× 8,123

Acceptance test: PASS — all 4 criteria met on MRL-structured data.

Test plan

  • cargo test -p ruvector-mrl → 7/7 tests pass
  • cargo run --release -p ruvector-mrl --bin mrl-bench → PASS (all acceptance criteria)
  • cargo build --release -p ruvector-mrl → no warnings from ruvector-mrl
  • All source files under 500 lines
  • No secrets or credentials committed

Files Changed

  • Cargo.toml — added crates/ruvector-mrl workspace member
  • crates/ruvector-mrl/ — new crate (lib.rs, flat.rs, graph.rs, mrl.rs, main.rs)
  • docs/adr/ADR-269-matryoshka-mrl-index.md
  • docs/research/nightly/2026-06-26-matryoshka-mrl-index/README.md
  • docs/research/nightly/2026-06-26-matryoshka-mrl-index/gist.md

🤖 Generated with claude-flow


Generated by Claude Code

claude and others added 2 commits June 26, 2026 07:31
Two-stage ANN index for MRL-trained embeddings (OpenAI text-embedding-3,
Cohere embed-v3, Nomic embed-v1.5). Two variants: MrlLinear (brute-force
prefix scan) and MrlGraph (greedy kNN graph on prefix, beam search).

Measured on MRL-simulated data (alpha=0.25, D_FAST=32/D_FULL=128):
- MrlLinear: 2.0× throughput, 100% recall@10
- MrlGraph:  3.5× throughput, 94.3% recall@10

All 4 acceptance criteria pass. 7/7 unit tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
ADR-269: records the decision to add two-stage MRL-aware ANN indexing
to the ruvector crate family. Documents rationale for two-phase graph
build and the training-dependency finding.

Nightly research (2026-06-26): 24-section README with full benchmark
tables, architecture diagrams, comparison with prior nightly sessions,
and limitations/future work. SEO gist article included.

Co-Authored-By: claude-flow <ruv@ruv.net>
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