research(nightly): bandit-tuned ANN — UCB1/Thompson auto-tunes ef_search for optimal recall/latency (ADR-283) - #793
Draft
ruvnet wants to merge 1 commit into
Draft
Conversation
…on MAB Topic selected via scoring: novelty 0.95 × impact 0.90 × feasibility 0.92 = 0.786. No production vector DB (Milvus, Qdrant, Weaviate, Pinecone, LanceDB) implements runtime multi-armed bandit adaptation of ef_search. Gap confirmed by SOTA agent. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01VAiXsj5y5M4A2jt1Q1d9HL
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
ruvector-bandit-ann, a new Rust crate that auto-tunes HNSWef_searchat runtime using Multi-Armed Bandit algorithms (UCB1 and Thompson Sampling)Research Context (ADR-283)
Gap identified: No production vector database (Milvus, Qdrant, Weaviate, Pinecone, LanceDB) implements runtime bandit-based adaptation of
ef_search. All ship static configurations chosen at deploy time.Contribution: A UCB1 bandit observes
reward = recall@k − 0.15 × latency_normper query and converges to the Pareto-optimalef_searchfor the live workload, dynamically adapting as data or query distribution shifts.Benchmark Results (5 000 vectors, dim=96, k=10, 300 queries)
Acceptance criteria — PASS
Files Changed
Cargo.tomlcrates/ruvector-bandit-annto workspacecrates/ruvector-bandit-ann/src/lib.rsHit,AnnVariant,StaticDefault,StaticFast,BanditTuned,recall_at_k,sq_l2crates/ruvector-bandit-ann/src/bandit.rsUcb1BanditandThompsonBanditwith Beta/Gamma samplerscrates/ruvector-bandit-ann/src/hnsw.rsef_searchat query timecrates/ruvector-bandit-ann/src/dataset.rscrates/ruvector-bandit-ann/src/bin/benchmark.rscrates/ruvector-bandit-ann/tests/integration.rsdocs/adr/ADR-283-bandit-tuned-ann.mddocs/research/nightly/2026-08-04-bandit-tuned-ann/README.mddocs/research/nightly/2026-08-04-bandit-tuned-ann/gist.mdTest Plan
cargo test -p ruvector-bandit-ann— 6 unit + integration tests passcargo run --release --bin benchmark -p ruvector-bandit-ann— ACCEPTANCE: PASS with real measured numberscargo build --release -p ruvector-bandit-ann— clean build, no warningsGenerated by Claude Code