research(nightly): adaptive ANN ef-search tuning via UCB1 & ε-greedy bandit#636
Draft
ruvnet wants to merge 1 commit into
Draft
research(nightly): adaptive ANN ef-search tuning via UCB1 & ε-greedy bandit#636ruvnet wants to merge 1 commit into
ruvnet wants to merge 1 commit into
Conversation
Introduces adaptive ANN beam-width tuning via multi-armed bandits. Crate ruvector-ef-bandit implements UCB1 and epsilon-greedy policies that self-select ef values from a candidate set and learn the optimal beam width from query-level recall feedback. Benchmark (n=10k x 64d, 1k queries, release build): - Baseline fixed ef=50: recall@10=0.429, 89.5μs mean, 11,139 QPS - UCB1 bandit: recall@10=0.471 (+9.8%), settled on ef=100, 176B state - ε-Greedy decay: recall@10=0.502 (+17.0%), settled on ef=100 All 20 unit tests and 5 acceptance tests pass. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_0177cAuYVyuNho7UnPML3Ao5
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
crates/ruvector-ef-bandit: adaptive ANN beam-width (ef) tuning via multi-armed bandit policies — UCB1 and ε-greedy with exponential decay.efcandidate from query-level recall feedback, converging to a better operating point than any static default.Changes
New crate:
crates/ruvector-ef-banditsrc/lib.rsAdaptiveSearchtrait,SearchConfig,QueryResult,RunStatssrc/bandit.rsUcb1Bandit+EpsilonGreedyBanditwithArmstructsrc/graph.rssrc/search.rsBaselineSearch,Ucb1Search,EpsilonGreedySearchsrc/dataset.rssrc/metrics.rsrecall_at_k,latency_stats_ns,throughput_qpssrc/main.rsef-bandit-bench)All files under 500 lines. 20 unit tests. 5 acceptance tests, all PASS.
Documentation
docs/research/nightly/2026-07-03-adaptive-ef-bandit/README.md— Full research document (SOTA survey, forward thesis, architecture, measured results, failure modes, ecosystem fit)docs/adr/ADR-272-adaptive-ef-bandit.md— Architecture Decision Recorddocs/research/nightly/2026-07-03-adaptive-ef-bandit/gist.md— SEO-optimised public articleBenchmark results (real,
cargo run --release -p ruvector-ef-bandit)Test plan
cargo test -p ruvector-ef-bandit— 20 tests should passcargo run --release -p ruvector-ef-bandit— benchmark with 5 acceptance testsdocs/adr/ADR-272-adaptive-ef-bandit.md— open questions in ADRruvector-coreHNSW viaSearchStrategytrait injectionEcosystem connections
ruvector-coreSearchStrategyvia feature flagruvector-agent-memoryruvector-coherence-hnswrvfruFloef_bandit_status,ef_bandit_reset,ef_bandit_exportResearch doc
docs/research/nightly/2026-07-03-adaptive-ef-bandit/README.mdADR
docs/adr/ADR-272-adaptive-ef-bandit.md🤖 Generated with claude-flow
https://claude.ai/code/session_0177cAuYVyuNho7UnPML3Ao5
Generated by Claude Code