research(nightly): page-coherent-memory — paged agent context loading via greedy coherence clustering - #780
Draft
ruvnet wants to merge 1 commit into
Draft
Conversation
Topic: Page-Coherent Agent Memory via Greedy Coherence Clustering ADR: ADR-280 Crate: ruvector-coherence-pages Adds working Rust proof-of-concept for organizing vector-based agent memory into semantically coherent pages. Three variants benchmarked: - FlatStore baseline (recall=1.0, 711 q/s) - CentroidPageStore k-means (7.0× speedup, recall=0.35, coherence=0.7693) - GreedyCoherenceStore (9.6× speedup, recall=0.23, coherence=0.7782) Key finding: greedy coherence maximizes local intra-page similarity (best for agent context loading) while k-means centroids maximize retrieval recall (best for ANN accuracy). Tradeoff is real and measured. All 6 unit tests pass. All 8 benchmark acceptance checks pass. Zero external dependencies. Compiles to WASM-safe Rust. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_01P5KFoo44c7opwbMJGC2sn5
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
Nightly RuVector research: Page-Coherent Agent Memory — organizing vector memory stores into semantically coherent pages for faster retrieval and higher-quality agent context loading.
ruvector-coherence-pages(zero external dependencies, WASM-safe)docs/adr/ADR-280-page-coherent-memory.mddocs/research/nightly/2026-08-03-page-coherent-memory/README.mdWhat this adds
Three
PageStoreimplementations benchmarked on 8,000 vectors × 128 dimensions:FlatStore(baseline)CentroidPageStore(k-means)GreedyCoherenceStoreKey finding: greedy coherence achieves highest intra-page cosine similarity (+0.025 vs flat) but lower recall than centroid paging. K-means centroids are better retrieval anchors; greedy seeds produce tighter topic clusters for context loading. Both achieve 7–10× speedup at 10% probe rate. All 8 acceptance criteria pass.
Files changed
crates/ruvector-coherence-pages/— new crate (zero deps)src/lib.rs—PageStoretrait,VecPage, utilities, 6 unit testssrc/flat.rs— exhaustive baselinesrc/centroid.rs— k-means centroid pagingsrc/greedy.rs— greedy coherence pagingsrc/bin/benchmark.rs— benchmark binary with real measured numbersdocs/adr/ADR-280-page-coherent-memory.mddocs/research/nightly/2026-08-03-page-coherent-memory/README.mddocs/research/nightly/2026-08-03-page-coherent-memory/gist.mdCargo.toml— addedruvector-coherence-pagesto workspace membersTest status
Benchmark:
cargo run --release -p ruvector-coherence-pages --bin benchmark→RESULT: ALL CHECKS PASSED ✓Ecosystem connections
Page-coherent memory bridges: vector search + agent memory + coherence scoring + DiskANN-style paging + WASM edge deployment + MCP tool surface + ruFlo recompaction workflows.
Generated by Claude Code