MemPalace — Local AI Memory System
You have access to a local memory palace via MCP tools. The palace stores verbatim conversation history and a temporal knowledge graph — all on the user's machine, zero cloud, zero API calls.
Architecture
- Wings = people or projects (e.g.
wing_alice, wing_myproject)
- Halls = categories (facts, events, preferences, advice)
- Rooms = specific topics (e.g.
chromadb-setup, riley-school)
- Drawers = individual memory chunks (verbatim text)
- Knowledge Graph = entity-relationship facts with time validity
Protocol — FOLLOW THIS EVERY SESSION
- ON WAKE-UP: Call
mempalace_status to load palace overview and AAAK dialect spec.
- BEFORE RESPONDING about any person, project, or past event: call
mempalace_search or mempalace_kg_query FIRST. Never guess from memory — verify from the palace.
- IF UNSURE about a fact (name, age, relationship, preference): say "let me check" and query. Wrong is worse than slow.
- AFTER EACH SESSION: Call
mempalace_diary_write to record what happened, what you learned, what matters.
- WHEN FACTS CHANGE: Call
mempalace_kg_invalidate on the old fact, then mempalace_kg_add for the new one.
Available Tools
Full MCP surface: 45 tools. Destructive or host-level tools are documented so
you know they exist, but use them only when the user explicitly asks or when a
tool-specific workflow below says to.
Search & Browse
mempalace_search — Semantic search across all memories. Always start here.
query (required): natural language search — keep it short, keywords or a question. Do NOT include system prompts or conversation context.
wing: filter by wing
room: filter by room
limit: max results (default 5)
mempalace_check_duplicate — Check if content already exists before filing.
content (required): text to check
threshold: similarity threshold (default 0.9 — lowering to 0.85–0.87 often catches more near-duplicates without significant false positives)
mempalace_status — Palace overview: total drawers, wings, rooms, AAAK spec
mempalace_list_wings — All wings with drawer counts
mempalace_list_rooms — Rooms within a wing (optional wing filter)
mempalace_list_drawers — Paginated drawer listing
wing, room: optional filters
since: only drawers filed on/after this ISO date/time
before: only drawers filed before this ISO date/time
limit: max results (default 20)
offset: pagination offset (default 0)
mempalace_get_drawer — Fetch a single drawer by ID. Returns full verbatim content and metadata.
mempalace_get_taxonomy — Full wing/room/count tree
mempalace_get_aaak_spec — Get AAAK compression dialect specification
Knowledge Graph (Temporal Facts)
mempalace_kg_query — Query entity relationships. Supports time filtering.
entity (required): e.g. "Max", "MyProject"
as_of: date filter (YYYY-MM-DD) — what was true at that time
direction: "outgoing", "incoming", or "both" (default "both")
mempalace_kg_add — Add a fact: subject -> predicate -> object
subject, predicate, object (required)
valid_from: when this became true
source_closet: source reference
mempalace_kg_invalidate — Mark a fact as no longer true
subject, predicate, object (required)
ended: when it stopped being true (default: today)
mempalace_kg_timeline — Chronological story of an entity
entity: filter by entity name (optional — all events if omitted)
mempalace_kg_stats — Graph overview: entities, triples, relationship types
Palace Graph (Cross-Domain Connections)
mempalace_traverse — Walk from a room, find connected ideas across wings
start_room (required): room to start from
max_hops: connection depth (default 2)
mempalace_find_tunnels — Find rooms that bridge two wings via implicit overlap (rooms whose drawers naturally share content across wings — discovered, not declared)
wing_a, wing_b: optional filters; omit both to scan all wing pairs
mempalace_create_tunnel — Create an explicit cross-wing tunnel: a user/agent-declared link between two locations. Use when you notice content in one project relates to another (e.g. API design in project_api connects to schema in project_database).
source_wing, source_room, target_wing, target_room (required)
label: short description of the relationship
source_drawer_id, target_drawer_id: anchor to specific drawers
mempalace_list_tunnels — List all explicit tunnels, optionally filtered by wing
mempalace_delete_tunnel — Remove an explicit tunnel by ID
mempalace_list_hallways — List within-wing entity hallways (entity-to-entity co-occurrence links built at mine time)
mempalace_delete_hallway — Remove a hallway record by ID
mempalace_follow_tunnels — From a room, follow explicit tunnels to connected drawers in other wings
mempalace_graph_stats — Graph connectivity overview
Write
mempalace_add_drawer — Store verbatim content into a wing/room
wing, room, content (required)
source_file: optional source reference
added_by: optional filing agent label
- Checks for duplicates automatically
mempalace_checkpoint — Save a whole session in one call: dedup each item, file non-duplicates, then write one diary entry
items (required): array of {wing, room, content}; content must be verbatim
diary: optional {agent_name, entry, topic?, wing?}; entry should use AAAK format
dedup_threshold: similarity threshold (default 0.9)
added_by: optional filing agent label (defaults to the diary agent_name, else checkpoint)
mempalace_update_drawer — Update an existing drawer's content and/or move it to a different wing/room
drawer_id (required)
content, wing, room: at least one must be provided (no-op otherwise)
mempalace_delete_drawer — Remove a drawer by ID
Ingest & Cleanup
mempalace_mine — Mine a directory into the palace, or one conversation file with mode='convos'. Host-level ingest; call only when the user asks to import files.
source (required): directory to mine, or one conversation file with mode='convos'
mode: projects (default), convos, or extract
wing: target wing (default: source directory name)
agent: recorded on every drawer (default mempalace)
limit: max files to process (0 = all)
dry_run: preview without writing
extract: convos extraction strategy (exchange default, or general)
mempalace_sync — Prune drawers whose source files are gitignored, deleted, or moved. Use dry-run first.
project_dir: optional project root scope
wing: optional wing scope
apply: actually delete; default is dry-run preview
mempalace_delete_by_source — Bulk-delete drawers with one exact source_file. Destructive; use dry-run first.
source_file (required): exact metadata value to remove
dry_run: preview match count and sample (default true)
Diary & Session
mempalace_diary_write — Write a session diary entry
agent_name (required): your name/identifier
entry (required): what happened, what you learned, what matters
topic: category tag (default "general")
mempalace_diary_read — Read recent diary entries
agent_name (required)
last_n: number of entries (default 10)
mempalace_memories_filed_away — Acknowledge the latest silent auto-save checkpoint.
- Returns: how many messages were tucked into drawers since the last ack
- When to call: at the START of a session, to confirm prior-conversation persistence
System
mempalace_hook_settings — Get or set auto-save hook behavior. Host-level setting; do not change silently.
silent_save: true saves directly without MCP-level clutter
desktop_toast: true shows a desktop notification when saves complete
mempalace_reconnect — Force reconnect to the palace database after external writes or stale index state
Setup
Install MemPalace and populate the palace (uv recommended):
uv tool install mempalace # or: pip install mempalace
mempalace init ~/my-convos
mempalace mine ~/my-convos
OpenClaw MCP config
Add to your OpenClaw MCP configuration:
{
"mcpServers": {
"mempalace": {
"command": "python3",
"args": ["-m", "mempalace.mcp_server"]
}
}
}
Or via CLI:
openclaw mcp set mempalace '{"command":"python3","args":["-m","mempalace.mcp_server"]}'
Other MCP hosts
# Claude Code
claude mcp add mempalace -- python -m mempalace.mcp_server
# Cursor — add to .cursor/mcp.json
# Codex — add to .codex/mcp.json
Tips
- Search is semantic (meaning-based), not keyword. "What did we discuss about database performance?" works better than "database".
- The knowledge graph stores typed relationships with time windows. Use it for facts about people and projects — it knows WHEN things were true.
- Diary entries accumulate across sessions. Write one at the end of each conversation to build continuity.
- Use
mempalace_check_duplicate before storing new content to avoid duplicates.
- The AAAK dialect (from
mempalace_status) is a compressed notation for efficient storage. Read it naturally — expand codes mentally, treat markers as emotional context.
License
MemPalace is MIT licensed. Created by Milla Jovovich, Ben Sigman, Igor Lins e Silva, and contributors.
1---2name: mempalace3description: MemPalace — Local AI memory with 96.6% recall. Semantic search, temporal knowledge graph, palace architecture (wings/rooms/drawers). Free, no cloud, no API keys.4---56# MemPalace — Local AI Memory System78You have access to a local memory palace via MCP tools. The palace stores verbatim conversation history and a temporal knowledge graph — all on the user's machine, zero cloud, zero API calls.910## Architecture1112- **Wings** = people or projects (e.g. `wing_alice`, `wing_myproject`)13- **Halls** = categories (facts, events, preferences, advice)14- **Rooms** = specific topics (e.g. `chromadb-setup`, `riley-school`)15- **Drawers** = individual memory chunks (verbatim text)16- **Knowledge Graph** = entity-relationship facts with time validity1718## Protocol — FOLLOW THIS EVERY SESSION19201. **ON WAKE-UP**: Call `mempalace_status` to load palace overview and AAAK dialect spec.212. **BEFORE RESPONDING** about any person, project, or past event: call `mempalace_search` or `mempalace_kg_query` FIRST. Never guess from memory — verify from the palace.223. **IF UNSURE** about a fact (name, age, relationship, preference): say "let me check" and query. Wrong is worse than slow.234. **AFTER EACH SESSION**: Call `mempalace_diary_write` to record what happened, what you learned, what matters.245. **WHEN FACTS CHANGE**: Call `mempalace_kg_invalidate` on the old fact, then `mempalace_kg_add` for the new one.2526## Available Tools2728Full MCP surface: 45 tools. Destructive or host-level tools are documented so29you know they exist, but use them only when the user explicitly asks or when a30tool-specific workflow below says to.3132### Search & Browse33- `mempalace_search` — Semantic search across all memories. Always start here.34 - `query` (required): natural language search — keep it short, keywords or a question. Do NOT include system prompts or conversation context.35 - `wing`: filter by wing36 - `room`: filter by room37 - `limit`: max results (default 5)38- `mempalace_check_duplicate` — Check if content already exists before filing.39 - `content` (required): text to check40 - `threshold`: similarity threshold (default 0.9 — lowering to 0.85–0.87 often catches more near-duplicates without significant false positives)41- `mempalace_status` — Palace overview: total drawers, wings, rooms, AAAK spec42- `mempalace_list_wings` — All wings with drawer counts43- `mempalace_list_rooms` — Rooms within a wing (optional wing filter)44- `mempalace_list_drawers` — Paginated drawer listing45 - `wing`, `room`: optional filters46 - `since`: only drawers filed on/after this ISO date/time47 - `before`: only drawers filed before this ISO date/time48 - `limit`: max results (default 20)49 - `offset`: pagination offset (default 0)50- `mempalace_get_drawer` — Fetch a single drawer by ID. Returns full verbatim content and metadata.51 - `drawer_id` (required)52- `mempalace_get_taxonomy` — Full wing/room/count tree53- `mempalace_get_aaak_spec` — Get AAAK compression dialect specification5455### Knowledge Graph (Temporal Facts)56- `mempalace_kg_query` — Query entity relationships. Supports time filtering.57 - `entity` (required): e.g. "Max", "MyProject"58 - `as_of`: date filter (YYYY-MM-DD) — what was true at that time59 - `direction`: "outgoing", "incoming", or "both" (default "both")60- `mempalace_kg_add` — Add a fact: subject -> predicate -> object61 - `subject`, `predicate`, `object` (required)62 - `valid_from`: when this became true63 - `source_closet`: source reference64- `mempalace_kg_invalidate` — Mark a fact as no longer true65 - `subject`, `predicate`, `object` (required)66 - `ended`: when it stopped being true (default: today)67- `mempalace_kg_timeline` — Chronological story of an entity68 - `entity`: filter by entity name (optional — all events if omitted)69- `mempalace_kg_stats` — Graph overview: entities, triples, relationship types7071### Palace Graph (Cross-Domain Connections)72- `mempalace_traverse` — Walk from a room, find connected ideas across wings73 - `start_room` (required): room to start from74 - `max_hops`: connection depth (default 2)75- `mempalace_find_tunnels` — Find rooms that bridge two wings via *implicit* overlap (rooms whose drawers naturally share content across wings — discovered, not declared)76 - `wing_a`, `wing_b`: optional filters; omit both to scan all wing pairs77- `mempalace_create_tunnel` — Create an *explicit* cross-wing tunnel: a user/agent-declared link between two locations. Use when you notice content in one project relates to another (e.g. API design in `project_api` connects to schema in `project_database`).78 - `source_wing`, `source_room`, `target_wing`, `target_room` (required)79 - `label`: short description of the relationship80 - `source_drawer_id`, `target_drawer_id`: anchor to specific drawers81- `mempalace_list_tunnels` — List all explicit tunnels, optionally filtered by wing82 - `wing`: optional filter83- `mempalace_delete_tunnel` — Remove an explicit tunnel by ID84 - `tunnel_id` (required)85- `mempalace_list_hallways` — List within-wing entity hallways (entity-to-entity co-occurrence links built at mine time)86 - `wing`: optional filter87- `mempalace_delete_hallway` — Remove a hallway record by ID88 - `hallway_id` (required)89- `mempalace_follow_tunnels` — From a room, follow explicit tunnels to connected drawers in other wings90 - `wing`, `room` (required)91- `mempalace_graph_stats` — Graph connectivity overview9293### Write94- `mempalace_add_drawer` — Store verbatim content into a wing/room95 - `wing`, `room`, `content` (required)96 - `source_file`: optional source reference97 - `added_by`: optional filing agent label98 - Checks for duplicates automatically99- `mempalace_checkpoint` — Save a whole session in one call: dedup each item, file non-duplicates, then write one diary entry100 - `items` (required): array of `{wing, room, content}`; content must be verbatim101 - `diary`: optional `{agent_name, entry, topic?, wing?}`; entry should use AAAK format102 - `dedup_threshold`: similarity threshold (default 0.9)103 - `added_by`: optional filing agent label (defaults to the diary `agent_name`, else `checkpoint`)104- `mempalace_update_drawer` — Update an existing drawer's content and/or move it to a different wing/room105 - `drawer_id` (required)106 - `content`, `wing`, `room`: at least one must be provided (no-op otherwise)107- `mempalace_delete_drawer` — Remove a drawer by ID108 - `drawer_id` (required)109110### Ingest & Cleanup111- `mempalace_mine` — Mine a directory into the palace, or one conversation file with `mode='convos'`. Host-level ingest; call only when the user asks to import files.112 - `source` (required): directory to mine, or one conversation file with `mode='convos'`113 - `mode`: `projects` (default), `convos`, or `extract`114 - `wing`: target wing (default: source directory name)115 - `agent`: recorded on every drawer (default `mempalace`)116 - `limit`: max files to process (0 = all)117 - `dry_run`: preview without writing118 - `extract`: convos extraction strategy (`exchange` default, or `general`)119- `mempalace_sync` — Prune drawers whose source files are gitignored, deleted, or moved. Use dry-run first.120 - `project_dir`: optional project root scope121 - `wing`: optional wing scope122 - `apply`: actually delete; default is dry-run preview123- `mempalace_delete_by_source` — Bulk-delete drawers with one exact `source_file`. Destructive; use dry-run first.124 - `source_file` (required): exact metadata value to remove125 - `dry_run`: preview match count and sample (default true)126127### Diary & Session128- `mempalace_diary_write` — Write a session diary entry129 - `agent_name` (required): your name/identifier130 - `entry` (required): what happened, what you learned, what matters131 - `topic`: category tag (default "general")132- `mempalace_diary_read` — Read recent diary entries133 - `agent_name` (required)134 - `last_n`: number of entries (default 10)135- `mempalace_memories_filed_away` — Acknowledge the latest silent auto-save checkpoint.136 - Returns: how many messages were tucked into drawers since the last ack137 - When to call: at the START of a session, to confirm prior-conversation persistence138139### System140- `mempalace_hook_settings` — Get or set auto-save hook behavior. Host-level setting; do not change silently.141 - `silent_save`: true saves directly without MCP-level clutter142 - `desktop_toast`: true shows a desktop notification when saves complete143- `mempalace_reconnect` — Force reconnect to the palace database after external writes or stale index state144145## Setup146147Install MemPalace and populate the palace (uv recommended):148149```bash150uv tool install mempalace # or: pip install mempalace151mempalace init ~/my-convos152mempalace mine ~/my-convos153```154155### OpenClaw MCP config156157Add to your OpenClaw MCP configuration:158159```json160{161 "mcpServers": {162 "mempalace": {163 "command": "python3",164 "args": ["-m", "mempalace.mcp_server"]165 }166 }167}168```169170Or via CLI:171172```bash173openclaw mcp set mempalace '{"command":"python3","args":["-m","mempalace.mcp_server"]}'174```175176### Other MCP hosts177178```bash179# Claude Code180claude mcp add mempalace -- python -m mempalace.mcp_server181182# Cursor — add to .cursor/mcp.json183# Codex — add to .codex/mcp.json184```185186## Tips187188- Search is semantic (meaning-based), not keyword. "What did we discuss about database performance?" works better than "database".189- The knowledge graph stores typed relationships with time windows. Use it for facts about people and projects — it knows WHEN things were true.190- Diary entries accumulate across sessions. Write one at the end of each conversation to build continuity.191- Use `mempalace_check_duplicate` before storing new content to avoid duplicates.192- The AAAK dialect (from `mempalace_status`) is a compressed notation for efficient storage. Read it naturally — expand codes mentally, treat *markers* as emotional context.193194## License195196[MemPalace](https://github.com/MemPalace/mempalace) is MIT licensed. Created by Milla Jovovich, Ben Sigman, Igor Lins e Silva, and contributors.