Skip to content

research(nightly): spectral-ivf — graph-Laplacian partitioned ANN#713

Draft
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-20-spectral-ivf
Draft

research(nightly): spectral-ivf — graph-Laplacian partitioned ANN#713
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-20-spectral-ivf

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Adds nightly RuVector research for Spectral IVF (2026-07-20): graph-Laplacian partitioned approximate nearest-neighbour search using the Fiedler vector as a continuous relaxation of the minimum balanced graph cut.

  • Working Rust PoC: crates/ruvector-spectral-ivf — pure Rust, zero unsafe, zero external deps, WASM-compatible
  • ADR: docs/adr/ADR-272-spectral-ivf.md
  • Research document: docs/research/nightly/2026-07-20-spectral-ivf/README.md
  • Real benchmark results: measured on Linux x86_64, Rust 1.94.1
  • Public gist: docs/research/nightly/2026-07-20-spectral-ivf/gist.md

What this implements

Three IVF variants under a shared AnnIndex trait:

Variant Partitioner Build(ms) Mean(µs) Recall@10 Mem(KB)
KMeansIvf Lloyd's k-means (baseline) 0 18.3 0.801 208.2
SpectralIvf Fiedler bisection (cosine kNN) 90 31.3 1.000 208.2
CoherenceSpectralIvf Fiedler bisection (cosine² kNN) 92 30.9 0.990 208.2

n=800, dim=64, 8 partitions, nprobe=4, 200 queries. All numbers from cargo run --release -p ruvector-spectral-ivf --bin benchmark.

Key finding: Spectral IVF achieves +20 percentage points better recall than k-means at identical memory cost and equal nprobe, by drawing partition boundaries along graph mincuts rather than Euclidean Voronoi cells.

Ecosystem connections

  • ruvector-mincut: Fiedler vector = mincut relaxation (Cheeger inequality)
  • ruvector-coherence: coherence-weighted edges in CoherenceSpectralIvf
  • ruvector-graph: kNN graph is a subgraph of the RuVector graph store
  • ruvector-diskann: partitions map to SSD pages
  • ruvector-spann: complementary (SPANN spills; Spectral avoids wrong assignments at construction)
  • ruvector-capgated: per-partition capability gates
  • MCP memory tools: partition-scoped agent memory namespaces
  • WASM: zero unsafe, no OS calls in search path

Test status

test result: ok. 15 passed; 0 failed; 0 ignored

Acceptance

[PASS] KMeansIvf: recall@10=0.801 (threshold ≥ 0.60)
[PASS] SpectralIvf: recall@10=1.000 (threshold ≥ 0.60)
[PASS] CoherenceSpectralIvf: recall@10=0.990 (threshold ≥ 0.60)
✓ All variants pass recall acceptance threshold.

Research doc

docs/research/nightly/2026-07-20-spectral-ivf/README.md

ADR

docs/adr/ADR-272-spectral-ivf.md

Crate

crates/ruvector-spectral-ivf

Benchmark command

cargo run --release -p ruvector-spectral-ivf --bin benchmark

Generated by Claude Code

Adds ruvector-spectral-ivf: graph-Laplacian (Fiedler vector)
partitioned IVF as an alternative to k-means partitioning.
Recursive bisection at the mincut relaxation groups semantic
neighbours into the same partition, achieving 1.000 recall@10
vs 0.801 for k-means at equal memory and nprobe budget.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01KEdvB9eGLCFC2MVDtXQh8h
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