research(nightly): agent memory compaction via coherence-gated graph clustering#548
Draft
ruvnet wants to merge 2 commits into
Draft
research(nightly): agent memory compaction via coherence-gated graph clustering#548ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
Nightly research pass 2026-06-09. Topic: agent memory compaction via coherence-gated graph clustering (ADR-199, score 4.45/5). Selected over: graph-rag (4.30), semantic-drift (4.25), proof-retrieval (4.20).
Implements three memory compaction strategies over a MemoryStore of agent episodic memories: - NaiveCompactor: Lloyd's K-means centroid replacement (baseline) - GraphMergeCompactor: k-NN cosine graph + threshold-based connected components - CoherenceGatedCompactor: k-NN graph + per-node coherence score gate All variants implement the Compactor trait and emit WitnessRecord chains. No internal workspace dependencies; independently buildable. Measured results (N=1000, D=128, 20 topics × 50 vecs): naive-kmeans: 60% compact, recall@10=0.915, 71ms graph-merge: 98% compact, recall@10=1.000, 121ms coherence-gated: 60% compact, recall@10=0.990, 118ms Acceptance: recall@10 ≥ 0.55 — ALL PASS
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 for 2026-06-09: agent memory compaction via coherence-gated graph clustering.
Introduces
crates/ruvector-memory-compact— the first Rust crate to treat vector database compaction as a semantic problem rather than a structural storage concern. Three compaction strategies over aMemoryStoreof agent episodic memories:All variants emit
WitnessRecordchains (auditable attestation of which original IDs were merged into which centroid), enabling rollback and AI safety provenance.Measured results (x86-64, release, N=1000, D=128, 20 topics × 50 vecs)
Acceptance: recall@10 ≥ 0.55 — ALL PASS ✓
What's included
crates/ruvector-memory-compact) — 6 source files, all <500 linesdocs/adr/ADR-199-agent-memory-compaction.md)docs/research/nightly/2026-06-09-ruvector-memory-compact/README.md)docs/research/nightly/2026-06-09-ruvector-memory-compact/gist.md)Topic selection (3-pass research loop)
Scored 10 candidate topics using formula:
final = 0.30×RuVector_fit + 0.25×feasibility + 0.20×novelty + 0.15×SEO + 0.10×ecosystemSelected because: uniquely uses coherence + mincut primitives already in ruvector; no competitor ships this; auditable witness chain is original; connects ruFlo / MCP / ruvnet ecosystem.
Research doc
docs/research/nightly/2026-06-09-ruvector-memory-compact/README.mdADR
docs/adr/ADR-199-agent-memory-compaction.mdGist
docs/research/nightly/2026-06-09-ruvector-memory-compact/gist.md(pending public publish)Generated by Claude Code