MemoryGuard
Governed shared memory for coding agents.
Local-first MCP memory with automatic organization, scoped rules, evidence, and rollback.
䏿–‡æ–‡æ¡£
Let agents write without turning shared memory into an unreviewed pile.
MemoryGuard organizes each write, preserves the evidence behind changes, and
keeps governance decisions reversible.
No account. No remote server. No remote telemetry. Local-only usage telemetry
is optional and stores bounded, privacy-preserving aggregates locally.
Quick start ·
Upgrade ·
Knowledge Library ·
Architecture ·
Supported hosts ·
Privacy and safety
A synthetic governed projection: signals move through memory categories while raw conversation text remains outside the graph.
What's New in v0.7.11
v0.7.11 is a public documentation and discovery consistency release. Runtime
behavior summarized here originates in v0.7.9:
- Canonical memory and rule governance: related rules, habits, and memories
converge through one canonical read/write path while evidence, source links,
graph branches, supersede history, conflict review, and settlement remain
auditable and reversible.
- Readable multi-agent governance: verified program identities, readable
labels, safe family icons, shared-group scope, risk explanations, stale-conflict
closure, seven governance pages, and a separate Token usage-and-savings entry
keep daily governance understandable.
- Local usage and savings view: the Token page shows local MCP conversion
events and seven-/thirty-day estimated baseline-versus-delivered units.
Provider token measurements are used only when reported (currently Codex and
Grok); Claude, Cursor, and Trae remain explicitly unsupported. No conversation
body, account, path, or instance identifier is stored.
- Codex lifecycle and runtime alignment: terminal-thread evidence gates
reclamation of Codex-owned leaked cohorts; ordinary turns remain resumable.
Installed repair aligns MCP and lifecycle Hooks to the current interpreter
while preserving Agent/shared-group identity and fail-closed boundaries.
- Evidence and discovery:
scripts/benchmark_usage_telemetry.py documents
reproducible seven-/thirty-day local measurements with explicit coverage and
no-sample semantics. Releases are published through GitHub OIDC to
GitHub Releases,
PyPI, and the official MCP
Registry. Verify current package and registry status through those live
records. No Glama score or third-party directory listing is implied.
See the v0.7.11 release note and
release history.
Earlier release details are kept in the Changelog and
GitHub release records.
Token evidence and demo
Run the benchmark only against an authorized local workspace:
python scripts/benchmark_usage_telemetry.py --workspace . --window-days 7 --sync
Read the benchmark guide for measured,
estimated, derived, and unsupported semantics. Use the demo recording
checklist for a sanitized walkthrough. The
repository's synthetic graph artwork is not a live product capture; it is not
evidence of usage or savings.
Major V2 refactor in v0.6.0
v0.6.0 was a production data-plane refactor, not a storage-only upgrade:
- Authoritative V2 domains: Memory, Rules, Evidence, Content, Runtime, Projection, Assets, CodeGraph, Skills, and System state are separated into explicit SQLite domains with governed boundaries.
- Explicit cutover:
V1_ACTIVE → V2_BUILDING → V2_READY → V2_ACTIVE is fail-closed; V2 never silently falls back to legacy stores or dual-writes after READY/ACTIVE.
- Lossless migration: frozen-source preparation uses coherent SQLite online backups, validates source/target evidence, rechecks live-source drift, and preserves V1 data plus migration backups for rollback.
- Native routing: MCP, CLI, GUI, and Hook surfaces are classified explicitly; the release closed the 233-surface cutover with 138 implemented routes, 95 retired routes, and zero neutral/blocker routes.
- Governed intelligence: Rule lifecycle and RuleMerge, extraction/enrichment, External MCP import, provider control-plane, conversation history, Knowledge Library, and GUI governance all use the V2 evidence and decision paths.
- Operational evidence: Reference Audit, per-domain SQLite health, guarded maintenance, rollback evidence, and safe unbound diagnostics are part of readiness and operations.
Why MemoryGuard
Persistent memory solves storage. It does not solve governance.
When several coding agents write into the same context, records become
duplicated, stale, contradictory, over-broad, or unsafe to reuse. MemoryGuard
sits between coding agents and their shared memory to keep that context usable.
| Without governance | With MemoryGuard |
|---|
| Notes accumulate without a canonical state | Writes are classified, deduplicated, superseded, or surfaced as conflicts |
| A correction silently destroys the old value | Evidence and supersede chains preserve what changed and why |
| Tokens and credentials can remain active | Sensitive-looking content is quarantined from active memory |
| Every write needs manual approval | Agents write normally; people review exceptions and outcomes |
| Raw chat logs leak into future context | Conversation history remains a separate, explicitly read evidence archive |
System architecture
%%{init: {"theme":"base","themeVariables":{"background":"#071521","fontFamily":"Arial, sans-serif","fontSize":"14px","primaryTextColor":"#EEF4F8","lineColor":"#557287","edgeLabelBackground":"#071521","clusterBkg":"#0A1A29","clusterBorder":"#27445A"},"flowchart":{"htmlLabels":true,"curve":"basis","nodeSpacing":32,"rankSpacing":48,"padding":14}}}%%
flowchart TB
Hosts["CODING-AGENT HOSTS<br/>Claude Code · Codex · Cursor · TRAE "]:::host
Gateway["LOCAL INTEGRATION<br/>MCP stdio · redirect rules · lifecycle hooks "]:::gateway
subgraph Core["GOVERNANCE CORE "]
direction LR
Identity["TRUST<br/>identity · scope "]:::core
MemoryAPI["MEMORY<br/>governed I/O "]:::active
Rules["RULES<br/>scope · assignment "]:::rule
HistoryAPI["HISTORY<br/>search · timeline "]:::history
Security["SAFETY<br/>validate · quarantine "]:::danger
Identity --> MemoryAPI
Identity --> Rules
Identity --> HistoryAPI
MemoryAPI --> Security
end
subgraph Stores["LOCAL GOVERNED STORES "]
direction LR
SharedDB[("V2 DOMAIN STORES<br/>Memory · Rules · Evidence · Content ")]:::store
HistoryDB[("HISTORY STORE<br/>isolated conversations ")]:::historyStore
AuditDB[("RECOVERY STORE<br/>versions · receipts · backups ")]:::store
end
Bootstrap["BOUNDED CONTEXT BOOTSTRAP<br/>mandatory rule pack · relevant recall "]:::bootstrap
Control["HUMAN CONTROL<br/>CLI · desktop governance console "]:::surface
Hosts --> Gateway --> Identity
MemoryAPI --> SharedDB
Rules --> SharedDB
HistoryAPI --> HistoryDB
Security --> AuditDB
SharedDB --> Bootstrap
Control --> Identity
classDef host fill:#12243A,stroke:#38D5C8,color:#EEF4F8,stroke-width:1.4px;
classDef gateway fill:#0D3338,stroke:#38D5C8,color:#EEF4F8,stroke-width:2.4px;
classDef core fill:#12243A,stroke:#557287,color:#EEF4F8,stroke-width:1.4px;
classDef active fill:#0D383A,stroke:#38D5C8,color:#EEF4F8,stroke-width:2px;
classDef rule fill:#3B2C18,stroke:#F3B562,color:#EEF4F8,stroke-width:1.8px;
classDef history fill:#102F45,stroke:#73C7F5,color:#EEF4F8,stroke-width:1.8px;
classDef danger fill:#3A2028,stroke:#EA6A6A,color:#EEF4F8,stroke-width:1.8px;
classDef bootstrap fill:#EEF4F8,stroke:#38D5C8,color:#071521,stroke-width:2.4px;
classDef store fill:#0B1624,stroke:#7F96A8,color:#EEF4F8,stroke-width:1.4px;
classDef historyStore fill:#102436,stroke:#73C7F5,color:#EEF4F8,stroke-width:1.4px;
classDef surface fill:#EEF4F8,stroke:#38D5C8,color:#071521,stroke-width:2px;