Skip to content

research(nightly): MinCut-Partitioned Community Graph-RAG for Agent Memory Coherence#633

Draft
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-02-community-memory-retrieval
Draft

research(nightly): MinCut-Partitioned Community Graph-RAG for Agent Memory Coherence#633
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-02-community-memory-retrieval

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Nightly research: community-scoped ANN retrieval via graph connectivity partitioning — a new retrieval primitive for AI agent memory that achieves 10.8× speedup over brute-force search while maintaining exact recall on clustered datasets.

  • Working Rust PoC with 3 variants (FlatScan, GraphHop, CommunityRAG) implementing a shared CommunitySearch trait
  • 12 unit tests pass, 6 acceptance tests pass
  • Two benchmark experiments (tight σ=0.40 and overlapping σ=1.20 clusters)
  • ADR-272 with production upgrade path via ruvector-mincut
  • SEO gist and full research document

Key Benchmark Results (x86_64 Linux, Rust 1.94.1)

Experiment A — Tight clusters (σ=0.40, N=2000, D=64, K=10):

Variant Mean(µs) QPS Recall@10 CommPrec@10 Mem(KB)
FlatScan 98.60 10,142 1.000 1.000 531
GraphHop 111.83 8,942 1.000 1.000 625
CommunityRAG 9.14 109,465 1.000 1.000 549

CommunityRAG is 10.8× faster with zero recall or precision loss.

Experiment B — Overlapping clusters (σ=1.20): CommunityRAG achieves community_precision = 1.000 vs FlatScan's 0.998 at 7.4× speedup, trading 4.7% ANN recall for perfect community coherence.

What's Included

  • Crate: crates/ruvector-community-rag/ (standalone workspace, zero external deps)
  • ADR: docs/adr/ADR-272-community-memory-retrieval.md
  • Research doc: docs/research/nightly/2026-07-02-community-memory-retrieval/README.md
  • Gist: docs/research/nightly/2026-07-02-community-memory-retrieval/gist.md

Research doc: docs/research/nightly/2026-07-02-community-memory-retrieval/README.md
ADR: docs/adr/ADR-272-community-memory-retrieval.md


Generated by Claude Code

MinCut-partitioned community graph-RAG for agent memory coherence.
Three variants (FlatScan, GraphHop, CommunityRAG) implementing the
CommunitySearch trait; community detection via threshold-based Union-Find
on cosine similarity graph.

Key results (N=2000, D=64, K=10, release build, x86_64 Linux):
- CommunityRAG: 9.14µs mean, 10.8× faster than FlatScan
- Recall@10: 1.000 (tight clusters) / 0.953 (overlapping)
- CommunityPrecision@10: 1.000 in both experiments
- 12 unit tests pass, 6 acceptance tests pass

Adds:
- crates/ruvector-community-rag/ (standalone workspace, no ext deps)
- docs/adr/ADR-272-community-memory-retrieval.md
- docs/research/nightly/2026-07-02-community-memory-retrieval/
- Cargo.toml: exclude community-rag from main workspace

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01C2qpMxmVG89jRv77aY9zSz
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