MemPalace/mempalace
AI EngineeringA local-first verbatim memory store that gives AI coding agents searchable, scoped recall of past sessions and projects.
MemPalace is a local-first memory system for AI agents and coding assistants. It stores conversation and project text verbatim — no summarising or paraphrasing — and retrieves it with semantic search, so an agent can answer "why did we switch to GraphQL" from the original session rather than a lossy summary. It is free and MIT-licensed.
How the memory is organised
Content is filed into a structured index: people and projects become wings, topics become rooms, and the original text sits in drawers. This lets a search be scoped to a project or person instead of scanning a flat corpus the palace concepts. A temporal entity-relationship graph with validity windows (add, query, invalidate, timeline) is backed by local SQLite knowledge graph. The retrieval backend is pluggable; ChromaDB is the default and needs no configuration, with sqlite_exact, rust_exact, Milvus, Qdrant and pgvector as opt-in alternatives backend contract.
Ways to use it
- Agent-guided setup: install the three skills (
mempalace,mempalace-recall,mempalace-task) withnpx skills add MemPalace/mempalace, then have a coding agent detect the system, install the package and configure MCP. The skill alone does not install the CLI or MCP server. - CLI: install into an isolated environment (
uv tool installorpipx) and runmempalace init,mine,search,wake-up,audit. Plainpipis advised only inside a virtualenv, sincechromadb,numpyandgrpciocan conflict with global packages. - Docker: a multi-arch image runs the MCP server or CLI without a local Python toolchain; everything persists under
/data, and the server only sees directories you mount README. - MCP clients: 47 MCP tools cover reads/writes, graph operations, drawers, agent diaries and agent coordination MCP tools.
What changes in practice
Hooks for Claude Code, Codex CLI and Cursor save periodically and before context compression; mempalace sweep adds one verbatim drawer per message hooks. Without auto-save hooks wired, Claude Code sessions expire in 30 days discussion — so wiring hooks and backfilling existing transcripts is the step that actually retains history.
Requirements and cautions
Python 3.10+, a vector backend, and ~300 MB disk for the default multilingual embedding model (or ~30 MB for the English-only minilm). The first embedding call downloads the model and needs network. Embeddings can instead be computed via any OpenAI-compatible endpoint; switching vector spaces requires mempalace repair rebuild-index requirements. Native Termux install is unsupported (Android users use a Debian PRoot container); the GPU image is x86_64-only. Reported LongMemEval R@5 figures are retrieval recall with stated conditions, not end-to-end QA accuracy; reproducing them is documented in the repo benchmarks. Treat only the GitHub repo, PyPI and the official docs site as legitimate sources — the README warns of impostor domains.
Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.