One Open Source Project a Day (No.44): MemPalace - The AI Memory System Built by the Star of Resident Evil
Introduction "She survived T-virus mutants on screen. Now she's fixing AI amnesia in real life." This is article No.44 in the "One Open Source Project a Day" series. Today's project is MemPalace (GitHub). Let's start with the backstory, because it's genuinely surprising: one of this project's co-founders is Milla Jovovich — Alice from the Resident Evil franchise, Leeloo from The Fifth Element, the Hollywood actress who spent six films fighting zombie hordes. She has no engineering background. But she's a heavy AI tools user, grew deeply frustrated with how existing memory solutions worked, and teamed up with crypto industry CEO Ben Sigman to build this — primarily using Claude Code over several months. That fact alone is worth pausing on: a non-engineer, using an AI coding tool, shipped an AI infrastructure project that hit 22k stars in 48 hours. Now for the product itself. LLMs are fundamentally stateless — every new session, your AI assistant starts from scratch. It doesn't remember the architectural decision from last week, doesn't know you prefer TypeScript, has no sense of your project history. For solo developers, that context-rebuilding overhead costs 200-600 euros of productive time every month. MemPalace tackles this with a 2,000-year-old cognitive technique: the Method of Loci. Ancient Greek rhetoricians "placed" things to remember in imagined architectural spaces. MemPalace translates that spatial metaphor into an AI memory architecture: people and projects become "Wings," specific topics become "Rooms," raw content lives in "Drawers." 48k+ Stars, 6.3k+ Forks — one of the most-watched AI tools of the moment. How the memory palace metaphor maps to an AI memory architecture 4-layer progressive loading: booting a full memory system on just 170 tokens Zero-LLM write path: eliminating API costs at the storage layer entirely Temporal knowledge graph: preventing stale information from polluting memory MCP integration: how 29 tools connect to Claude Code and other AI assistants The controversy: which marketing claims have been disputed and why Basic understanding of LLM context window limitations Python basics (optional) Experience with Claude Code, Cursor, or similar AI coding tools (helps contextualize the use case) MemPalace is a local-first, open-source AI memory system that gives AI assistants cross-session persistent memory via the MCP (Model Context Protocol) standard. Core design philosophy: Problem: LLMs are stateless; every session starts from zero ↓ Common solution: Cloud memory services (Mem0, Zep) Problems: requires API keys, data leaves local machine, expensive monthly fees MemPalace solution: local-first ✅ Fully offline (core features require zero API keys) ✅ Data stays local (privacy, no cloud upload) ✅ Zero-LLM write path (no AI called during storage = zero API cost) ✅ MCP protocol bridges mainstream AI assistants The origin story is distinctive: Milla Jovovich: Hollywood actress, best known as Leeloo in The Fifth Element and Alice in the Resident Evil franchise. Non-technical background, but a heavy AI tools user who grew frustrated with existing memory solutions and kicked off the project Ben Sigman: Crypto/blockchain industry CEO with a technical development background The two spent months building it primarily with Claude Code — the bulk of the codebase is AI-assisted. The project is itself a live demonstration of what AI-assisted development can produce. Launched April 5, 2026, initially under Milla's personal GitHub account before moving to the MemPalace organization. ⭐ GitHub Stars: 48,500+ (22k in first 48 hours) 🍴 Forks: 6,300+ 📝 Commits: 503+ (develop branch) 📄 License: MIT 🌐 Language breakdown: Python 88.9%, HTML 4.6%, CSS 3.1%, Vue 1.4% 📦 PyPI: pip install mempalace Key Features The Core: Memory Palace Spatial Structure MemPalace's most distinctive design is using spatial metaphor to organize AI memory: Palace └── Wing ← Top level: a person / a project / a major theme └── Room ← Second level: specific topic (e.g., auth, billing, architecture) └── Hall ← Third level: memory type classification │ facts / events / decisions / preferences / emotional ├── Drawer ← Verbatim raw storage (800-char chunks, 100-char overlap) └── Closet ← AAAK-compressed summary version Tunnel ← Cross-wing connector (fast navigation between same-named Rooms) This isn't just a metaphor — there's neuroscience behind it: the Method of Loci activates the hippocampus's place cell system, building stronger associative memory through spatial indexing. MemPalace's architecture attempts to give AI a similarly structured index. The most notable engineering design in MemPalace — load on demand, conserve tokens aggressively: L0: Identity file (~50-100 tokens) "Who I am, which project I'm working on" ↓ (need more context) L1: Top 15 memories ranked by importance (~500-800 tokens) Recent decisions, key preferences, important facts ↓ (diving into a specific topic) L2: Semantic recall scoped to current Wing/Room Project-relevant memories, vector retrieval ↓ (need global search) L3: Full semantic search (no limit) Cross-Wing full-library retrieval At conversation start, only L0 loads (50-100 tokens). The AI assistant dives deeper on demand — meaning day-to-day memory overhead is minimal. MemPalace's write path never calls an LLM: # Traditional AI memory systems (with API cost): User content → Call LLM to extract key info → Store summary ↑ Costs money + slow + requires network # MemPalace write path: User content → Regex rules + keyword scoring → Auto-classify to Wing/Room/Hall → Chunk into 800-char blocks → ChromaDB ↑ Fully local, zero API calls Project mining (mempalace mine): # Scan entire project directory, auto-classify memories by rules mempalace mine ~/projects/myapp # Four-priority classification rules: # 1. Folder name (e.g., auth/ → auth room) # 2. File name (e.g., billing.md → billing room) # 3. Keyword scoring (content keyword matching) # 4. Default: general room MemPalace uses SQLite to store entity triples with validity time windows: -- Knowledge graph structure CREATE TABLE knowledge_graph ( subject TEXT, predicate TEXT, object TEXT, valid_from TEXT, -- ISO timestamp valid_to TEXT, -- NULL = currently valid wing TEXT, confidence REAL ); -- Example entries: -- ("project", "language", "TypeScript", "2026-01-01", NULL, "myapp") -- ("deployment", "platform", "Vercel", "2026-01-01", "2026-03-15", "myapp") -- ↑ expired: no longer valid after 2026-03-15 This prevents a common problem: "project deploys to Vercel" recorded three months ago continuing to pollute the AI's context after you migrated to AWS. # Add MCP server to Claude Code claude mcp add mempalace -- python -m mempalace.mcp_server The 29 MCP tools cover: Palace navigation: navigate_to_wing, navigate_to_room, tunnel traversal Memory I/O: store_memory, retrieve_memory, search_across_palace Knowledge graph: add_entity, query_relationships, update_fact Agent diary: independent diary per Agent for reasoning traces Auto-hooks: extract and archive key info on session end / pre-compaction # Install pip install mempalace # Initialize project memory mempalace init ~/projects/myapp # Scan and import project files mempalace mine ~/projects/myapp # Semantic search mempalace search "authentication approach" # Generate current context summary (paste into AI conversation) mempalace wake-up > context.txt # Integrate with Claude Code (MCP) claude mcp add mempalace -- python -m mempalace.mcp_server Development setup: git clone https://github.com/MemPalace/mempalace.git cd mempalace pip install -e ".[dev]" pytest tests/ -v ┌────────────────────────────────────────────────────────┐ │ MCP Layer (29 tools) │ │ Claude Code / ChatGPT / Cursor / any MCP client │ └───────────────────────┬────────────────────────────────┘ │ ┌───────────────────────▼────────────────────────────────┐ │ Memory Orchestration Layer (Python) │ │ 4-layer load control / spatial navigation / hooks │ └────────┬──────────────────────────────┬────────────────┘ │ │ ┌────────▼───────────────┐ ┌───────────▼────────────────┐ │ Vector Storage Layer │ │ Knowledge Graph Layer │ │ ChromaDB │ │ SQLite │ │ Drawers (raw chunks) │ │ Entity triples │ │ Semantic vector index │ │ Temporal validity windows │ └─────────────────────────┘ └────────────────────────────┘ MemPalace introduces a compression format called AAAK (Agent Accessible Abbreviated Knowledge) for Closet storage: Original text: "The authentication module uses JWT tokens with a 24-hour expiration. Refresh tokens are stored in Redis with a 30-day TTL." After AAAK compression: "auth: JWT, 24h exp; rfsh tkn: Redis, 30d TTL" Design rationale: any LLM can natively read it (not binary compression — structured English abbreviation). The team claimed 30x compression, but independent testing found: enabling AAAK degrades retrieval quality by ~12.4% (a 55-character hard truncation cuts sentence semantics). The team has publicly acknowledged this. Dimension MemPalace Mem0 Zep Hindsight Deployment Local only Cloud only Cloud only Cloud + local Pricing Free $249/mo (enterprise) Paid Free + paid LLM write path None (zero cost) Yes Yes Yes Memory organization Spatial palace Flat summaries Knowledge graph Multi-strategy LongMemEval score 96.6% (disputed) 49.0% 63.8% 91.4% Independent technical analysis after launch uncovered several issues. The team has acknowledged most of them: 1. Benchmark gaming With Room-scoped retrieval: 89.4% (−7.2 pp) With AAAK compression: 84.2% (−12.4 pp) 2. "30x lossless compression" is inaccurate len(text)//3 instead of a real tokenizer. The team updated their documentation after being called out. 3. Unimplemented features knowledge_graph.py. A "fact-checking" module exists but isn't integrated into the main pipeline. Why it's still worth watching core design ideas are genuinely valuable: spatial metaphor organization, 4-layer progressive loading, zero-LLM write path — these design patterns have merit independent of any benchmark number. And a team that publicly acknowledges mistakes is more trustworthy long-term than one that doesn't. 🌟 GitHub: https://github.com/MemPalace/mempalace 🌐 Website: https://www.mempalace.tech 📦 PyPI: pip install mempalace Technical References 📊 Independent analysis: lhl/agentic-memory ANALYSIS-mempalace.md 🧠 Method of Loci: Wikipedia — Memory palace 🔌 MCP Protocol: Model Context Protocol documentation Alternatives Worth Knowing Mem0: https://mem0.ai — easiest-to-start cloud memory service Zep: https://www.getzep.com — enterprise-grade knowledge graph memory Hindsight: https://hindsight.so — SOTA multi-strategy retrieval The spatial metaphor has real value: The Wing/Room/Drawer hierarchy isn't just a cute analogy — it's a genuinely useful memory index structure that reduces the cognitive load of managing AI memory 4-layer progressive loading: Starting at 170 tokens and deepening on demand is an elegant design pattern worth borrowing for any agent memory system Zero-LLM write path: Eliminating storage costs entirely is the logical conclusion of "local-first" philosophy Temporal knowledge graph: Validity windows preventing stale data pollution is an underappreciated practical detail "AI helps build AI tools" experiment: A non-engineer building a functional AI infrastructure tool with Claude Code is a meaningful data point about where AI-assisted development stands today Honest team response: Publicly acknowledging benchmark issues rather than doubling down earns long-term credibility Heavy AI tool users: Solo developers and creative professionals who rebuild context every single session Privacy-first users: Individuals and teams unwilling to upload work memory to cloud services AI Agent developers: Engineers who need persistent memory infrastructure for their agents Researchers: Scholars and engineers studying AI memory architecture and persistent memory design patterns MemPalace implicitly asks: what is the right unit of organization for AI memory? Mem0 chose "summary entries." Zep chose "knowledge graph entities." MemPalace chose "spatial locations." No single answer is universally correct — but choosing the spatial metaphor carries a subtle assumption: that the way humans use AI is increasingly like long-term collaboration in a shared workspace. When an AI assistant starts having memories like "we discussed this in the auth room last month," something fundamental shifts about what human-AI collaboration actually is. Visit my personal site for more useful knowledge and interesting products
