skills/mempalace/SKILL.md
MemPalace local-first AI memory system. Use when setting up persistent memory for Claude Code sessions, mining project files or conversation transcripts, querying past context, configuring MCP tools, managing the knowledge graph, or troubleshooting palace operations.
npx skillsauth add enuno/claude-command-and-control mempalaceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
MemPalace (v3.3.6) is a local-first AI memory system. It stores conversation history and project content verbatim — no summarization, no paraphrasing, no external API calls by default. Retrieval uses hybrid BM25 + semantic search, achieving 96.6% R@5 on LongMemEval with zero LLM involvement.
mempalace mine) or Claude Code transcripts (--mode convos)mempalace search, wake-up)~/.claude/projects/ JSONL transcriptsPalace structure:
WING — broad category (person, project, topic)
└── ROOM — time-based grouping (day, session)
└── DRAWER — verbatim text chunk (exact words)
Index layer (AAAK dialect):
Compressed pointers → DRAWER locations
LLM scans AAAK index to know which drawer to open — no full content read needed
Knowledge Graph (SQLite):
ENTITY → PREDICATE → ENTITY (with valid_from / valid_to dates)
| Layer | Tokens | Loaded | Purpose |
|-------|--------|--------|---------|
| L0 | ~100 | Always | Identity — ~/.mempalace/identity.txt |
| L1 | ~500–800 | Always | Essential story — top moments from the palace |
| L2 | ~200–500 each | On demand | Wing/topic content when referenced |
| L3 | Unlimited | On demand | Full ChromaDB semantic search |
mempalace wake-up loads L0+L1 (~600–900 tokens total), leaving 95%+ of context free.
# Recommended — isolates deps, puts CLI on PATH
uv tool install mempalace
# Or with pipx
pipx install mempalace
# Inside an activated venv only
pip install mempalace
Python 3.9+ required. ChromaDB is the default backend (~300 MB for the embedding model).
First-run setup (choose embedding model, configure palace path):
python -m mempalace.onboarding
mempalace init ~/projects/myapp
# Project source files
mempalace mine ~/projects/myapp
# Claude Code conversation transcripts
mempalace mine ~/.claude/projects/ --mode convos
# Scope to a specific wing (person/project)
mempalace mine ~/.claude/projects/myapp --wing myapp
# Idempotent and resume-safe; run periodically for fine-grained recall
mempalace sweep ~/.claude/projects/myapp/
mempalace search "why did we switch to GraphQL"
mempalace search "auth bug fix" --wing myapp
mempalace wake-up
# Query graph (entities, relationships, timelines)
mempalace status # palace overview
mempalace hook install # wire stop + precompact hooks
mempalace hook status # verify hooks are active
mempalace repair # consistency checks
mempalace repair --status # dry-run report
mempalace migrate # ChromaDB version migration
Two hooks ship with MemPalace for automatic session persistence:
| Hook | Trigger | Purpose |
|------|---------|---------|
| mempal_save_hook.sh | Stop | Saves session diary to palace before Claude exits |
| mempal_precompact_hook.sh | PreCompact | Saves state before context compression |
Wire the hooks (required for automatic persistence):
mempalace hook install
The hooks must find the mempalace CLI. If installed via uv tool, ensure ~/.local/bin is on PATH inside the hook:
export PATH="$HOME/.local/bin:$PATH"
29 MCP tools cover palace reads/writes, knowledge-graph operations, cross-wing navigation, drawer management, and agent diaries.
# Start MCP server
mempalace mcp
Key tool categories:
mempalace_list_agents — discover agent wings at runtime (no system-prompt bloat)| Benchmark | Mode | Score | |-----------|------|-------| | LongMemEval R@5 (500q) | Raw semantic, no LLM | 96.6% | | LongMemEval R@5 (500q) | Hybrid v4, held-out 450q | 98.4% | | LongMemEval R@5 (500q) | Hybrid v4 + LLM rerank | ≥99% | | LoCoMo R@10 (1,986q) | Hybrid v5 | 88.9% | | ConvoMem avg recall (250) | All categories | 92.9% | | MemBench R@5 (8,500) | All categories | 80.3% |
Raw 96.6% requires no API key and no LLM at any stage.
Default: ChromaDB. To add a custom backend:
mempalace/backends/base.pybackends/__init__.py| Task | File |
|------|------|
| Add an MCP tool | mempalace/mcp_server.py — add handler + TOOLS dict entry |
| Change search | mempalace/searcher.py |
| Modify mining | mempalace/miner.py (files) or convo_miner.py (transcripts) |
| Add storage backend | Subclass mempalace/backends/base.py |
| Input validation | mempalace/config.py — sanitize_name() / sanitize_content() |
| AAAK compression | mempalace/dialect.py |
| 4-layer stack | mempalace/layers.py |
uv tool install mempalace
python -m mempalace.onboarding # choose embedding model
mempalace init ~/projects/myapp
mempalace mine ~/.claude/projects/ --mode convos --wing myapp
mempalace hook install # wire stop + precompact
mempalace wake-up # load L0+L1 into context
# After mining, sweep for one drawer per message
mempalace sweep ~/.claude/projects/myapp/
# Subsequent sweeps are idempotent — safe to run repeatedly
# Each agent gets its own wing and diary
# Discover agents at runtime (no system-prompt bloat):
mempalace_list_agents # via MCP tool
# Mine all existing Claude Code sessions retroactively
mempalace mine ~/.claude/projects/ --mode convos
# Then sweep for message-level granularity
mempalace sweep ~/.claude/projects/
tools
LangSmith Python SDK — trace, evaluate, and monitor LLM applications. Covers @traceable decorator, trace context manager, Client API, evaluate() / aevaluate(), comparative evaluation, custom evaluators, dataset management, prompt caching, ASGI middleware, and pytest plugin.
development
LangGraph (Python) — build stateful, controllable agent graphs with checkpointing, streaming, persistence, interrupts, fault tolerance, and durable execution. Covers both Graph API (StateGraph) and Functional API (@entrypoint/@task).
development
LangGraph Graph API (Python) — build explicit DAG agent workflows with StateGraph, typed state, nodes, edges, Command routing, Send fan-out, checkpointers, interrupts, and streaming. Use when you need explicit control flow and graph topology.
development
LangGraph Functional API (Python) — build stateful agent workflows with @entrypoint and @task decorators. Imperative Python style with LangGraph persistence, streaming, HITL, and durable execution. Ideal for wrapping existing agents (CrewAI, AutoGen, Strands) or complex parallel task logic.