Skip to content

research(nightly): mincut-memory-compaction — graph-topology-aware agent memory eviction - #527

Closed
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-06-01-mincut-memory-compaction
Closed

ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-06-01-mincut-memory-compaction

Conversation

@ruvnet

@ruvnet ruvnet commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Nightly RuVector Research — 2026-06-01

Topic: MinCut-Guided Agent Memory Compaction
ADR: docs/adr/ADR-196-mincut-memory-compaction.md
Crate: crates/ruvector-memory-compaction
Research doc: docs/research/nightly/2026-06-01-mincut-memory-compaction/README.md
Public gist: docs/research/nightly/2026-06-01-mincut-memory-compaction/gist.md


What this adds

A standalone Rust crate implementing three compaction strategies for timestamped agent vector memory, benchmarked on isotropic and clustered Gaussian datasets at 50% retention.

Variants

Variant Strategy Complexity Quality (clustered N=3000)
GreedyAgeCompactor FIFO oldest-first O(n log n) 0.7263
DecayScoreCompactor Exponential decay + greedy diversity O(n²) 0.7281
MinCutCompactor k-NN graph isolation score O(n²×D) 0.8328

Quality = cosine similarity between pre- and post-compaction centroids (1.0 = perfect).

Key result

MinCutGraph leads GreedyAge by +0.1065–0.1213 on 8-cluster Gaussian data — the algorithm exploits semantic cluster topology to preserve cluster cores while evicting peripheral/isolated entries.


Build status

cargo build --release -p ruvector-memory-compaction  ✓
cargo test -p ruvector-memory-compaction             ✓  13/13 pass
cargo run --release -p ruvector-memory-compaction    ✓  ALL CHECKS PASSED

Ecosystem connections

  • ruvector-mincut — isolation scoring approximates minimum-cut boundary detection
  • ruvector-coherence — SpectralCoherenceScore planned as Phase 2 quality gate
  • ruvector-verified — evicted_ids feeds proof-gated witness log (Phase 2)
  • mcp-gate — memory/compact MCP tool surface (Phase 3)
  • ruFlo — post-write size-threshold trigger (Phase 3)
  • Cognitum Seed — GreedyAgeCompactor for edge RAM-constrained deployments

What is NOT claimed

  • No competitor numbers included — no direct comparison was benchmarked
  • Centroid cosine similarity is a proxy metric, not held-out query recall@k
  • MinCutCompactor at n=5000 takes 3.6 s — not production-ready without HNSW-accelerated graph build (planned Phase 2)
  • Single run results; ±5% variance expected between runs

Research loop

  • Pass 1: SOTA survey (agent memory, graph summarisation, coreset selection)
  • Pass 2: Algorithmic deepening (LexRank isolation criterion, decay + diversity)
  • Pass 3: Critique — O(n²) bottleneck identified, HNSW mitigation path documented

This branch should either become a production RuVector capability or a falsified research path with useful evidence.


Generated by Claude Code

Implements ADR-196: graph-topology-aware agent memory compaction
using k-NN cosine similarity graph isolation scoring.

Adds crates/ruvector-memory-compaction with three variants:
- GreedyAgeCompactor: FIFO baseline, O(n log n)
- DecayScoreCompactor: exponential decay + greedy diversity, O(n²)
- MinCutCompactor: k-NN graph isolation score, O(n²×D)

Measured results (x86_64 release, clustered 8-cluster Gaussian):
  MinCutGraph quality 0.8331 vs GreedyAge 0.7118 (N=1000, D=64)
  MinCutGraph quality 0.8328 vs GreedyAge 0.7263 (N=3000, D=128)
  +0.1065–0.1213 centroid quality improvement on clustered data

13 unit tests pass. All benchmark acceptance checks pass.

https://claude.ai/code/session_01YZdKfKvw1ezECnQypnX447
@ruvnet ruvnet closed this Sep 26, 2026
@ruvnet

ruvnet commented Sep 26, 2026

Copy link
Copy Markdown
Owner Author

Closing in PR cleanup. Superseded: MinCut compaction scored only by a centroid-cosine proxy (0.8328 vs 0.7263). Redone next night in #528, and merged #961 later rejected mincut-gated forgetting with evidence. Superseded by #961. The branch is kept; reopen if this should continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants