Production-grade memory reliability system for AI coding agents. Lifecycle-managed claims with citations, conflict detection, steward governance, and MCP integration.
Project description
MemoryMaster
Production-grade memory reliability system for AI coding agents.
Lifecycle-managed claims with citations, conflict detection, steward governance, hybrid retrieval, and MCP integration. Give your AI agents persistent, trustworthy memory.
MemoryMaster prevents the #1 problem with agent memory: drift, stale assumptions, and unsafe disclosure. It gives Claude Code, Codex, and any MCP-compatible agent persistent, verifiable memory with a full claim lifecycle, citation tracking, conflict detection, and human-in-the-loop governance.
How it's different
Agent-memory systems (mem0, Letta/MemGPT, Zep, cognee) have largely converged on strong retrieval — hybrid search, temporal and graph reasoning, ontologies. MemoryMaster competes on a different axis: governance. The wedge is curation over accumulation — every memory is a lifecycle-managed claim (status, citations, decay, conflict arbitration), not an opaque embedding that lingers until overwritten. Tellingly, the market moved the other way: mem0's 2026 model is explicitly add-only with no conflict resolution — the opposite of a steward.
| mem0 / Letta / Zep | MemoryMaster | |
|---|---|---|
| Unit of memory | text chunk / summary | claim with status, tier, citations, bitemporal validity |
| Stale / wrong facts | linger until overwritten | decay → stale, conflict detection, supersession |
| Contradictions | silently coexist | surfaced as conflicted, auto-resolved (5-tier) or queued for review |
| Provenance | usually none | citation per claim + per-agent provenance |
| Secret leakage | your problem | sensitivity filter at ingest (JWT/AWS/Bearer/SSH redaction) |
| Operator control | API only | steward governance + a dashboard you can see |
If you want an agent that recalls more, any vector store works. If you want an agent that recalls correctly — and can prove where a fact came from and retire it when it goes stale — that's the gap MemoryMaster fills.
Architecture
MemoryMaster is layered around MCP/CLI entry points, the MemoryService facade, SQLite/Postgres
storage, optional Qdrant vector search, scheduled jobs, and the Obsidian wiki/vault layer. The
canonical ingest path is:
MCP/CLI -> sensitivity filter -> MemoryService.ingest -> store write -> FTS5 index
The query path is:
query_memory -> MemoryService.query -> storage reads + optional Qdrant candidates -> ranked context
See docs/architecture.md for the current module map, data-flow details, recent PR status, and sensitivity-filter invariants.
Key features
- 6-state lifecycle:
candidate→confirmed→stale→superseded→conflicted→archived - Citation tracking with provenance for every claim
- Hybrid retrieval: vector (sentence-transformers / Gemini) + FTS5 + freshness + confidence
- Context optimizer:
query_for_context(budget=4000)returns auto-curated memory that fits your token budget - Entity graph with typed relationships and alias resolution
- Rule-shaped claims (new in v3.21.0): prescriptive
when <trigger>, do <action> because <rationale>claims (ingest_rule/query_rules) — the shape an agent needs to actually change behaviour next time, not just recall a fact - Correction mining (new in v3.21.0):
mine-rulesscans the verbatim transcript archive for user corrections and distills them into rule claims; the Stop hook also mines each session's latest correction automatically - Versioned schema migrations (new in v3.20.0):
migrateapplies SQLite/Postgres migrations with sha256 drift detection; incrementalexport-deltaships small claim deltas for cheap cross-machine sync - Retrieval quality (new in v3.22.0): floor-ratio boost gate (
MEMORYMASTER_BOOST_FLOOR_RATIO) stops fresh-but-wrong claims outranking the true match;query --explainshows per-stage score attribution; an opt-in correctness-safe query cache (MEMORYMASTER_QUERY_CACHE) with a generation gate - Semantic contradiction probe (new in v3.22.0, wired as a steward phase in v3.23.0):
detect-contradictionsfinds claims that genuinely contradict each other (beyond the deterministic same-subject conflict check) via an LLM judge with a Wilson-CI rate and verdict cache; in v3.23 the same probe runs insiderun-stewardand emits paste-readyconflictedproposals - Verbatim archive cleanup (new in v3.23.0):
verbatim-cleanupdedups the raw-transcript table and optionally purges pre-#128 junk rows, with a dry-run default and FTS5 mirror sync - Steward governance: multi-probe validators (filesystem, format, citation, semantic, tool) with proposal review
- Conflict resolution: 5-tier auto (confidence > freshness > citations > LLM > manual)
- Auto-redaction at ingest: JWT, GitHub tokens, Bearer, AWS keys, SSH keys, custom patterns
- LLM Wiki: compiled-truth + append-only timeline articles with progressive-disclosure frontmatter,
explored: true|falseoperator-review marker, and inline> [!contradiction]Obsidian callouts - Atlas Inbox V1 (new in v3.13.0): WhatsApp ingestion → source/evidence/action proposal lifecycle → Super-Productivity export. Versioned API/CLI contract for downstream consumers (LifeAgent, etc.) — see
docs/atlas-api-contract-v1.md. Real provider adapters (OpenAIWhisperTranscriptionProvider,TesseractOcrProvider) behindProtocols; mock providers stay default. - Optional local-path resolution (new in v4.1.0):
resolve-project/local-search(CLI + MCP) turn a fuzzy project/file name into its real on-disk path and cache it as a recallablereferenceclaim. Most useful for agents without strong native file search (e.g. Codex on Windows) and for cross-session "where was project X?" — for clients that already have a good file-glob this is marginal. Backed by Everything's read-onlyES.exeCLI via a backend-agnosticLocalSearchProviderProtocol (memorymaster/bridges/local_search/;plocate/fd/mdfindcan drop in later). Requires Everything + the ES CLI withMEMORYMASTER_EVERYTHING_ES_PATHset; degrades to a no-op when absent. Paths are redacted to root-relative tokens so usernames/structure are never stored. - LLM typed-entity Atlas extractor (new in v4.1.0): turns ingested evidence (WhatsApp / email / notes) into typed, cited life-knowledge claims (
person/project/commitment/decision/event/…) via an LLM with strict subject/type validation — replacing the deterministic keyword matcher. Thesubjectis always the real named entity, never the source app. - Bitemporal write-time guard (new in v4.2.0): rejects malformed ISO-8601 and inverted
valid_until < valid_fromat ingest, so a durable-but-invisible claim can never be written. archive_by_source+checkpoint(new in v4.2.0): lifecycle-safe bulk source cleanup (archive, never hard-delete; dry-run default) and one-round-trip batch ingest through the same sensitivity filter.- Intent-aware ranking (new in v4.2.0, opt-in):
retrieval_profile="auto"routes query intent to a weight profile; RRF fusion (MEMORYMASTER_RECALL_FUSION) is available butlinearstays default after A/B measurement. - Usage telemetry (new in v4.2.0): per-agent recall counters + a
get_usage_rollupMCP tool. - Guarded fuzzy entity resolver (new in v4.2.0, opt-in
MEMORYMASTER_ENTITY_FUZZY_RESOLVE): refuses ambiguous alias matches (anti-hallucination) instead of fragmenting entities. - Hebbian/Ebbinghaus entity edges (new in v4.2.0, opt-in
MEMORYMASTER_HEBBIAN_DECAY): usage strengthens, time decays entity-graph edge weights. - Proactive + tool-triggered recall (new in v4.2.0): a
volunteer_contextMCP tool (confidence-gated, zero-LLM) and an opt-in PreToolUse hook (MEMORYMASTER_PRETOOLUSE_RECALL) that injects memory asadditionalContexton Grep/Glob. - Belief
holder(new in v4.2.0): nullable per-claimholderfor multi-holder beliefs (take/fact/bet/hunch reuseclaim_type); SQLite+Postgres, ranking-neutral by default. - Dual backend: SQLite (zero-config) and Postgres (full feature parity with pgvector)
- Dream Bridge for bidirectional sync with Claude Code's Auto Dream
- Hook stack: recall, classify, validate-wiki, session-start, auto-ingest, precompact (settings.json) + steward-cycle (cron/schtasks) + opt-in
--pretoolusegrep/glob recall-inject
Full feature index lives in docs/handbook.md.
Benchmarks
LongMemEval-S (N=500, retrieval-only) — v3.15.0 now leads the publicly-reported numbers from agentmemory on R@5 and MRR, after wiring sentence-transformers/all-MiniLM-L6-v2 into the bench harness (the v3.14 baseline was unintentionally BM25-only).
| Metric | v3.14.0 | v3.15.0 | agentmemory | Δ vs agentmemory |
|---|---|---|---|---|
| Recall@5 | 0.894 | 0.966 | 0.952 | +0.014 ★ |
| Recall@10 | 0.942 | 0.984 | 0.986 | -0.002 |
| MRR | 0.799 | 0.902 | 0.882 | +0.020 ★ |
Reproduce: python tests/bench_longmemeval.py --retrieval-only. Full methodology, experiment-by-experiment deltas (1 KEEP, 2 REVERT, 3 NULL), and the architectural findings that surfaced along the way live in docs/archive/longmemeval-results.md and docs/archive/v315-experiments/. QA-accuracy pass (with judge) is deferred until provider quotas allow.
Prerequisites
Required (the package won't function without these)
- Python 3.10+ with
pip - Claude Code, Codex, or any MCP-compatible agent
- An LLM provider — pick one: Claude Code OAuth (free if you're a subscriber, set
MEMORYMASTER_LLM_PROVIDER=claude_cli), a free Gemini API key from aistudio.google.com, OpenAI, Anthropic API, or local Ollama. The steward, auto-ingest, and wiki-absorb cycles all need an LLM — without one, claims pile up ascandidateand never get validated, deduped, or compiled into the wiki.
Strongly recommended (you'll lose ~80% of the value without these)
- Node.js 18+ for graphify and GitNexus — these are the cached intelligence layers that make MemoryMaster cheap to query. Without them, every "what does this codebase do?" question burns tokens cold-exploring files the graph already mapped. The
intelligence-firstworkflow inCLAUDE.mdassumes both are installed. - Obsidian 1.6+ with the Bases core plugin — the wiki engine writes plain Markdown so any editor works, but Obsidian's backlinks, graph view, and Bases dashboards are how you actually navigate
wiki-absorboutput. Without Obsidian, the wiki is just a folder of files.
Optional (nice to have)
- Docker for Qdrant — vector retrieval. SQLite FTS5 is the default and works out of the box; add Qdrant when you want semantic recall on top of keyword search.
30-second quickstart
1. Install
pip install "memorymaster[mcp,security,qdrant,embeddings]"
2. Let your agent do the rest
Paste the contents of docs/AGENT-INSTALL.md into Claude Code or Codex. The agent will:
- run
memorymaster-setup --yes --full-stack --json(detects your environment, wires hooks + MCP, starts Qdrant + Ollama if Docker is present, or falls back to SQLite-only mode gracefully) - report what was wired, what was reused (brownfield), and what degraded
- run
memorymaster-setup --verify-onlyand show the round-trip result
3. Restart your session
Hooks and MCP load on session start. Restart Claude Code / Codex once.
4. Verify
After restart, run in your agent:
query_memory("test")
You should get a recall response from the MCP server. Done.
For manual setup, advanced flags (--provider, --db, --no-cron, --no-full-stack, --verify-only, --json, and more), Docker, Helm, and Postgres, see INSTALLATION.md.
Pick your LLM provider
| Provider | Env vars | Default model | Cost |
|---|---|---|---|
| Claude Code OAuth (recommended for subscribers) | MEMORYMASTER_LLM_PROVIDER=claude_cli (requires claude CLI on PATH) |
claude-haiku-4-5-20251001 |
included in Claude Code plan |
| Google Gemini (default) | MEMORYMASTER_LLM_PROVIDER=google + GEMINI_API_KEY=... |
gemini-3.1-flash-lite-preview |
~free |
| OpenAI | MEMORYMASTER_LLM_PROVIDER=openai + OPENAI_API_KEY=... |
gpt-4o-mini |
~$0.001/call |
| Anthropic API | MEMORYMASTER_LLM_PROVIDER=anthropic + ANTHROPIC_API_KEY=... |
claude-haiku-4-5-20251001 |
~$0.001/call |
| Ollama (local) | MEMORYMASTER_LLM_PROVIDER=ollama + OLLAMA_URL=http://localhost:11434 |
llama3.2:3b |
free |
The claude_cli provider shells out to your local claude --print binary, so it inherits the OAuth session you're already logged into in Claude Code — no API key, no rotator, no quota juggling. Caveat: cold-start adds 3-15s per call (subprocess spawn), so it's ideal for batched/cron paths (steward, wiki-absorb) and not for latency-sensitive recall. Override with MEMORYMASTER_CLAUDE_CLI_BIN and MEMORYMASTER_CLAUDE_CLI_TIMEOUT. On VM installs the OAuth token expires ~24h, so pair with MEMORYMASTER_LLM_FALLBACK_PROVIDER=ollama; desktop tokens don't expire.
For zero-cost offline use, install Ollama, ollama pull llama3.2:3b, and set MEMORYMASTER_LLM_PROVIDER=ollama.
MCP server
{
"mcpServers": {
"memorymaster": {
"command": "memorymaster-mcp",
"env": {
"MEMORYMASTER_DEFAULT_DB": "/path/to/memorymaster.db",
"MEMORYMASTER_WORKSPACE": "/path/to/your/project"
}
}
}
}
30 MCP tools spanning setup/lifecycle, ingest, query/retrieval, listing, knowledge graph, and governance: init_db, ingest_claim, ingest_rule, query_rules, rules_export, run_cycle, run_steward, classify_query, query_memory, query_for_context, query_for_task, query_claim_paths, query_meta_decisions, federated_query, recall_analysis, read_active_tasks, list_claims, redact_claim_payload, pin_claim, compact_memory, list_events, search_verbatim, open_dashboard, list_steward_proposals, resolve_steward_proposal, extract_entities, entity_stats, find_related_claims, quality_scores, recompute_tiers.
See docs/MCP-TOOLS.md for the grouped reference (one line per tool), and .mcp.json.example for the full config template.
Backends
| Backend | Install | Use case |
|---|---|---|
| SQLite | Built-in | Local development, single-agent, zero-config |
| Postgres | pip install "memorymaster[postgres]" |
Team deployment, multi-agent, pgvector search |
Docker Compose
Run the full stack (MemoryMaster + Qdrant + Ollama) with one command:
docker compose up -d
See INSTALLATION.md for Kubernetes / Helm.
Development
# Install with dev dependencies
pip install -e ".[dev,mcp,security,embeddings,qdrant]"
# Run tests
pytest tests/ -q
# Lint and format
ruff check memorymaster/ && ruff format memorymaster/
# Performance benchmarks
python benchmarks/perf_smoke.py
See CONTRIBUTING.md for the full workflow.
Documentation
| Document | Description |
|---|---|
| docs/README.md | Documentation index — where to find each living doc |
| docs/handbook.md | Full operator handbook — hooks, dashboard, steward, dream bridge, troubleshooting, one-prompt install |
| docs/MCP-TOOLS.md | Reference for all 30 MCP tools, grouped by purpose |
| docs/INTEGRATING.md | Integration guide for embedding MemoryMaster in your agent |
| INSTALLATION.md | Setup guide: pip, Docker, Helm, MCP config |
| CONTRIBUTING.md | Dev setup, testing, PR workflow |
| ARCHITECTURE.md | System design and subsystem details |
| USER_GUIDE.md | Usage, MCP integration, troubleshooting |
| CHANGELOG.md | Version history and release notes |
| ROADMAP.md | Release plan and future tracks |
| docs/enabling-v2-systems.md | v3 statistical classifier + cadence policy opt-in |
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memorymaster-4.3.0.tar.gz.
File metadata
- Download URL: memorymaster-4.3.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ef89925ead1bcfd9c29d27a6234d3225ac4c1a5b2591afb7fce74f269fd72a1
|
|
| MD5 |
a0cc47ef890f2ff80634ec35f66d7f21
|
|
| BLAKE2b-256 |
3a0b4740b7f9d2726d8072ad525fc3573a3c6fa0ef8a6a9c4bcefb496eb2f5b5
|
Provenance
The following attestation bundles were made for memorymaster-4.3.0.tar.gz:
Publisher:
publish.yml on wolverin0/memorymaster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memorymaster-4.3.0.tar.gz -
Subject digest:
3ef89925ead1bcfd9c29d27a6234d3225ac4c1a5b2591afb7fce74f269fd72a1 - Sigstore transparency entry: 2071032782
- Sigstore integration time:
-
Permalink:
wolverin0/memorymaster@3d8e1e990ab469976f44fd382175fccc5cf6d390 -
Branch / Tag:
refs/tags/v4.3.0 - Owner: https://github.com/wolverin0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d8e1e990ab469976f44fd382175fccc5cf6d390 -
Trigger Event:
push
-
Statement type:
File details
Details for the file memorymaster-4.3.0-py3-none-any.whl.
File metadata
- Download URL: memorymaster-4.3.0-py3-none-any.whl
- Upload date:
- Size: 724.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac011ac367c2b3231c8036780d9b1f61492581bc3c38fcfd6efd8db4bb854c20
|
|
| MD5 |
7138298b38015b31d9462643c9bf8dd8
|
|
| BLAKE2b-256 |
1860cc12b2c4f05d352dafa3ff02681a11b4363977db4e60bd8d84668c688fe7
|
Provenance
The following attestation bundles were made for memorymaster-4.3.0-py3-none-any.whl:
Publisher:
publish.yml on wolverin0/memorymaster
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memorymaster-4.3.0-py3-none-any.whl -
Subject digest:
ac011ac367c2b3231c8036780d9b1f61492581bc3c38fcfd6efd8db4bb854c20 - Sigstore transparency entry: 2071032786
- Sigstore integration time:
-
Permalink:
wolverin0/memorymaster@3d8e1e990ab469976f44fd382175fccc5cf6d390 -
Branch / Tag:
refs/tags/v4.3.0 - Owner: https://github.com/wolverin0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d8e1e990ab469976f44fd382175fccc5cf6d390 -
Trigger Event:
push
-
Statement type: