MemoryPalace

A local-first AI memory system that stores conversation history verbatim with semantic retrieval — no API calls, no summarization.

🏛️

Introduction

MemoryPalace (mempalace) is a local-first AI memory system that stores your conversation history as verbatim text and retrieves it with semantic search. Unlike tools that summarize, extract, or paraphrase your data, MemoryPalace preserves every original word in a structured index organized as wings (people and projects), rooms (topics), and drawers (original content), allowing searches to be scoped rather than run against a flat corpus.

The retrieval layer is pluggable: the default backend is ChromaDB, but alternatives like SQLite exact-vector, Qdrant, and PostgreSQL pgvector can be swapped in without touching the rest of the system. Nothing leaves your machine unless you explicitly opt in. MemoryPalace is hosted on GitHub at github.com/milla-jovovich/mempalace with documentation at mempalaceofficial.com.

💻

Installation

MemoryPalace ships as a CLI tool and should be installed in an isolated environment to avoid dependency conflicts.

Using uv (Recommended)

uv tool install mempalace
mempalace init ~/projects/myapp

Using pipx

pipx install mempalace

Using pip (in a virtualenv)

python -m venv .venv && source .venv/bin/activate
pip install mempalace

Docker

docker build -t mempalace .
docker run -i --rm -v mempalace-data:/data mempalace  # MCP server
docker run --rm -v mempalace-data:/data mempalace search "query"
💾

Storage Backends

MemoryPalace supports multiple storage backends through a pluggable interface. The default ChromaDB backend works well for most users. For exact-vector correctness checks, the SQLite backend provides a local no-service option. External backends (Qdrant, pgvector) require running a separate service but offer greater scalability.

BackendTypeBest For
ChromaDBLocal vector DBDefault — best balance of speed and features
SQLite ExactLocal exact vectorCorrectness checks, no-service deployments
QdrantExternal RESTScalable deployment with REST/dict store
pgvectorPostgres extensionExisting Postgres infrastructure, SQL/JSONB
🚀

Usage & CLI

MemoryPalace's CLI provides commands for mining content into the palace, searching across stored conversations, and loading context for new sessions. The mine command ingests project files or Claude Code session history, while search retrieves relevant verbatim content from the structured index.

# Mine content into the palace
mempalace mine ~/projects/myapp                    # project files
mempalace mine ~/.claude/projects/ --mode convos   # Claude Code sessions

# Search
mempalace search "why did we switch to GraphQL"

# Load context for a new session
mempalace wake-up

Palace Structure

  • Wings — High-level categories (people, projects)
  • Rooms — Specific topics within a wing
  • Drawers — Original verbatim content (conversations, files)
  • Scoped search — Search within specific wings or rooms for focused retrieval
📊

Benchmarks

MemoryPalace achieves state-of-the-art retrieval accuracy on the LongMemEval benchmark without requiring any API calls or LLM involvement at the raw retrieval stage:

ModeR@5LLM Required
Raw semantic search96.6%None
Hybrid v4 (held-out)98.4%None
Hybrid + LLM rerank≥99%Any capable model

The raw 96.6% requires no API key, no cloud, and no LLM at any stage. The hybrid pipeline adds keyword and temporal-proximity boosting for 98.4%. On the LoCoMo benchmark (1,986 questions), the hybrid pipeline achieves 88.9% R@10. Full results are reproducible from the repository.

🔗

MCP Integration

MemoryPalace can be wired into any MCP-compatible client as a stdio server. This enables AI coding agents like Claude Code, Gemini CLI, and Antigravity to query your palace directly for relevant context. The MCP server exposes tools for mining, searching, and managing the palace through the standard MCP protocol.

{
  "mcpServers": {
    "mempalace": {
      "command": "mempalace",
      "args": []
    }
  }
}

Docker-based MCP setup is also supported with docker run -i --rm -v mempalace-data:/data mempalace. The wake-up command is specifically designed for integration with agent workflows, loading the most relevant palace content into context for a new session.