Set Up MemPalace Memory in Claude: Complete Guide
TL;DR: MemPalace is an MCP (Model Context Protocol) server that gives Claude persistent, searchable memory across sessions using a structured knowledge graph. Without it, Claude forgets everything when a session ends. With MemPalace, past decisions, tech stack details, project context, and user preferences persist and are queryable by Claude on any future session. This guide walks through installation, configuration, and effective use patterns.
What Problem Does MemPalace Solve?
By default, Claude has no memory between sessions. Every conversation starts from zero. If you told Claude your tech stack last Tuesday, you need to tell it again today. If Claude made a decision about your architecture in Session 1, it has no recollection of that in Session 2.
MemPalace solves this with a knowledge graph. Think of it as a structured, searchable second brain that Claude can write to and read from. Each session, Claude queries MemPalace at the start to load relevant context, and writes new facts, decisions, and notes to MemPalace during or after the session.
The result: Claude accumulates knowledge about your projects, preferences, and constraints across hundreds of sessions. The longer you use it, the more useful each session becomes.
Prerequisites
- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code) - Node.js 18+ or Python 3.10+
- A Claude subscription (Pro or higher for extended context)
- Git
Step 1: Install the MemPalace MCP Server
MemPalace is distributed as an MCP server. You can install it via npm or run it from source.
Option A: npm install (recommended)
npm install -g @mempalace/mcp-server
Verify:
mempalace-mcp --version
Option B: Run from source
git clone https://github.com/your-mempalace-repo/mempalace
cd mempalace
npm install
npm run build
Step 2: Configure Claude to Connect to MemPalace
Open or create your Claude MCP configuration file. In Claude Code (Cowork), this lives at:
macOS: ~/.claude/mcp_servers.json
Windows: %APPDATA%\Claude\mcp_servers.json
Add the MemPalace server entry:
{
"mcpServers": {
"mempalace": {
"command": "mempalace-mcp",
"args": ["--data-dir", "/Users/YOUR_USERNAME/.mempalace"],
"env": {}
}
}
}
Replace /Users/YOUR_USERNAME/.mempalace with your preferred data directory. This is where the knowledge graph files will be stored.
Note: Do not store this path under /tmp or any ephemeral directory. The entire value of MemPalace is persistence.
Step 3: Initialise the Knowledge Graph
Start a Claude session. In the first session after installing MemPalace, run this prompt:
Initialise MemPalace. Run mempalace_status to confirm the server is connected,
then create the following root rooms: Projects, TechStack, Decisions,
Preferences, and Credentials (no secrets stored here -- just references).
Claude will confirm the connection and scaffold the initial room structure.
Step 4: Load Your Skills and Context
For the initial context load, give Claude a summary of your key projects, stack, and preferences. Claude will use mempalace_kg_add to store these as knowledge graph nodes.
Example prompt:
Please store the following in MemPalace:
- My name is [YOUR NAME]
- My email is [YOUR EMAIL]
- My primary projects are: [list them]
- My tech stack is: React, Vite, Supabase, Netlify, Cloudflare Pages
- My preferred file save location is ~/Desktop/my-project/
- Never push to GitHub without my explicit approval
- I prefer short, caveman-style responses
Claude will call mempalace_kg_add multiple times to store each fact as a structured node in the graph.
Step 5: Query MemPalace at Session Start
The most important habit is telling Claude to load MemPalace context at the start of every session. You can automate this with a Cowork Navigator skill (see build a Claude plugin from scratch), or you can use a simple opening prompt:
Load my MemPalace context. Run mempalace_search for anything related to [today's project]
and summarise what you find before we start.
Claude will call mempalace_search and mempalace_traverse to pull relevant nodes and present a brief summary of past decisions and context.
Core MemPalace Tools
| Tool | What It Does | When Claude Uses It |
|---|---|---|
mempalace_status |
Check connection and graph stats | Session start |
mempalace_search |
Full-text search across all nodes | Context loading |
mempalace_kg_add |
Add a new fact/decision to the graph | After any important decision |
mempalace_kg_query |
Structured query by room or tag | When looking for specific context |
mempalace_traverse |
Navigate node relationships | Exploring connected context |
mempalace_diary_write |
Write a session note to the diary | End of session |
mempalace_diary_read |
Read past diary entries | Reviewing session history |
mempalace_kg_invalidate |
Mark a fact as outdated | When something changes |
mempalace_list_rooms |
See all room structure | Context audit |
mempalace_graph_stats |
Stats on total nodes, edges, rooms | Health check |
Step 6: Write Session Notes
At the end of each working session, tell Claude:
Write a session note to MemPalace summarising what we did today,
decisions made, and what's left outstanding.
Claude calls mempalace_diary_write to log the session. In future sessions, you can load this with:
What did we do in the last session? Check the MemPalace diary.
This creates a persistent project log, reviewable at any time, across any number of sessions.
Step 7: Invalidate Stale Facts
Projects change. When something you have stored in MemPalace becomes outdated (a tech stack change, a new deploy target, a changed preference), tell Claude to invalidate the old fact:
We are moving from Netlify to Cloudflare Pages for [SITE].
Update MemPalace: invalidate the old Netlify node and add the new Cloudflare Pages configuration.
Claude calls mempalace_kg_invalidate on the old node and mempalace_kg_add for the new one. The graph stays accurate rather than accumulating stale information.
Effective Usage Patterns
Pattern 1: Tech Stack Reference
Store your full tech stack per project as structured nodes. Tag them with the project name. Every session where you are working on that project, Claude loads the stack automatically and never asks what framework you use.
Pattern 2: Decision Log
Any significant architectural or product decision should be written to MemPalace immediately. Example:
Decision made: We chose Supabase over PlanetScale for the auth database
because of the Row Level Security support and the existing MCP connector.
Store in MemPalace under Decisions room.
Months later, when you or Claude wonder why a certain choice was made, the rationale is queryable.
Pattern 3: Preference Store
Store formatting preferences, tone preferences, file naming conventions, and workflow rules. Claude loads these at session start and applies them without being reminded.
Pattern 4: Expiry Tracker Integration
Tag time-sensitive nodes with expiry metadata:
Store in MemPalace: GitHub PAT for JeanBap expires 2026-09-15. Tag as expires:2026-09-15.
You can query upcoming expirations at any session start:
Check MemPalace for anything expiring in the next 30 days.
Troubleshooting
Claude says MemPalace is not connected:
- Check ~/.claude/mcp_servers.json syntax (use a JSON validator).
- Restart Claude Code after editing the config.
- Run mempalace-mcp --help in terminal to confirm the binary is on your PATH.
Search returns no results:
- The graph may be empty. Run mempalace_graph_stats to check node count.
- Try broader search terms. MemPalace search is keyword-based, not semantic.
Nodes not persisting between sessions:
- Confirm your --data-dir path exists and is writable.
- Check disk space. MemPalace stores graph data as JSON files.
Privacy and Security Notes
- MemPalace stores data locally on your machine (at your configured
--data-dir). Nothing is sent to external servers. - Never store actual secret values (API keys, passwords) as MemPalace nodes. Store references only: "GitHub PAT: stored in 1Password under JeanBap-API".
- Back up your
~/.mempalacedirectory periodically. It contains your entire project knowledge base.
Summary
MemPalace transforms Claude from a stateless conversation partner into an agent with genuine project memory. The setup takes under 15 minutes. The compounding value, as Claude accumulates months of your decisions, preferences, and project context, is significant. Set it up once, use it consistently, and you will never have to re-explain your tech stack again.