mempalace
Original:🇺🇸 English
Translated
MemPalace — Local AI memory with 96.6% recall. Semantic search, temporal knowledge graph, palace architecture (wings/rooms/drawers). Free, no cloud, no API keys.
8installs
Sourcemempalace/mempalace
Added on
NPX Install
npx skill4agent add mempalace/mempalace mempalaceTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →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 to load palace overview and AAAK dialect spec.
mempalace_status - BEFORE RESPONDING about any person, project, or past event: call or
mempalace_searchFIRST. Never guess from memory — verify from the palace.mempalace_kg_query - IF UNSURE about a fact (name, age, relationship, preference): say "let me check" and query. Wrong is worse than slow.
- AFTER EACH SESSION: Call to record what happened, what you learned, what matters.
mempalace_diary_write - WHEN FACTS CHANGE: Call on the old fact, then
mempalace_kg_invalidatefor the new one.mempalace_kg_add
Available Tools
Search & Browse
- — Semantic search across all memories. Always start here.
mempalace_search- (required): natural language search — keep it short, keywords or a question. Do NOT include system prompts or conversation context.
query - : filter by wing
wing - : filter by room
room - : max results (default 5)
limit
- — Check if content already exists before filing.
mempalace_check_duplicate- (required): text to check
content - : similarity threshold (default 0.9 — lowering to 0.85–0.87 often catches more near-duplicates without significant false positives)
threshold
- — Palace overview: total drawers, wings, rooms, AAAK spec
mempalace_status - — All wings with drawer counts
mempalace_list_wings - — Rooms within a wing (optional wing filter)
mempalace_list_rooms - — Full wing/room/count tree
mempalace_get_taxonomy - — Get AAAK compression dialect specification
mempalace_get_aaak_spec
Knowledge Graph (Temporal Facts)
- — Query entity relationships. Supports time filtering.
mempalace_kg_query- (required): e.g. "Max", "MyProject"
entity - : date filter (YYYY-MM-DD) — what was true at that time
as_of - : "outgoing", "incoming", or "both" (default "both")
direction
- — Add a fact: subject -> predicate -> object
mempalace_kg_add- ,
subject,predicate(required)object - : when this became true
valid_from - : source reference
source_closet
- — Mark a fact as no longer true
mempalace_kg_invalidate- ,
subject,predicate(required)object - : when it stopped being true (default: today)
ended
- — Chronological story of an entity
mempalace_kg_timeline- : filter by entity name (optional — all events if omitted)
entity
- — Graph overview: entities, triples, relationship types
mempalace_kg_stats
Palace Graph (Cross-Domain Connections)
- — Walk from a room, find connected ideas across wings
mempalace_traverse- (required): room to start from
start_room - : connection depth (default 2)
max_hops
- — Find rooms that bridge two wings
mempalace_find_tunnels- ,
wing_a(required)wing_b
- — Graph connectivity overview
mempalace_graph_stats
Write
- — Store verbatim content into a wing/room
mempalace_add_drawer- ,
wing,room(required)content - : optional source reference
source_file - Checks for duplicates automatically
- — Remove a drawer by ID
mempalace_delete_drawer- (required)
drawer_id
- — Write a session diary entry
mempalace_diary_write- (required): your name/identifier
agent_name - (required): what happened, what you learned, what matters
entry - : category tag (default "general")
topic
- — Read recent diary entries
mempalace_diary_read- (required)
agent_name - : number of entries (default 10)
last_n
Setup
Install MemPalace and populate the palace:
bash
pip install mempalace
mempalace init ~/my-convos
mempalace mine ~/my-convosOpenClaw MCP config
Add to your OpenClaw MCP configuration:
json
{
"mcpServers": {
"mempalace": {
"command": "python3",
"args": ["-m", "mempalace.mcp_server"]
}
}
}Or via CLI:
bash
openclaw mcp set mempalace '{"command":"python3","args":["-m","mempalace.mcp_server"]}'Other MCP hosts
bash
# Claude Code
claude mcp add mempalace -- python -m mempalace.mcp_server
# Cursor — add to .cursor/mcp.json
# Codex — add to .codex/mcp.jsonTips
- 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 before storing new content to avoid duplicates.
mempalace_check_duplicate - The AAAK dialect (from ) is a compressed notation for efficient storage. Read it naturally — expand codes mentally, treat markers as emotional context.
mempalace_status
License
MemPalace is MIT licensed. Created by Milla Jovovich, Ben Sigman, Igor Lins e Silva, and contributors.