# MemPalace: A Local AI Memory System for Coding Agents

> A local, open-source memory layer for coding agents that stores conversations verbatim while indexing them with a compact symbolic notation for fast recall.

Published: 2026-08-25
URL: https://daniliants.com/insights/mempalace-a-local-ai-memory-system-for-coding-agents/
Tags: memory-systems, local-first, knowledge-graph, symbolic-indexing

---

## Summary

MemPalace is a local, open-source memory layer for coding agents (built around Claude Code) that stores conversation content verbatim while indexing it with a dense symbolic notation an LLM can scan quickly. It runs entirely on-device (ChromaDB + SQLite, no cloud calls, no API key), auto-files memory via session-end and pre-compaction hooks, and organizes memory as a "palace": entity-first wings (people/projects/topics), day- or session-based rooms, topic-based closets, and verbatim drawers.

## Key Insight

- **Separation of storage and index is the core trick**: the actual memory content is never rewritten or summarized (verbatim drawers); only a compact symbolic pointer gets scanned during retrieval. Example given: `§ W-042/R-11/D-007 @p noah~son.age=6~dob=09-12 @l glebe-pt-rd.park @e birthday~party(n≈8) @i therizinosaurus~claws @t 2026-04-14T09:41 § ptr → D-007`. This lets a model scan "thousands of drawers in a single pass" without loading full text, then dereference only the ones it needs - a cheap way to keep long-term memory both cheap to search and lossless to read.
- **Entity-first hierarchy**: top-level organization is by real-world entity (a named person, a project codename, a life domain), not by date or by conversation. Time-based "rooms" (one per day or session) nest inside each entity wing; "closets" then group by topic/thread inside a room. This mirrors a PARA-like structure but adds a chronological axis inside each entity.
- **Relationship tracking with validity windows**: the knowledge graph (SQLite) tracks relationships between entities with `valid_from`/`valid_to` dates, explicitly modeling facts that were true then but may not be now, rather than treating memory as a flat always-current store.
- **Fully local**: no OpenAI/Anthropic key required for extraction, chunking, or embedding. Everything runs on-device under a single directory (`~/.mempalace`). Install is `pip install -e ".[dev]"` then `mempalace init`, which registers Claude Code `stop` and `precompact` hooks so filing happens silently at session boundaries, and `mempalace mine ./notes` to backfill from existing files.
- Caveat: this is a product landing page, not a benchmark or case study. No evidence is given on retrieval accuracy, latency at scale, or how well the "AAAK" symbolic index actually compresses vs. plain keyword/embedding search. Treat the architecture idea as inspiration, not a proven result.