Mnemic
Local-first memory kernel for coding agents that provides a shared, auditable, graph-backed long-term memory layer with features like write preview, temporal recall, and provenance explanations.
README
Mnemic
Mnemic is a local-first memory kernel for coding agents and LLM applications.
It gives Codex, Claude Code, Cursor, Copilot-style agents, and custom MCP clients one shared, auditable, graph-backed long-term memory layer. Agents write source-keyed memories, preview changes before they become durable, recall facts as of a point in time, explain why recall selected a record, and turn the memory graph into prompt-ready context packs and session briefings.
The repo is TypeScript-first, MCP-native, and shaped for the 2026 agent-memory stack: durable memory outside the context window, inspectable provenance, local defaults, governance before writes, and reproducible evals.

Why Mnemic
Mnemic is not a vector-store wrapper or a hidden chat-summary cache. It is a repo-scoped memory plane that agents can inspect, replay, and govern.
Modern agent platforms already treat memory as infrastructure: MCP standardizes tool and data connections, agent SDKs expose session state, and long-term memory benchmarks increasingly test temporal recall, workflow knowledge, and stale facts. Mnemic focuses on the missing developer layer between those pieces.
| Hot-path problem | Mnemic answer |
|---|---|
| Every coding agent relearns the same project facts | Shared MCP, CLI, SDK, and HTTP memory surface |
| Memory writes drift or duplicate across sessions | Source-keyed idempotent writes plus preview before save |
| "Why did the agent remember this?" is hard to debug | Recall explanations with matched fields, score parts, and relation paths |
| Old facts keep beating corrected facts | validFrom / validTo plus asOf temporal recall |
| Audit and handoff need more than final state | Append-only events, first-class diffs, JSONL export/import, rollback preview |
| Launch claims need proof | demo, benchmark, doctor, openapi:check, package:check, and launch:check |
Five-Minute Demo
npm install
npm run demo
The demo starts an isolated backend on a random local port, writes a small coding-agent memory graph, previews an idempotent update, explains recall, builds a context pack, prints a session briefing, audits memory hygiene, shows the append-only timeline, replays an event-log snapshot, and writes a launch report.
The same replay path is available from the CLI as mnemic snapshot, from MCP as mnemic_snapshot, and from HTTP as GET /api/agent-memory/snapshot.
Expected landmarks:
Mnemic Memory Write Preview
sourceKeyMatched: true
changedFields: confidence, content, importance, updatedAt
Mnemic Recall Explanation
matchedFields: content, sourceKey, tags, title
relationPaths: ...
Mnemic Memory Audit
blocks: 0
warnings: 0
Mnemic Memory Snapshot
eventsReplayed: 5
relations: 2
Demo artifacts are written to target/mnemic-launch-demo/, including mnemic-launch-report.md. Demo details live in examples/coding-agent-memory.
Quickstart
Initialize local config for a clone:
npm run init
This generates .env.mnemic, .mnemic/policy.json, .mcp.json, and AGENTS.mnemic.md without overwriting existing files. Use node mnemic-cli/dist/index.js init --force to refresh generated files.
Run the readiness doctor:
npm run doctor
Validate the OpenAPI contract:
npm run openapi:check
Run the deterministic benchmark:
npm run benchmark
It writes target/mnemic-benchmark/mnemic-eval-report.md and currently checks recall@5, mean hit rank, stale false positives, relation-path coverage, and latency without requiring a model provider. See docs/benchmark-baseline.md and docs/benchmark-landscape.md.
Docker
docker compose -f docker-compose.agent-memory.yml up -d --build mnemic-memory-backend
curl -fsS http://127.0.0.1:8088/actuator/health
See docs/docker-quickstart.md for SQLite mode, stop commands, optional Neo4j profile, and Docker readiness checks.
What Ships Today
| Surface | Current capability |
|---|---|
| HTTP API | remember, preview, temporal recall, explain, context pack, briefing, stats, policy, audit, timeline, JSONL export/import, rollback |
| API contract | OpenAPI 3.1 contract plus a local/CI drift check for route and schema coverage |
| SDK | shared TypeScript contracts plus MnemicClient for every backend endpoint |
| CLI | mnemic remember, preview, link, explain, context, briefing, audit, snapshot, eval, rollback |
| MCP | mnemic_* tools for agent clients, including write preview, recall explanation, policy, audit, and JSONL handoff |
| Studio | React workbench for memories, graph neighborhoods, write diffs, recall explanations, runtime policy, audit, and timelines |
| Storage | zero-setup JSON store plus local SQLite mode with normalized memory, tag, relation, and event tables |
| Governance | secret blocking, source-key requirements for high-impact memory, confidence/staleness warnings, configurable policy file |
| Benchmark | deterministic coding-agent eval with terminal, JSON, and Markdown report output |
| Doctor | local readiness checks for source workspace, build artifacts, MCP config, policy, audit, and backend health |
| Package check | npm pack dry-run verification for SDK, CLI, server, and MCP packages |
| CI | workspace tests, production build, package readiness, MCP live smoke, model-free eval, policy checks, audit checks, and release-script checks |
Launch Gates
npm run launch:check
npm run docs:check
npm run rewrite:check
npm run completion:check
npm run fresh:check
npm run github:launch:check
npm run docker:check
npm run repository:check
npm run public:check
npm run supply:check
npm run community:check
npm run security:check
npm run benchmark:landscape:check
npm run market:check
npm run release:notes
npm run release:check
npm run package:check
npm run ci:smoke
npm run completion:check verifies the completion audit that maps the original rename, TypeScript rewrite, and 2026 agent-memory direction to current source evidence and remaining release blockers.
npm run repository:check verifies package metadata and launch docs point at the final Mnemic repository target and that non-Mnemic repository identities do not leak into the public tree.
npm run public:check summarizes public-launch state: target origin, clean worktree, remote repository reachability, GitHub About metadata, hosted CI/CodeQL proof, and npm publication blockers. Use strict mode after the repository is renamed and pushed.
npm run supply:check verifies lockfile shape, npm audit at the high threshold, package-manager pinning, npm token boundaries, trusted-publishing docs, and private package status.
npm run community:check verifies GitHub community-health files such as support policy, code of conduct, Dependabot config, and release checklist coverage.
npm run security:check verifies CodeQL workflow configuration, security docs, Dependabot coverage, and security hardening release gates.
npm run launch:check verifies the GitHub-facing path: README visual card, Studio preview image, demo, benchmark/readiness commands, temporal snapshot messaging, release checklist coverage, Docker link, and package discovery keywords.
npm run docs:check verifies README Docs Map coverage and local Markdown links/images across the public documentation surface.
Refresh the Studio preview asset after meaningful UI changes:
npm run studio:capture
Connect An Agent
Run a local backend:
cp .env.mnemic.example .env.mnemic
scripts/start-agent-memory-stack.sh
Install the Codex MCP entry:
scripts/install-codex-mcp.sh
Generic MCP client snippets are in docs/mcp-client-configs.md. Detailed API, CLI, MCP, governance, SDK, and storage usage lives in docs/usage.md.
Docs Map
- docs/usage.md: API, CLI, MCP tools, SDK examples, governance, storage.
- docs/agent-memory-architecture.md: runtime shape and memory model.
- docs/mnemic-2026-roadmap.md: product thesis and roadmap.
- docs/benchmark-landscape.md: public benchmark positioning and adapter plan.
- docs/local-readiness.md: doctor checks and local troubleshooting.
- docs/docker-quickstart.md: fresh-clone Docker setup.
- docs/github-actions.md: CI, eval, policy, and PR memory-review workflows.
- docs/github-launch.md: GitHub About text, topics, launch copy, and benchmark claim guardrails.
- docs/security-hardening.md: CodeQL, Dependabot, sensitive-data, and security-release boundaries.
- docs/supply-chain.md: lockfile, audit, package provenance, and npm trusted-publishing boundaries.
- docs/repository-migration.md: GitHub repository identity and package metadata target.
- docs/completion-audit.md: original-goal completion evidence and remaining release blockers.
- docs/release-checklist.md: release and package-readiness checks.
- docs/npm-publishing.md: guarded npm publishing strategy.
- docs/releases/v0.1.0.md: current launch-candidate release notes.
- docs/openapi.json: machine-readable HTTP API contract.
Workspace
mnemic-sdk/contains the shared TypeScript contracts and HTTP client.mnemic-cli/contains the command-line workflow entrypoint.mnemic-server/is the TypeScript backend.mcp-server/exposes Mnemic memory through MCP tools.studio/is the React workbench. The active product path is the TypeScript workspace.
Open Source
- License: MIT
- Contributions: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Support: SUPPORT.md
- Changelog: CHANGELOG.md
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。