In the last 30 days, an open-source project quietly hit 54,325 GitHub stars and then dropped the most uncomfortable benchmark result the AI memory space has ever seen: 96.6% recall on LongMemEval using raw verbatim text and ChromaDB's default embeddings — zero LLM calls, zero API keys, zero dollars per query. Every competitor in the field uses an LLM to extract "facts" and forgets the rest. MemPalace just stores your actual words and lets semantic search do the work. It is also MCP-native, ships four pluggable storage backends, and runs entirely offline on a developer laptop. Most teams wire up a vector store and call it a memory system. The five hidden uses below turn MemPalace from a "search tool" into the durable substrate your agent has been missing.
Hook data, verified 2026-06-07:
- GitHub: 54,325 stars, 1,800+ forks, Python 3.9+, MIT license
- Benchmark: 96.6% raw R@5 on LongMemEval (500/500, reproducible), 98.4% held-out hybrid on 450q
- HN discussion: 67 points, 17 comments on the launch thread (story 47672792, 2026-04-07)
Why This Matters in 2026
The "memory layer" has become the single biggest tax on production AI agents. Every team ships the same pattern: a vector store, a cron job that re-summarizes yesterday's logs, and an LLM that hallucinates "user prefers PostgreSQL" while throwing away the conversation that explained why. MemPalace attacks the assumption head-on. Its core thesis — verified by the benchmark, not by marketing — is that verbatim storage with good embeddings beats LLM-extracted facts because the LLM extraction step is where the information loss happens. The full progression, dev methodology, and held-out 450-question audit are in benchmarks/BENCHMARKS.md on the repo.
The result: a memory system your agent can run in a Docker container, mount into Claude Code over MCP, and have working in five lines of JSON — without burning $200/month on extraction calls. The five hidden uses below cover the capabilities that the README buries at the bottom and the docs only gesture at.
Hidden Use #1: Hybrid v4 Rerank — Bumping 96.6% to 98.4% with Zero New Code
What most people do: Run mempalace mine ~/projects/myapp once, call mempalace search "why GraphQL", ship it. They get the 96.6% raw number and assume that's the ceiling.
The hidden trick: MemPalace has a four-stage hybrid pipeline (Hybrid v4) that adds keyword boosting, temporal-proximity boosting, and a preference-pattern extraction step — and the held-out score on 450 unseen questions is 98.4% R@5, with no LLM in the loop. You don't install anything new; you just pass a flag.
# Hidden use: bump raw 96.6% to 98.4% held-out with one CLI flag
# Source: mempalace/cli.py + benchmarks/BENCHMARKS.md (held-out 450q)
import subprocess
# Re-mine with hybrid pipeline (no LLM required)
subprocess.run([
"mempalace", "mine", "~/projects/myapp",
"--mode", "hybrid_v4", # adds keyword + temporal + preference boosts
"--backend", "chroma", # default; or "sqlite_exact" for verification
], check=True)
# Held-out 450q number: 98.4% R@5, $0 per query
# Full 500q + LLM rerank: 100% (Haiku ~$0.001/query, Sonnet ~$0.003/query)
The result: A 1.8-point recall lift on the most-cited AI memory benchmark, with the same CLI and the same ChromaDB backend. The repo's own BENCHMARKS.md is unusually honest about the boundary — they explicitly mark the 100% "hybrid + LLM rerank" number as internal-only because the last 0.6% came from inspecting three specific wrong answers (teaching to the test). The 98.4% held-out figure is the honest generalisable number for the no-LLM path.
Data sources: Verified via direct GitHub API call to MemPalace/mempalace on 2026-06-07 (54,325 stars, pushed 2026-06-06). Benchmark numbers cross-checked against benchmarks/BENCHMARKS.md in the main branch.
Hidden Use #2: Pluggable Backend — Swap ChromaDB for Qdrant or pgvector Without Touching Code
What most people do: Treat the README's "ChromaDB" mention as a hard dependency. They pip install mempalace and accept the 300 MB embedding model footprint, the in-process server, and the lack of horizontal scaling.
The hidden trick: MemPalace ships a pluggable backend interface defined in mempalace/backends/base.py and currently provides four implementations: chroma (default), sqlite_exact (local exact-vector verification), qdrant (REST), and pgvector (Postgres/JSONB). The two external backends are explicitly there to "exercise the storage contract on different substrates so it is not accidentally shaped around one vendor."
# Hidden use: switch backends without changing application code
# Source: mempalace/cli.py + mempalace/backends/base.py
# Local exact-match verification backend (good for tests + CI)
mempalace mine ~/projects/myapp --backend sqlite_exact
# Qdrant for horizontal scale
export MEMPALACE_QDRANT_URL=http://localhost:6333
mempalace mine ~/projects/myapp --backend qdrant
# Postgres + pgvector for production
mempalace mine ~/projects/myapp --backend pgvector
# reads postgresql://localhost:5432/... from env
The result: You can run the same palace, the same search index, the same MCP server against four completely different storage substrates. The Qdrant and pgvector backends are opt-in (you wire them at runtime via env vars), but they ship in the default install — there is no separate "enterprise" package. For a team running a multi-agent fleet, this means the dev laptop uses ChromaDB, CI uses sqlite_exact (deterministic), staging uses Qdrant, and prod uses pgvector — and the application code is identical.
Data sources: mempalace/cli.py (default branch, lines defining _EXPLICIT_BACKEND_ENV and the four backend names). README "Storage backends" section. Verified by reading mempalace/backends/ directory listing via the GitHub Contents API on 2026-06-07.
Hidden Use #3: Claude Code Auto-Save Hooks — Survive Context Compression
What most people do: Trust their agent's built-in context window, accept that "memory" is whatever the model can see in the prompt, and start every fresh session by re-explaining the project from scratch.
The hidden trick: MemPalace ships two Claude Code hooks (pre-Stop and pre-compaction) that save the conversation verbatim into your palace before the context window is truncated. The README links to the canonical 30-day retention setup checklist, and issue #1388 on the repo is currently the loudest warning in the ecosystem: "Claude Code sessions expire in 30 days without auto-save hooks wired."
// Hidden use: wire the two Claude Code hooks so sessions survive compaction
// Source: mempalaceofficial.com/guide/hooks + docs on repo
{
"hooks": {
"Stop": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "mempalace sweep ~/.claude/projects/ --mode convos"
}]
}],
"PreCompact": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "mempalace sweep ~/.claude/projects/ --mode convos --wing current"
}]
}]
}
}
The result: Your session transcript is filed one verbatim drawer per user/assistant message — idempotent, resume-safe — before Claude Code's context window is compressed or the session is garbage-collected. The companion command mempalace mine ~/.claude/projects/ --mode convos is the one-shot backfill for existing JSONL transcripts, so even if you have not run the hooks before today, you can recover the last 30 days. For per-message recall on top of the file-level chunks, run mempalace sweep <transcript-dir> periodically.
Data sources: README "Auto-save hooks" section, link to mempalaceofficial.com/guide/hooks. GitHub Discussion #1388 ("Claude Code sessions expire in 30 days without auto-save hooks wired"), verified live 2026-06-07.
Hidden Use #4: MCP Server over stdio — Five Lines of JSON, Any Agent
What most people do: Set up a separate vector DB, write a custom retrieval function in their agent's prompt, hardcode the index name, and re-deploy the agent every time the corpus changes.
The hidden trick: MemPalace ships a full MCP server that exposes palace operations, cross-wing navigation, drawer management, and agent diaries as discoverable tools. The container image runs over stdio, so it slots into Claude Code, Codex CLI, Cursor, Gemini CLI, and any other MCP-compatible client with five lines of config. The agents concept is particularly clean: each specialist agent in your fleet gets its own wing and diary, discoverable at runtime via mempalace_list_agents — no bloat in your system prompt.
// Hidden use: run the MCP server from the official container
// Source: README "Docker" section
{
"mcpServers": {
"mempalace": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "mempalace-data:/data", "mempalace"]
}
}
}
// For GPU-accelerated embeddings, swap in the GPU image:
// docker build -f Dockerfile.gpu -t mempalace:gpu .
// and pass "--gpus all" to the run command.
The result: Every agent in your fleet gets the same memory substrate, indexed by the same embeddings, queryable through the same tools. The docker compose run --rm mcp variant is documented in docker-compose.yml for teams that prefer Compose over raw docker run. The official image bundles the extract and spellcheck extras; customise at build time with docker build --build-arg EXTRAS="extract,spellcheck" -t mempalace . if you want PDF/DOCX/PPTX ingestion included.
Data sources: README "Docker" and "MCP server" sections, plus the MCP tools reference at mempalaceofficial.com/reference/mcp-tools. The 100% reproducibility of the 96.6% raw score (no API key) is what makes the offline-MCP story credible — you do not need a cloud account to run the server.
Hidden Use #5: Three Ingest Modes — Code, Convos, and Binary Office Docs
What most people do: Assume "memory" means "embed my code." They run mempalace mine ~/projects/myapp, get code-level recall, and stop there.
The hidden trick: The CLI has three first-class ingest modes that share the same palace, the same search index, and the same retrieval layer — but use completely different parsers and chunking strategies. The full surface area:
# Hidden use: three ingest modes, one search index
# Source: mempalace/cli.py module docstring
mempalace mine ~/projects/my_app # code, docs, notes (default)
mempalace mine ~/.claude/projects/-Users-you-Projects-my_app \
--mode convos --wing my_app # Claude/ChatGPT/Slack exports
mempalace mine ~/Documents/quarterly-reports \
--mode extract --wing finance # PDF/DOCX/PPTX/XLSX/RTF/EPUB
# requires: pip install "mempalace[extract]"
# Search across all three with the same query
mempalace search "pricing discussion" --wing my_app --room costs
The result: A single palace that holds your source code, your agent conversation history, and your binary office documents. The --mode convos flag understands Claude Code, Claude.ai, ChatGPT, and Slack export formats; the --mode extract flag handles PDF, DOCX, PPTX, XLSX, RTF, and EPUB when the [extract] extra is installed. The --wing parameter scopes queries so "pricing discussion" can be limited to the finance wing's quarterly reports without picking up the same phrase from a code comment. The mempalace split and mempalace init commands handle the messy cases (concatenated mega-files, folder-structure-based room detection) before mining starts.
Data sources: mempalace/cli.py module docstring, verified by direct read of the source on 2026-06-07. Format coverage is documented in docs/format-coverage.md and the extract extra dependency list is in pyproject.toml.
Summary: The Five Hidden Uses
- Hybrid v4 rerank — bump raw 96.6% to held-out 98.4% with one CLI flag, no LLM in the loop
- Pluggable backend — swap ChromaDB for Qdrant or pgvector with one environment variable, same application code
-
Claude Code auto-save hooks — wire two
PreCompact/Stophooks so 30-day session retention actually works - MCP server over stdio — five lines of JSON turn the official container into a memory backend for every MCP-compatible agent
- Three ingest modes — code, conversations, and binary office documents share one palace, one search index, one retrieval layer
Internal Links
- 12-factor-agents: 5 Hidden Production Patterns Nobody Tells You About
- Cognee: 5 Hidden Patterns That Turn Forgetting AI Agents Into Persistent Memory Machines
- 5 MCP Server Production Patterns That 90% of Developers Are Completely Missing
Your Turn
What is the longest-running memory you have ever recovered from an agent session — a design decision, a pricing rationale, a regex you swore you would never need again? Drop it in the comments. If you wire the Claude Code hooks on your own machine, post the recovery command that brought back the most useful session and I will compile the best ones into a follow-up.
Top comments (0)