Skip to content

Commit 6117aa4

Browse files
tcconnallyclaude
andcommitted
feat(graph): GraphRAG community detection + community-summary global recall (#365)
Adds the GraphRAG global-sensemaking layer over the existing entity link graph, closing the "local traversal only" gap: - mimir_communities: partition the per-workspace link graph into communities. Pure-Rust deterministic algorithms, no new dependencies: label propagation (default; neighborhood-overlap edge weighting so bridges never tie with intra-cluster edges) or greedy one-level modularity optimization ("louvain"). Reports Newman modularity and persists the run in a new `communities` table (schema v8, #358 BEGIN IMMEDIATE + re-check migration pattern, self-contained block). - Community summaries: extractive by default (top members by in-community degree, capped at 1200 chars) so the engine stays fully offline; mimir_community_summary optionally polishes with the configured LLM and always degrades back to extractive. Summaries are materialized as `community_summary` entities carrying evidence_for links to members. Community ids are digests of the sorted member set, so membership changes invalidate summaries by construction (state- digest cache-key pattern, #256); stale summary entities are archived on re-detection, and summary entities are excluded from the graph so they can't glue communities together. - mimir_global_recall: breadth over community summaries first, then drill-down into the best communities' members, round-robined so a query spanning multiple clusters cites entities from EACH of them. Deterministic token-overlap scoring (offline); optional use_llm synthesis. Auto-detects communities on first use. - mimir_stats now reports total_communities + graph_modularity. - Entity bodies are untrusted: everything spliced into summaries, answers, or LLM prompts goes through sanitize_prompt_field (#337). - Member hydration uses the chunked IN(...) batch pattern (#340). Schema: user_version 6 -> 8 (v8 block is self-contained for easy renumbering when parallel migrations merge). Tools: 49 -> 52 (README, server.json, manifest.json, glama.json repinned). Tests: 188 -> 204, covering planted-cluster recovery (modularity > 0.3, category-pure membership), byte-stable determinism across runs, summary caps and cache reuse, membership-change invalidation, cross-cluster global recall, workspace scoping, legacy-DB migration, and MCP dispatch incl. mneme_*/perseus_vault_* aliases. Closes #365 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 832ca10 commit 6117aa4

12 files changed

Lines changed: 1983 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to Perseus Vault (formerly Mimir/Mneme) are documented here.
55

66
## [Unreleased]
77

8+
### Added
9+
- GraphRAG over the link graph (#365): `mimir_communities` (deterministic
10+
community detection — label propagation with neighborhood-overlap weighting,
11+
or greedy one-level modularity "louvain"; pure Rust, no new dependencies),
12+
`mimir_community_summary` (extractive by default, optional LLM polish,
13+
materialized as a `community_summary` entity with `evidence_for` links,
14+
cached by member-set digest), and `mimir_global_recall` (breadth over
15+
community summaries, then depth into the best communities' members — cites
16+
entities across clusters instead of only the nearest one). Communities are
17+
persisted in a new `communities` table (schema v8); `mimir_stats` now
18+
reports `total_communities` and `graph_modularity`. 49 → 52 MCP tools.
19+
820
### Fixed
921
- MCP Registry publish: `server.json` version/OCI identifier now synced from
1022
`Cargo.toml` at publish time, and the publish waits for the GHCR image tag

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![LangGraph](https://img.shields.io/badge/integrations-LangGraph-blue)](integrations/langgraph/)
1111
[![CrewAI](https://img.shields.io/badge/integrations-CrewAI-orange)](integrations/crewai/)
1212
[![AutoGen](https://img.shields.io/badge/integrations-AutoGen-purple)](integrations/autogen/)
13-
[![MCP Tools](https://img.shields.io/badge/MCP%20tools-49-brightgreen)]()
13+
[![MCP Tools](https://img.shields.io/badge/MCP%20tools-52-brightgreen)]()
1414

1515
Perseus Vault is a single Rust binary that gives AI agents durable memory across sessions.
1616
**One binary. One file. No Docker. No Postgres. No cloud.** Just persistent memory
@@ -93,15 +93,15 @@ local-first, zero-dependency, AND agent-first.
9393
|---|---|---|---|---|
9494
| **Deployment** | Single binary (~8MB) | Cloud + self-host | Docker/Postgres | Docker/Postgres |
9595
| **Dependencies** | None (SQLite embedded) | Python + vector DB | Postgres + Python | Postgres + Go |
96-
| **MCP-Native** |49 tools | ❌ Not MCP-native | ❌ Not MCP-native | ❌ Not MCP-native |
96+
| **MCP-Native** |52 tools | ❌ Not MCP-native | ❌ Not MCP-native | ❌ Not MCP-native |
9797
| **Offline/Local** | ✅ Fully local | Cloud-dependent | Docker needed | Docker needed |
9898
| **Encryption** | AES-256-GCM ✅ ||||
9999
| **Hybrid Search** | BM25 + Dense + RRF | Vector only | Vector only | Vector + Graph |
100100
| **Entity Lifecycle** | Decay + Promote + Archive ||||
101101
| **Entity Graph** | Link + Traverse ||||
102102
| **Journal Audit Trail** | ✅ Immutable ||||
103103
| **State Management** | ✅ Key-value + TTL ||||
104-
| **MCP Tools** | 49 | 5 | 8 | 0 |
104+
| **MCP Tools** | 52 | 5 | 8 | 0 |
105105
| **GitHub Stars** | ~20 | ~55K | ~15K | ~3K |
106106
| **License** | MIT | Apache 2.0 | Apache 2.0 | Apache 2.0 |
107107

@@ -143,7 +143,7 @@ Each adapter:
143143
Any MCP-compatible framework works with Perseus Vault directly. See
144144
[Awesome Mimir](awesome-mimir.md) for the full list.
145145

146-
## 49 MCP Tools
146+
## 52 MCP Tools
147147

148148
### Entity CRUD
149149
| Tool | Description |
@@ -175,6 +175,9 @@ Any MCP-compatible framework works with Perseus Vault directly. See
175175
| `mimir_link` | Create typed relationship links between entities. |
176176
| `mimir_unlink` | Remove entity links. |
177177
| `mimir_traverse` | Walk entity link graph up to configurable depth. |
178+
| `mimir_communities` | GraphRAG community detection over the link graph (deterministic label propagation or greedy-modularity "louvain"; pure Rust, offline). |
179+
| `mimir_community_summary` | Extractive (optionally LLM-polished) summary of one community, materialized as an entity with `evidence_for` links to members. |
180+
| `mimir_global_recall` | GraphRAG global search: breadth over community summaries, then depth into the best communities' members — holistic answers across clusters. |
178181

179182
### Journal
180183
| Tool | Description |

glama.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"maintainers": [
44
"tcconnally"
55
],
6-
"tools": 49,
6+
"tools": 52,
77
"transport": {
88
"stdio": true,
99
"sse": true,

manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"name": "perseus-vault",
44
"version": "2.13.0",
55
"display_name": "Perseus Vault — Persistent Memory for Claude (formerly Mimir/Mneme)",
6-
"description": "Persistent cross-session memory for Claude. 49 MCP tools: remember, recall, search, link entities, journal audit trail, state management, AES-256-GCM encryption. Local-first, single Rust binary, zero cloud dependencies.",
7-
"long_description": "Perseus Vault (formerly \"Mimir\", then \"Mneme\") gives Claude durable memory across sessions. It is a single Rust binary (~8MB) with an embedded SQLite database — no Docker, no Postgres, no cloud. Features include:\n\n- **49 MCP tools** for entity storage, hybrid search (FTS5 + dense vector), knowledge-graph traversal, journal audit trail, and state management\n- **AES-256-GCM encryption at rest** (optional, transparent)\n- **Fully local** — never phones home, no telemetry, air-gapped by default\n- **Agent-first design** — entity lifecycle with Ebbinghaus decay, auto-promotion, archiving\n- **Works with any MCP host** — Claude Desktop, Claude Code, Cursor, Hermes Agent, Perseus, and more\n\nInstall in one line: `curl -sSf https://raw.githubusercontent.com/Perseus-Computing-LLC/perseus-vault/main/scripts/install.sh | sh`",
6+
"description": "Persistent cross-session memory for Claude. 52 MCP tools: remember, recall, search, link entities, journal audit trail, state management, AES-256-GCM encryption. Local-first, single Rust binary, zero cloud dependencies.",
7+
"long_description": "Perseus Vault (formerly \"Mimir\", then \"Mneme\") gives Claude durable memory across sessions. It is a single Rust binary (~8MB) with an embedded SQLite database — no Docker, no Postgres, no cloud. Features include:\n\n- **52 MCP tools** for entity storage, hybrid search (FTS5 + dense vector), knowledge-graph traversal, journal audit trail, and state management\n- **AES-256-GCM encryption at rest** (optional, transparent)\n- **Fully local** — never phones home, no telemetry, air-gapped by default\n- **Agent-first design** — entity lifecycle with Ebbinghaus decay, auto-promotion, archiving\n- **Works with any MCP host** — Claude Desktop, Claude Code, Cursor, Hermes Agent, Perseus, and more\n\nInstall in one line: `curl -sSf https://raw.githubusercontent.com/Perseus-Computing-LLC/perseus-vault/main/scripts/install.sh | sh`",
88
"author": {
99
"name": "Perseus Computing LLC",
1010
"email": "privacy@perseus.observer",

server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "io.github.Perseus-Computing-LLC/mimir",
44
"title": "Perseus Vault (formerly Mimir/Mneme), persistent memory engine for AI agents",
5-
"description": "Local-first MCP memory server: SQLite, FTS5 and vector search, AES-256-GCM. 49 tools, no cloud.",
5+
"description": "Local-first MCP memory server: SQLite, FTS5 and vector search, AES-256-GCM. 52 tools, no cloud.",
66
"version": "2.13.0",
77
"packages": [{
88
"registryType": "oci",

0 commit comments

Comments
 (0)