memory-mcp
This server is a local memory system for AI agents: it stores memories as markdown originals, maintains derived search/graph indexes, and exposes lifecycle operations (remember, recall, read, update, forget, status, reindex) with non-destructive versioning and transparent self-reporting.
Remember — create a new memory with content, type, trust level, source, entities, optional supersede links, and a review date; detects possible conflicts for the caller to judge.
Recall & Read — hybrid lexical search (Korean-aware prefix/trigram) returning paths/excerpts/score components, plus full memory reads with provenance, supersede chains, conflicts, and usage.
Update — edit memory content/metadata, mark one memory as superseding another (non-destructive), set lifecycle state (active/archived/deprecated), link related memories, or record a keep-both conflict resolution.
Forget — archive, deprecate (with a required reason), or purge (only from archived/deprecated and only with explicit confirmation); no silent deletion.
Status — view honest system health: counts by state/type/trust, pending conflicts, review-due items, compaction candidates, unparseable files, index freshness, and dictionary state.
Reindex — rebuild all derived indexes from the original markdown files for disaster recovery, or verify hashes and report drift.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@memory-mcp remember that the user prefers Rust for new CLI tools"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
memory-mcp
A local MCP server that manages an agent's long-term memory. Memory is treated not as something to "store and retrieve" but as a lifecycle in which it is born, recalled, amended, judged, and sinks.
Core idea
An agent's memories are of two kinds. Memories with ground truth (such as code indexes) can rely on hash synchronization, but assertion memories without ground truth — user utterances, decisions, and lessons — need state, version, confidence, and a verdict gate. memory-mcp combines the two with a dual structure:
source — human-readable markdown files managed with git (
<store>/memories/*.md, frontmatter metadata). Lifecycle state, supersede chains, and confidence live here.derivatives — a SQLite index (FTS, ranking, conflict ledger). It can be discarded at any time and rebuilt entirely from the source with a single
memory_reindexcall.
Designed by analyzing three sources (evidence trails in §12 of docs/design/architecture.md):
Source | What was adopted |
source–derivative separation, stat-gate → hash → partial reindexing, coverage honesty, store = directory isolation | |
token economy (return path and excerpt only), confidence attached to derived links, path containment | |
state machine + archived staging layer, non-destructive supersede version chain, trust × state × heat ranking | |
AX workspace memory lifecycle policy | verdict gate (no automatic overwrite), pair-hash idempotency, latest-wins signal, distillation-first compaction, entity dictionary |
Related MCP server: AI-MemoryHub MCP Server
How it works
remember ──► active ◄─────────── 본문 수정 시 자동 복귀
│ supersede 되면 자동
▼
archived ──forget(deprecate, reason 필수)──► deprecated
│ │
└────────── forget(purge, confirm 필수) ──────┘
(파일 삭제 — git 이력이 백스톱)Conflict gate: when
memory_rememberdetects neighboring memories, it returns the verdict material (shared entity, time gap,latest_wins_eligible) in the response. The verdict belongs to the calling agent (and the user) — no automatic overwrite without a verdict. Surfaced pairs are recorded by pair-hash so they are not presented again.Weathering: old, unused memories are not deleted but sink in the ranking —
score = text × trust × state × (1 + freshness + heat). Whenmemory_statusproposes aging episodes as compaction candidates, the agent summarizes them into aknowledgememory and supersedes the originals.reconcile: no daemon. At the entry of every tool invocation, a stat-gate (mtime + size) → sha256 → only the changed parts are reindexed. Manually edited files also converge on the next invocation. If the body of an archived memory is edited directly, it automatically returns to active (latest intent wins).
Korean search: without embeddings, a query planner combines word FTS (prefixes absorb postpositional variants) + trigram FTS (phrases) + a LIKE fallback for unterminated 2-char or smaller queries. So "보안을 끄는" ↔ "보안을 끄고" match.
Honesty: recall/status always report index freshness, unparseable files, and unresolved conflicts. A lack of report ≠ completeness.
Tools (7)
Tool | Role |
| Create a memory (with supersedes). Duplicates are idempotent, conflicts are returned as verdict material. |
| Hybrid search — path, pay-TM*, and score components only (no body injection). |
| Full text by id/path, supersede chain, conflict history. |
| edit / supersede / set_state / link / resolve_conflict. |
| archive / deprecate (reason required) / purge (confirmation required). No automatic deletion. |
| aggregates, unresolved conflicts, reviews due, compaction candidates, unparseable files, index freshness. |
| full derivative rebuild (disaster recovery) / conditional re-hash audit of everything. |
Installation
Node ≥ 22.5 (node:sqlite built-in — no external native dependencies).
pnpm install && pnpm buildRegister via Claude Code:
claude mcp add memory-mcp -- node /path/to/memory-mcp/dist/main.jsOr via .mcp.json:
{
"mcpServers": {
"memory-mcp": {
"type": "stdio",
"command": "node",
"args": ["/path/to/memory-mcp/dist/main.js"],
"env": { "MEMORY_MCP_ROOT": "/path/to/your/store" }
}
}
}The default store is ~/.memory-mcp/default (replace with the MEMORY_MCP_ROOT env var, or per-store invocation). If you manage the store in git, the git history becomes the backstop for purge.
Memory file format
---
id: 01JD2K3A9FZQ4W8XVBH5T6N7RM
type: fact | preference | decision | episode | reference | knowledge
state: active | archived | deprecated
trust: user-stated | agent-inferred | imported
entities: [ads-genisys, pacing]
source: "2026-08-24 세션, 사용자 교정"
created: 2026-08-24T14:03:00Z
updated: 2026-08-24T14:03:00Z
review_after: 2026-11-01
---
# 제목 한 줄
본문. 첫 문단이 recall 발췌로 쓰인다.Adding a <store>/dictionary.md normalizes entity notation (- 정식명: 설명 (aka: 동의어, 약어)).
Development
pnpm typecheck # tsc --noEmit
pnpm test # node --test (29 tests)
pnpm lint # biome
pnpm build # dist/Documentation
Design: docs/design/architecture.md — principles, state machine, source → decision trace table
Analysis: codebase-memory-mcp hands-on · Codebase-Memory paper · MemOS paper
License
MIT
Available Tools
7 toolsmemory_forgetForget (state transition, never silent deletion)A
archive: sink from default recall (recoverable). deprecate: judged wrong — requires a reason, preserved for opt-in reads. purge: delete the file — only from archived/deprecated and only with confirm=true; if the store is a git repo, history is the backstop.
Inputs: id (required), mode, store, reason, +1 more.
memory_readRead memoryB
Full content plus provenance: frontmatter, supersede chain in both directions, conflicts, usage.
Inputs: id, path, store.
memory_recallRecallA
Hybrid lexical search (word/trigram FTS + CJK-aware fallbacks). Returns paths, excerpts, and score components — read the file (or memory_read) for full content; nothing is auto-injected. Ranking: text * trust * state * (1 + freshness + heat); old unused memories sink, never vanish.
Inputs: limit, query, store, types, +3 more.
memory_reindexReindexA
rebuild (default): drop all derivatives and reconstruct them from the memory files — originals own the content, so this is disaster recovery (only usage heat is lost). verify: full re-hash audit that ignores the stat gate and reports drift (files whose content no longer matches the index).
Inputs: store, verify.
memory_rememberRememberA
Create a memory (markdown original + derived index). Returns possible_conflicts with judgment material (shared entities, age gap, latest_wins_eligible) — the caller judges: supersede, keep both, or correct itself. Nothing is ever overwritten automatically. Identical content is idempotent (returns the existing id).
Inputs: content (required), type, store, trust, +4 more.
memory_statusStatusB
The honesty surface: counts by state/type/trust, pending conflict judgments, review-due memories, distillation (compaction) candidates, unparseable files, index freshness, dictionary state.
Inputs: store.
memory_updateUpdate memoryA
edit: revise wording/metadata in place (state preserved — meaning-changing revisions should use supersede instead). supersede: id wins over other_id (non-destructive version chain). set_state: explicit lifecycle transition. link: relate two memories. resolve_conflict: record a keep-both judgment for a surfaced pair.
Inputs: id (required), action (required), type, state, +8 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: reindex for maintenance, remember for creation, recall for search, read for retrieval, update for modifications, forget for deletion/lifecycle changes, and status for system overview. No two tools overlap in function; even update's multiple sub-actions are clearly delineated within a single tool.
All tools follow a consistent 'memory_' prefix with a descriptive verb (remember, recall, read, update, forget, status, reindex). The naming pattern is uniform and predictable, making it easy to infer tool behavior from names alone.
Seven tools is an ideal scope for a memory management server. It covers all core CRUD operations, search, maintenance, and status reporting without redundancy or bloat. Each tool occupies a necessary role in the lifecycle.
The tool set covers the full memory lifecycle: create (remember), retrieve (recall/read), update (update with edit/supersede/state changes), delete (forget with archive/deprecate/purge), plus maintenance (reindex) and oversight (status). Conflict resolution and linking are also supported, leaving no obvious gaps.
Related MCP Connectors
Shared Markdown memory for your agents: docs, typed collections, files, skills and Dispatch.
Persistent memory for AI agents: add, search, update, and delete long-term memories.
Hosted agent memory with provenance, contradiction surfacing, and snapshot rollback.
Long-term memory for AI agents. Pass one sentence, and it remembers, recalls, or forgets.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides persistent long-term memory for AI assistants with tag-based retrieval, wiki-style linking, and source references, storing memories as markdown files with SQLite index.2MIT
- AlicenseAqualityBmaintenanceProvides a hybrid memory architecture with a thin SQLite index and Markdown cold storage, enabling AI agents to write, query, link, and rebuild long-term memories via MCP tools, model-agnostic and zero third-party dependencies.74MIT
- AlicenseAqualityBmaintenanceProvides AI agents with persistent, long-term memory via OKF-formatted markdown and SQLite indexing, enabling stateful storage, retrieval, and search across sessions.6223MIT
- AlicenseAqualityCmaintenanceEnables AI agents to maintain a persistent, queryable memory stored as user-owned Markdown files, with dual-channel retrieval (FTS5 and optional semantic search) and an audited write pipeline.11MIT