research(nightly): semantic-query-cache — skip near-duplicate ANN calls in agentic workloads - #814
Draft
ruvnet wants to merge 1 commit into
Draft
research(nightly): semantic-query-cache — skip near-duplicate ANN calls in agentic workloads#814ruvnet wants to merge 1 commit into
ruvnet wants to merge 1 commit into
Conversation
Adds 2026-08-10 nightly research: semantic query cache for ANN search. Addresses the near-duplicate query problem in agentic workloads where repeated topic retrieval wastes ANN compute on near-identical results. Includes working Rust PoC (ruvector-semantic-cache), ADR-298, research document, real benchmark results, and SEO gist. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01HYba5iPUkG95TVupqYApbA
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
Adds the 2026-08-10 nightly RuVector research: semantic query cache for ANN search (
ruvector-semantic-cache).Agentic workloads generate near-duplicate query embeddings (cosine sim > 0.97) in rapid succession — an agent revisiting the same topic with slightly different phrasing pays full ANN cost on every call. This crate intercepts those redundant calls before they reach the vector index.
Changes
New crate:
crates/ruvector-semantic-cacheThree variants under a common
SemanticCachetrait:ExactCacheLinearCacheAdaptiveCache19 unit tests pass. Benchmark binary produces real numbers from a deterministic synthetic workload.
Documentation
docs/research/nightly/2026-08-10-semantic-query-cache/README.md— full research documentdocs/adr/ADR-298-semantic-query-cache.md— architecture decision recorddocs/research/nightly/2026-08-10-semantic-query-cache/gist.md— SEO-optimised public articleWorkspace
ruvector-semantic-cacheto workspacemembersinCargo.tomlBenchmark Evidence
x86_64 Linux, 10 000 × 128-dim dataset, 1000 queries (40% near-dup), cache cap = 64.
Ecosystem Connections
ruvector-agent-memory— primary integration target (wrap ANN search withLinearCache)ruvector-speculative-ann— complementary: reduces per-miss cost; cache reduces miss frequencyon_session_startcache warm-up hook (future ADR)vector/cache/statstool surface (future ADR)Test Plan
cargo build --release -p ruvector-semantic-cache— cleancargo test -p ruvector-semantic-cache— 19/19 passedcargo run --release -p ruvector-semantic-cache --bin benchmark— ALL TESTS PASSEDGenerated by Claude Code