research(nightly): mincut-memory-compaction — graph-cut guided agent working memory eviction#528
Draft
ruvnet wants to merge 2 commits into
Draft
research(nightly): mincut-memory-compaction — graph-cut guided agent working memory eviction#528ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
Introduces crates/ruvector-mincut-memory — a graph-cut guided agent memory compaction primitive for RuVector. Three compaction strategies all implement a common Compactor trait: - AgeEvict: evicts oldest entries by timestamp (baseline) - CoherenceEvict: evicts entries with lowest mean graph edge weight - MinCutEvict: evicts entries with lowest weighted degree (min-cut approximation) Benchmark results (x86-64, N=500, D=32, 50% compaction, rustc 1.94.1): - All three strategies: PASS (recall_after >= 0.60 x recall_before) - MinCutEvict retains 2.67x more graph edges than AgeEvict at N=1000 18 unit tests, 0 failures. Build green with cargo build --release. Zero external service dependencies. No Python. No tokio.
Research document at docs/research/nightly/2026-06-02-mincut-memory-compaction/README.md includes full SOTA survey, 10-20 year thesis, two real benchmark runs, memory math, failure modes, security considerations, ecosystem fit, and 8 practical + 8 exotic applications. ADR-196 documents the decision: why graph-cut compaction belongs in RuVector, what API should survive into production, what remains behind a feature flag, and what would make us reject this direction.
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.
Nightly Research: MinCut-Guided Agent Working Memory Compaction
Adds
crates/ruvector-mincut-memory— a graph-cut guided agent memory compactionprimitive that answers the question every long-running AI agent faces:
when memory is full, what should be forgotten?
Includes
crates/ruvector-mincut-memory(18 tests, 0 failures)docs/adr/ADR-196-mincut-memory-compaction.mddocs/research/nightly/2026-06-02-mincut-memory-compaction/README.mddocs/research/nightly/2026-06-02-mincut-memory-compaction/gist.mdThree strategies, one trait
Real benchmark results
Hardware: x86-64 Linux 6.18 · Intel Celeron N4020 · rustc 1.94.1
N=500, D=32, 50% compaction:
N=1000, D=64, 50% compaction:
MinCutEvict retains 2.67x more graph edges than AgeEvict at N=1,000.
Ecosystem connections
ruvector-mincut— theoretical basisruvector-graph— graph storage integration pathmcp-gate— MCPmemory_compacttool (next step)rvAgent/rvagent-mcp— agent integrationruvector-verified— witness log per compaction (next step)Run it
git checkout research/nightly/2026-06-02-mincut-memory-compaction cargo build --release -p ruvector-mincut-memory cargo test -p ruvector-mincut-memory cargo run --release -p ruvector-mincut-memoryResearch doc: docs/research/nightly/2026-06-02-mincut-memory-compaction/README.md
ADR: docs/adr/ADR-196-mincut-memory-compaction.md
Generated by Claude Code