Skip to content

research(nightly): semantic-search-cache — ANN result-set semantic cache in Rust - #798

Draft
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-08-05-semantic-search-cache
Draft

research(nightly): semantic-search-cache — ANN result-set semantic cache in Rust#798
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-08-05-semantic-search-cache

Conversation

@ruvnet

@ruvnet ruvnet commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds ruvector-semantic-cache: zero-dependency Rust crate implementing an ANN result-set semantic cache keyed by cosine similarity
  • Benchmarks three variants — NoCache, SemanticCacheCoarse (t=0.90), SemanticCacheFine (t=0.97) — against a 50 K × 128-dim corpus with realistic mixed agent workload
  • Real measured results: 72.8% hit rate, 92 µs hit latency (vs 7.9 ms corpus scan), 3.5× end-to-end speedup, 94.7% hit recall@10 — all 5 acceptance tests PASS
  • ADR-296 records the architectural decision and production migration path
  • Research doc covers 2026 SOTA (QVCache arXiv 2602.02057), 10–20 year thesis, and ecosystem integration plan

Deliverables

Artifact Path
Crate crates/ruvector-semantic-cache/
Research doc docs/research/nightly/2026-08-05-semantic-search-cache/README.md
ADR docs/adr/ADR-296-semantic-query-cache.md
Public gist docs/research/nightly/2026-08-05-semantic-search-cache/gist.md

Benchmark results (real numbers, 2026-08-05)

Corpus: 50 000 × 128-dim f32 | Queries: 2 400 bench | k=10 | cache=500 entries
Workload: 35% exact repeats | 40% near-dup (σ=0.02) | 25% diverse (σ=0.10)

Variant                  HitRate%  MeanLat µs  p50 µs   HitRecall@10
NoCache                      0.0%    7 925.8   7 885.4        —
SemanticCacheCoarse(t=0.90) 72.8%    2 263.0      97.8    0.947  ✅
SemanticCacheFine(t=0.97)   52.3%    3 921.8     157.6    0.958  ✅

ACCEPTANCE: PASS — all 5 tests passed.

Tests

cargo test -p ruvector-semantic-cache
running 12 tests … test result: ok. 12 passed; 0 failed

SOTA basis

  • QVCache (arXiv 2602.02057, Feb 2026): first paper to cache ANN result sets. No Rust implementation existed.
  • vCache (arXiv 2502.03771): per-query adaptive thresholds, formal error bounds.
  • Category-Aware Caching (arXiv 2510.26835): per-workload-type threshold partitioning.

Gap addressed

Cache invalidation on mutable indices (all prior systems assume static corpora) is an open problem. This PoC establishes invalidate_all() as the conservative correct baseline.


Generated by Claude Code

Adds 2026-08-05 nightly RuVector research: semantic ANN result-set cache.

- Working Rust PoC: ruvector-semantic-cache (zero deps, WASM-safe)
- Three variants: NoCache, SemanticCacheCoarse (t=0.90), SemanticCacheFine (t=0.97)
- 12 unit tests passing
- Benchmark: 72.8% hit rate, 92µs hit latency (vs 7.9ms corpus scan), 3.5× speedup, 94.7% recall
- ADR-296: semantic query cache architecture decision
- Research doc: docs/research/nightly/2026-08-05-semantic-search-cache/README.md
- Public gist: docs/research/nightly/2026-08-05-semantic-search-cache/gist.md

SOTA basis: QVCache (arXiv 2602.02057, Feb 2026) — first to cache ANN result sets.
No Rust implementation existed before this PoC.

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