research(nightly): hierarchical-cluster-rag — coherence-weighted two-level cluster tree for agent memory RAG - #806
Open
ruvnet wants to merge 4 commits into
Open
Conversation
Two-level cluster-summary RAG crate (ruvector-cluster-rag): - FlatBrute, ClusterSearch, CoherenceTree variants - Per-cluster cohesion scoring: λ·sim(q,c)+(1-λ)·cohesion - 14/14 unit tests passing; acceptance gate PASS (recall ≥ 0.70) - Real benchmark: ClusterSearch 0.779 recall / 966 QPS, CoherenceTree 0.776 recall / 1019 QPS vs FlatBrute 671 QPS @ n=10K, dim=128 - Zero external dependencies; WASM-ready; 2% memory overhead - ADR-298, docs/research/nightly/2026-08-07-hierarchical-cluster-rag/ Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_013qPY6q5dfL8Z6iTuKyRKhP
ruvnet
marked this pull request as ready for review
August 8, 2026 22:38
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-cluster-rag: a zero-dependency Rust crate implementing a two-level cluster-summary index for agent memory RAG, inspired by RAPTOR (ICLR 2024) and classical IVF.FlatBrute(ground truth),ClusterSearch(IVF-style),CoherenceTree(coherence-weighted cluster scoring).λ·sim(q,c) + (1-λ)·cohesion(c)routes queries toward tight, semantically concentrated clusters rather than all-or-nothing brute force.Real benchmark results (x86_64 Linux, release build)
Config: n=10,000, dim=128, nq=500, k=10, k_clusters=40, nprobe=20, lambda=0.70
Acceptance gate: PASS — both cluster variants ≥ 0.70 recall@10. Memory overhead: 2.0% above raw leaf storage.
Honest finding: on uniform random data, CoherenceTree ≈ ClusterSearch in recall (expected — all clusters have similar cohesion on random data). The coherence advantage emerges on structured corpora where cluster tightness varies. Measuring this on real embeddings is the primary next step.
Files changed
crates/ruvector-cluster-rag/— new crate (6 source files, 1 binary, Cargo.toml)docs/adr/ADR-298-hierarchical-cluster-rag.md— architecture decision recorddocs/research/nightly/2026-08-07-hierarchical-cluster-rag/README.md— full research documentdocs/research/nightly/2026-08-07-hierarchical-cluster-rag/gist.md— SEO-optimised public technical articleCargo.toml— workspace member registrationTest status
Ecosystem connections
ruvector-agent-memory: drop-in accelerated backend for growing memory corporaruvector-coherence: cluster cohesion reuses the cosine-sim primitiveruvector-temporal-coherence: cohesion decay → ruFlo re-cluster triggerruvector-mincut: mincut boundary detection could sharpen cluster seedsGenerated by Claude Code