research: S-T mincut namespace routing for agent memory vector search - #808
Open
ruvnet wants to merge 4 commits into
Open
research: S-T mincut namespace routing for agent memory vector search#808ruvnet wants to merge 4 commits into
ruvnet wants to merge 4 commits into
Conversation
…uting Implements principled multi-namespace routing for agent memory vector search. Three strategies: AllSearch (baseline), CentroidFilter (cosine threshold), MinCutRoute (Edmonds-Karp flow partition). Key fix: relative q_sim normalisation makes routing invariant to absolute cosine magnitude. Benchmark results (64-dim, noise=0.30, 300 queries): - MinCutRoute: recall=0.985, dist_ops=41% of AllSearch, 2.47x faster - CentroidFilter: recall=0.945, dist_ops=38% of AllSearch All 6 tests pass (2 unit + 4 integration). Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_018TDPrG478FdN2hcbX2Axd5
Documents the S-T mincut namespace routing decision: context (N namespace fan-out problem), decision (relative-normalised flow formulation), benchmark evidence, failure modes, security considerations, migration path, and open questions. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_018TDPrG478FdN2hcbX2Axd5
…erge-mincut Full research document covering: problem statement, 2026 SOTA survey, 10-20 year thesis, ecosystem fit, architecture, benchmark methodology, real results, failure modes, security/WASM/MCP implications, practical and exotic applications, deep research notes, and production layout. Public gist summary at docs/research/nightly/2026-08-08-namespace-merge-mincut/gist.md. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_018TDPrG478FdN2hcbX2Axd5
ruvnet
marked this pull request as ready for review
August 8, 2026 22:33
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-namespace-merge— a zero-dependency Rust proof-of-concept for principled multi-namespace routing in agent memory vector searchChanges
New crate:
ruvector-namespace-mergeThree routing strategies sharing a
NamespaceRoutertrait:AllSearchCentroidFilterMinCutRouteFlow network (per query, N namespaces):
S → nsᵢcapacity =round(q_sim_norm[i] × 10000)— query affinitynsᵢ → Tcapacity =round((1 − q_sim_norm[i]) × 10000)— inclusion costnsᵢ ↔ nsⱼcapacity =round(inter_sim[i,j] × 10000)— cohesion penaltyAfter Edmonds-Karp max-flow, the source-side reachable set in the residual graph = namespaces to search.
Benchmark results (64-dim, noise=0.30, 300 queries)
MinCutRoute: 98.5% recall at 41% of AllSearch's distance computations, 2.47× faster.
Tests
6/6 pass:
all_search_recall_one— AllSearch recall vs itself = 1.0centroid_filter_high_recall— recall ≥ 0.75 at threshold=0.20mincut_route_searches_fewer_ns_than_all— recall ≥ 0.70, ns < totalflow_unit_two_cluster_query— direct flow unit testflow::tests::test_simple_max_flow— max-flow correctnessflow::tests::test_source_side— source-side BFS correctnessDocs
docs/adr/ADR-298-namespace-merge-mincut.md— decision record with context, alternatives, failure modes, security, migration pathdocs/research/nightly/2026-08-08-namespace-merge-mincut/README.md— full research documentdocs/research/nightly/2026-08-08-namespace-merge-mincut/gist.md— public summaryTest plan
cargo test -p ruvector-namespace-merge— all 6 tests passcargo run --release --bin benchmark— all acceptance criteria passcargo fmt --check -p ruvector-namespace-merge— no formatting issuesMinCutRouteintoruvector-agent-memoryquery path (Phase 2 per ADR-298)Generated by Claude Code