Skip to content
/

MemPalace

mempalace · MemPalace/mempalace · ★ 53k · last commit 2026-05-26

Primitive shape 38 total
Commands 5 Skills 1 Hooks 2 MCP tools 30
00

Summary

mempalace — Summary

mempalace (MemPalace/mempalace) is a local-first AI memory system built on verbatim storage and semantic retrieval. It achieves 96.6% R@5 on LongMemEval without any LLM or API key — raw semantic search only. The palace is a spatial hierarchy: wings (people/projects) → rooms (topics) → drawers (verbatim content). A pluggable backend ABC defaults to ChromaDB; SQLite backs the temporal knowledge graph. The Python CLI (mempalace) installs via uv tool install mempalace. Claude Code integration ships 5 slash-commands, 1 skill, and 2 hooks (Stop + PreCompact). The MCP server exposes 30 tools covering palace reads/writes, knowledge graph operations, cross-wing navigation, tunnel management (cross-wing shortcuts), drawer CRUD, and agent diaries. Multi-agent support: each specialist agent gets its own wing and diary, discoverable via mempalace_list_agents. 52,851 stars, MIT license, 30 contributors, actively developed (pushed 2026-05-26).

Differs from seeds: closest to agentmemory (persistent memory, hybrid search, MCP-anchored, knowledge graph) but mempalace stores content verbatim (never summarizes), ships a 4-layer memory stack with explicit token budgets, uses ChromaDB as the default backend (pluggable via ABC), and achieves 96.6% R@5 without any LLM at any stage. It competes with Zep's temporal knowledge graph using local SQLite instead of Neo4j. Its security posture is unusually explicit: the README prominently warns about impostor sites distributing malware.

01

Overview

mempalace — Origin and Philosophy

Origin

Author: milla-jovovich (MemPalace org). 52,851 stars, 6,966 forks. MIT license. Python. Version 3.3.6. Develop branch is the active branch. 30 contributors. Website: mempalaceofficial.com.

The project description: "Local-first AI memory. Verbatim storage, pluggable backend, 96.6% R@5 raw on LongMemEval — zero API calls."

Philosophy

The central design choice is verbatim storage: MemPalace does not summarize, extract, or paraphrase. Every drawer stores the original text. This is a deliberate contrast with systems like agentmemory (LLM compression) and mem0 (extraction-based).

"MemPalace stores your conversation history as verbatim text and retrieves it with semantic search. It does not summarize, extract, or paraphrase."

The indexing is structured, not flat: rather than a single corpus, content is organized into wings (people, projects), rooms (topics), and drawers (verbatim units). Searches can be scoped to a wing or room rather than run against everything.

The retrieval layer is local and free: the 96.6% R@5 requires no API key, no cloud, and no LLM at any stage. The hybrid pipeline adds keyword boosting and temporal-proximity boosting to push to 98.4%. LLM rerank can push above 99%, but "we do not headline a '100%' number because the last 0.6% was reached by inspecting specific wrong answers."

The 4-Layer Memory Stack

layers.py defines explicit token budgets:

  • Layer 0 — Identity (~100 tokens): Always loaded. Reads from ~/.mempalace/identity.txt.
  • Layer 1 — Essential Story (~500–800 tokens): Always loaded. Top moments from the palace.
  • Layer 2 — On-Demand (~200–500 tokens each): Loaded when a topic/wing comes up.
  • Layer 3 — Deep Search (unlimited): Full ChromaDB semantic search.

"Wake-up cost: ~600–900 tokens (L0+L1). Leaves 95%+ of context free."

Temporal Knowledge Graph

The knowledge graph (knowledge_graph.py) positions itself against Zep:

"This is what competes with Zep's temporal knowledge graph. Zep uses Neo4j in the cloud ($25/mo+). We use SQLite locally (free)."

Default path: ~/.mempalace/knowledge_graph.sqlite3.

Security Posture

The README prominently warns:

"Beware of impostor sites. MemPalace has no other official websites. The only official sources are this GitHub repository, the PyPI package, and mempalaceofficial.com. Any other domain (including .tech, .net, or other .com variants) is an impostor and may distribute malware."

This is unusual in the AI tools space and suggests the project has been targeted by typosquatters.

Claude Code Retention Warning

"Claude Code sessions expire in 30 days without auto-save hooks wired."

The Stop and PreCompact hooks are presented as essential safety infrastructure, not optional enhancements.

02

Architecture

mempalace — Architecture

Distribution

Python package on PyPI. Recommended install:

uv tool install mempalace   # isolated environment, mempalace CLI on PATH
mempalace init ~/projects/myapp

Also: pipx install mempalace or pip install mempalace (inside venv only — PEP 668 errors on system Pythons).

Version 3.3.6 as of analysis.

Required Runtime

  • Python 3.9+
  • ChromaDB (default backend, installed as dependency)
  • ~300 MB disk for embedding model (embeddinggemma-300m recommended, multilingual 100+ languages; or all-MiniLM-L6-v2 English-only ~30 MB)
  • No API key required for core path

Server Architecture

mempalace CLI
      ↓
mempalace/cli.py — 15 subcommands (init, mine, sweep, sync, search, wakeup,
                   split, migrate, status, repair-status, repair, hook,
                   instructions, mcp, compress)
      ↓
mempalace/palace.py — palace operations via backend layer
      ├── mempalace/backends/chroma.py — ChromaDB backend (default)
      ├── mempalace/backends/base.py — BaseBackend ABC (pluggable)
      └── mempalace/backends/registry.py — backend registry

State:
  ChromaDB collections (default): mempalace_drawers, mempalace_closets
  SQLite: ~/.mempalace/knowledge_graph.sqlite3
  Identity: ~/.mempalace/identity.txt

MCP: mempalace/mcp_server.py — 30 tools (stdio via mempalace-mcp binary)

Repository Structure

MemPalace/mempalace/ (develop branch)
├── mempalace/
│   ├── __init__.py
│   ├── cli.py              # 15 CLI subcommands
│   ├── mcp_server.py       # 30 MCP tools (stdio)
│   ├── palace.py           # Core palace operations
│   ├── backends/
│   │   ├── base.py         # BaseBackend ABC, BaseCollection ABC
│   │   ├── chroma.py       # ChromaDB backend
│   │   └── registry.py     # Backend registry
│   ├── knowledge_graph.py  # Temporal entity-relationship graph (SQLite)
│   ├── layers.py           # 4-layer memory stack (L0–L3)
│   ├── miner.py            # File mining pipeline
│   ├── convo_miner.py      # Conversation (JSONL) mining
│   ├── convo_scanner.py    # Claude Code JSONL scanner
│   ├── embedding.py        # Local embedding model
│   ├── hooks_cli.py        # Hook implementation (called by shell scripts)
│   ├── onboarding.py       # Interactive onboarding
│   └── ...                 # 30+ additional modules
├── .claude-plugin/
│   ├── plugin.json         # v3.3.6
│   ├── .mcp.json           # MCP server wiring
│   ├── commands/           # 5 slash commands
│   ├── hooks/              # 2 hook scripts (Stop + PreCompact)
│   └── skills/             # 1 skill (mempalace/)
├── benchmarks/             # LongMemEval, LoCoMo, ConvoMem, MemBench
└── docs/
    └── HISTORY.md          # Public corrections and security notices

Backend Abstraction (RFC 001)

BaseBackend ABC defines get_collection(palace_path, collection_name, create). Any implementation that satisfies the interface can replace ChromaDB. The registry (backends/registry.py) allows drop-in backend substitution.

Error hierarchy: BackendErrorPalaceNotFoundErrorCollectionNotInitializedError | BackendClosedError | UnsupportedFilterError. Silent dropping of unknown filter operators is explicitly forbidden by spec.

Normalization Versioning

NORMALIZE_VERSION = 2 (as of 2026-04). When the normalization pipeline changes, the version bumps and existing drawers are rebuilt on the next mine pass. file_already_mined treats drawers with missing/stale normalize_version as "not mined." No user action required.

03

Components

mempalace — Components

5 Slash-Commands (Claude Code)

All in .claude-plugin/commands/:

Command Description
/help General help and navigation
/init Set up MemPalace: install, initialize a palace, configure MCP, verify
/mine Mine content into the palace (files or conversations)
/search Search memories with wing/room filtering
/status Check palace status and health

Command pattern (from init.md): commands delegate to the generic mempalace skill via Skill tool with the <command> command, then follow its instructions. The skill calls mempalace instructions <command> to fetch live instructions from the CLI.

1 Skill

mempalace skill (SKILL.md):

MemPalace provides dynamic instructions via the CLI. To get instructions for any operation:
  mempalace instructions <command>
Where <command> is one of: help, init, mine, search, status.
Run the appropriate instructions command, then follow the returned instructions step by step.

Allowed tools: Bash, Read, Write, Edit, Glob, Grep.

2 Hooks

Both hooks are thin bash wrappers calling mempalace hook run --hook <event> --harness claude-code. All logic lives in mempalace/hooks_cli.py for cross-harness extensibility.

Event Script Timeout Purpose
Stop mempal-stop-hook.sh 30s Auto-save session on Claude Code stop
PreCompact mempal-precompact-hook.sh 90s Save before context compaction (90s timeout allows mining of current session)

Hook fallback chain: tries mempalace CLI → python3 -m mempalacepython -m mempalace → error message to stderr.

30 MCP Tools (stdio, via mempalace-mcp binary)

Palace navigation:

  • mempalace_status — server health and palace status
  • mempalace_list_wings — list all wings (people/project namespaces)
  • mempalace_list_rooms — list rooms within a wing
  • mempalace_get_taxonomy — full wing/room/drawer taxonomy
  • mempalace_get_aaak_spec — get palace specification

Knowledge graph:

  • mempalace_kg_query — query entities/relations (point-in-time)
  • mempalace_kg_add — add entity/relation triple with validity window
  • mempalace_kg_invalidate — mark a fact as no longer valid
  • mempalace_kg_timeline — get entity timeline
  • mempalace_kg_stats — knowledge graph statistics

Graph/tunnel navigation:

  • mempalace_traverse — traverse the palace graph from a node
  • mempalace_find_tunnels — find tunnels (cross-wing shortcuts)
  • mempalace_graph_stats — overall graph statistics
  • mempalace_create_tunnel — create a cross-wing shortcut
  • mempalace_list_tunnels — list all tunnels
  • mempalace_delete_tunnel — remove a tunnel
  • mempalace_follow_tunnels — navigate via tunnels

Search and drawer ops:

  • mempalace_search — semantic search across palace
  • mempalace_check_duplicate — dedup check before adding
  • mempalace_add_drawer — add verbatim content
  • mempalace_delete_drawer — remove a drawer
  • mempalace_sync — sync the palace
  • mempalace_get_drawer — get specific drawer by ID
  • mempalace_list_drawers — list drawers in a room
  • mempalace_update_drawer — update drawer content

Agent diaries:

  • mempalace_diary_write — write to agent's diary
  • mempalace_diary_read — read agent's diary entries

System:

  • mempalace_hook_settings — get/set hook configuration
  • mempalace_memories_filed_away — get session filing summary
  • mempalace_reconnect — reconnect to backend

Note: README says "29 MCP tools" but mcp_server.py defines 30 named tools.

CLI Commands (15 subcommands)

mempalace init <palace_path>            # initialize palace
mempalace mine <path> [--mode]         # mine files (default) or convos
mempalace sweep <transcript_dir>       # per-message sweep (idempotent)
mempalace sync                          # sync palace
mempalace search "<query>"             # semantic search
mempalace wake-up / wakeup             # load L0+L1 context for session
mempalace split                         # split large drawers
mempalace migrate                       # migrate palace schema
mempalace status                        # palace health
mempalace repair-status                # detailed repair diagnostics
mempalace repair                        # repair corrupted palace
mempalace hook run --hook <event>      # internal hook runner
mempalace instructions <command>       # dynamic CLI instructions (used by skill)
mempalace mcp                          # run MCP server
mempalace compress                     # compress palace
05

Prompts

mempalace — Prompts and Instructions

Skill SKILL.md (verbatim)

MemPalace — mine projects and conversations into a searchable memory palace.
Use when asked about mempalace, memory palace, mining memories, searching memories, or palace setup.

A searchable memory palace for AI — mine projects and conversations, then search them semantically.

Prerequisites:
Ensure `mempalace` is installed:
  mempalace --version

If not installed (uv recommended):
  uv tool install mempalace   # or: pip install mempalace

Usage:
MemPalace provides dynamic instructions via the CLI. To get instructions for any operation:
  mempalace instructions <command>
Where <command> is one of: help, init, mine, search, status.
Run the appropriate instructions command, then follow the returned instructions step by step.

The "dynamic instructions" pattern is notable: the skill does not contain static prompt text. Instead it calls mempalace instructions <command> which the CLI returns at runtime. This means prompt updates ship with new package versions, not plugin updates.

plugin.json Description (verbatim)

"Give your AI a memory — mine projects and conversations into a searchable palace. 19 MCP tools, auto-save hooks, and guided setup."

(Note: plugin.json v3.3.6 says "19 MCP tools" but mcp_server.py defines 30 tools. The README says "29 MCP tools." The plugin description lags the implementation.)

README Warning — Verbatim

"Claude Code sessions expire in 30 days without auto-save hooks wired. Read this → [Claude Code retention setup checklist]"

"Need the shortest recovery/setup path? Use the Claude Code retention setup checklist: wire the hooks, back up existing JSONL transcripts, and backfill them with mempalace mine ~/.claude/projects/ --mode convos."

README Benchmark Honesty — Verbatim

"We deliberately do not include a side-by-side comparison against Mem0, Mastra, Hindsight, Supermemory, or Zep. Those projects publish different metrics on different splits, and placing retrieval recall next to end-to-end QA accuracy is not an honest comparison."

"We do not headline a '100%' number because the last 0.6% was reached by inspecting specific wrong answers, which benchmarks/BENCHMARKS.md flags as teaching to the test."

Knowledge Graph Docstring — Verbatim

This is what competes with Zep's temporal knowledge graph.
Zep uses Neo4j in the cloud ($25/mo+). We use SQLite locally (free).

Usage:
    kg = KnowledgeGraph()
    kg.add_triple("Max", "child_of", "Alice", valid_from="2015-04-01")
    kg.add_triple("Max", "does", "swimming", valid_from="2025-01-01")

    # Query: everything about Max
    kg.query_entity("Max")

    # Query: what was true about Max in January 2026?
    kg.query_entity("Max", as_of="2026-01-15")

layers.py Docstring — Verbatim

Layer 0: Identity       (~100 tokens)   — Always loaded. "Who am I?"
Layer 1: Essential Story (~500-800)      — Always loaded. Top moments from the palace.
Layer 2: On-Demand      (~200-500 each)  — Loaded when a topic/wing comes up.
Layer 3: Deep Search    (unlimited)      — Full ChromaDB semantic search.

Wake-up cost: ~600-900 tokens (L0+L1). Leaves 95%+ of context free.

Backend Contract — BaseBackend ABC Docstring

"Silent dropping of unknown filter operators is forbidden by spec (RFC 001 §1.4)."

The UnsupportedFilterError is explicitly documented — backends must raise, not silently ignore, unsupported queries.

09

Uniqueness

mempalace — Uniqueness and Positioning

Differs from Seeds

Closest to agentmemory (persistent memory, hybrid search, MCP-anchored, knowledge graph, Claude Code plugin + hooks) but with fundamental design differences:

  1. Verbatim storage: agentmemory compresses observations via LLM. mempalace stores everything verbatim — "it does not summarize, extract, or paraphrase." This is a principled stance: verbatim recall is higher fidelity even if noisier.

  2. 96.6% R@5 without any LLM: agentmemory achieves 95.2% R@5 but requires local embeddings (all-MiniLM-L6-v2) plus optional LLM compression. mempalace achieves 96.6% with zero LLM at any stage, 98.4% with purely algorithmic boosting (keyword + temporal proximity), 99%+ with LLM rerank. The gap matters: no API key, no API cost, no API dependency.

  3. Spatial hierarchy vs flat observations: agentmemory stores observations in a flat per-session KV. mempalace has a 3-tier spatial hierarchy (wings → rooms → drawers). Searches can be scoped to a wing/room rather than always running against the full corpus.

  4. 4-layer token budget: mempalace defines explicit token budgets (L0: 100, L1: 500–800, L2: 200–500, L3: unlimited). "Wake-up cost: 600–900 tokens. Leaves 95%+ of context free." agentmemory has no equivalent layered context loading model.

  5. Dynamic instructions pattern: The skill calls mempalace instructions <command> to fetch live instructions from the CLI at runtime. Prompt updates ship with pip upgrades, not plugin reinstalls. agentmemory's skills contain static instruction text.

  6. Pluggable backend ABC: RFC 001 defines a formal BaseBackend interface. ChromaDB is the default, but any conforming implementation can drop in. agentmemory is tightly coupled to iii-engine's SQLite StateModule.

  7. Temporal knowledge graph in local SQLite: Both systems have knowledge graphs; mempalace's runs in ~/.mempalace/knowledge_graph.sqlite3 with explicit point-in-time queries. No Neo4j, no cloud ($25/mo+).

Security Stance

Unusually explicit: README warns about impostor sites distributing malware. docs/HISTORY.md maintains a public correction and incident log. This is the only framework in the Phase B corpus with a formal public security notice.

Benchmark Honesty

Does not make comparative claims against competitors because "those projects publish different metrics on different splits, and placing retrieval recall next to end-to-end QA accuracy is not an honest comparison." Does not headline 100% because "the last 0.6% was reached by inspecting specific wrong answers." Publishes full per-question result files in benchmarks/results_*.

Observable Failure Modes

  1. ChromaDB version sensitivity: ChromaDB has a history of breaking schema changes between minor versions. palace.py's NORMALIZE_VERSION versioning partially mitigates this, but upstream ChromaDB changes can still break the backend silently.

  2. 30 vs 19 vs 29 MCP tool count skew: plugin.json says "19 MCP tools", README says "29 MCP tools", mcp_server.py defines 30. Three different counts for the same thing — the plugin description is significantly stale.

  3. Wake-up is manual: Unlike agentmemory's SessionStart context injection, mempalace's L0+L1 loading requires the user or agent to call mempalace wake-up. Agents that don't invoke the skill at session start get no prior context automatically.

  4. PreCompact 90s timeout: Mining the current session before compaction takes up to 90 seconds. Long sessions with many files can exceed this, leaving the compacted context without fresh memories.

  5. Single palace per mining run: Each mempalace mine <path> targets a single palace. Multi-project setups require multiple mine calls and manual wing management.

04

Workflow

mempalace — Workflow

Setup Phase

1. uv tool install mempalace
2. mempalace init ~/projects/myapp           # creates palace at path
3. mempalace mine ~/projects/myapp           # mine project files
4. mempalace mine ~/.claude/projects/ --mode convos --wing myapp  # mine past sessions
5. mempalace connect claude-code (or: agentmemory connect)   # wire hooks

Mining Phase

Two mining modes:

File mining (mine <path>): Scans source files, skips build artifacts (node_modules, pycache, .git, etc.), chunks and embeds content. Stores in ChromaDB. Idempotent — file_already_mined check using normalize_version.

Conversation mining (mine <path> --mode convos): Reads Claude Code JSONL transcript files via convo_miner.py + convo_scanner.py. Strips system tags and hook chrome (v2 normalization, added 2026-04). Stores one verbatim drawer per conversation chunk.

Sweep mode (sweep <transcript_dir>): Per-message granularity. Stores one verbatim drawer per user/assistant message. Idempotent and resume-safe.

Session Start (Context Loading)

mempalace wake-up loads the 4-layer memory stack:

  1. Layer 0 (~100 tokens): ~/.mempalace/identity.txt — always injected
  2. Layer 1 (~500–800 tokens): top moments from the palace — always injected
  3. Layers 2–3 loaded on-demand as topics arise during the session

This is manual (run mempalace wake-up), not automatic on session start.

Auto-Save Flow (Hook-Triggered)

The Stop hook fires when Claude Code stops:

  1. mempal-stop-hook.sh calls mempalace hook run --hook stop --harness claude-code
  2. hooks_cli.py mines the current session transcript
  3. Content stored as drawers in palace

The PreCompact hook fires before context compaction (90s timeout):

  1. mempal-precompact-hook.sh calls mempalace hook run --hook precompact --harness claude-code
  2. Current session saved before context window resets
  3. wake-up output written to stdout → survives compaction

Search / Recall

Via CLI: mempalace search "why did we switch to GraphQL" Via MCP: mempalace_search tool with optional wing/room filters Via skill: /search [query] → delegates to skill → calls CLI instructions

Three-layer retrieval:

  1. ChromaDB semantic search (local embedding model)
  2. Keyword (BM25-style) boosting — hybrid v4
  3. Temporal-proximity boosting (recent content ranked higher)

Optional LLM rerank: top-20 candidates passed to any capable LLM for final ranking.

Knowledge Graph Operations

Add a fact:

kg.add_triple("Max", "works_on", "myapp", valid_from="2026-01-01")

Query point-in-time:

kg.query_entity("Max", as_of="2026-05-01")  # "what was true about Max in May?"

Invalidate:

kg.invalidate("Max", "works_on", "myapp", ended="2026-04-15")

All operations go through mempalace_kg_* MCP tools when used via MCP.

Multi-Agent Flow

Each specialist agent gets:

  • Own wing in the palace (e.g., wing=security-agent)
  • Own diary (mempalace_diary_write / mempalace_diary_read)
  • Discoverable via mempalace_list_agents — no bloat in system prompt

Agents can create tunnels (cross-wing shortcuts): mempalace_create_tunnel links a room in one wing to a room in another, enabling navigation without full-path specification.

06

Memory Context

mempalace — Memory and Context

Palace Hierarchy

Palace (palace_path)
  └── Wings (people, projects — namespace level)
        └── Rooms (topics within a wing)
              └── Drawers (verbatim content units)

Drawers are the atomic storage unit. Each drawer contains the original verbatim text — no summarization, no paraphrasing.

Storage Backends

ChromaDB (default): Two collections per palace:

  • mempalace_drawers — primary drawer storage with embeddings
  • mempalace_closets — searchable index layer

Pluggable via BaseBackend ABC: Any backend that implements get_collection(palace_path, collection_name, create) can replace ChromaDB. backends/registry.py provides the factory lookup.

SQLite: ~/.mempalace/knowledge_graph.sqlite3 — temporal entity-relationship graph.

Plain text: ~/.mempalace/identity.txt — Layer 0 identity (~100 tokens).

Embedding Model

Default: embeddinggemma-300m — multilingual, 100+ languages, ~300 MB. Recommended via onboarding.

Alternative: all-MiniLM-L6-v2 — English-only, ~30 MB.

Local inference via mempalace/embedding.py. No API key required. ONNX int8 quantization for inference speed.

4-Layer Memory Stack

Defined in layers.py:

Layer Tokens Loaded Source
L0 — Identity ~100 Always ~/.mempalace/identity.txt
L1 — Essential Story ~500–800 Always Top moments from mempalace_drawers
L2 — On-Demand ~200–500 each When topic arises Wing/room-scoped drawer retrieval
L3 — Deep Search Unlimited On request Full ChromaDB semantic search

Wake-up cost (L0+L1): ~600–900 tokens total. Leaves 95%+ of context free.

Temporal Knowledge Graph

knowledge_graph.py — entity-relation triples with validity windows:

  • add_triple(entity, relation, target, valid_from, valid_to=None) — add a fact
  • query_entity(entity, as_of=None, direction="both") — query point-in-time or current
  • invalidate(entity, relation, target, ended) — mark fact as no longer valid
  • kg_timeline(entity) — full history of entity facts

Default path: ~/.mempalace/knowledge_graph.sqlite3. No external database required.

Tunnel System

Cross-wing shortcuts: mempalace_create_tunnel(from_wing, from_room, to_wing, to_room) creates a bidirectional navigation shortcut. mempalace_find_tunnels discovers relevant tunnels from any node. mempalace_follow_tunnels navigates via them.

Tunnels enable cross-project context: a drawer about JWT auth in the myapp wing can tunnel to the security-patterns wing without duplicating content.

Mining Sources

Project files: source code, docs, configs. Skips: .git, node_modules, pycache, .venv, dist, build, .next, coverage, and 15+ other build artifact directories.

Claude Code JSONL transcripts (--mode convos): Reads ~/.claude/projects/ JSONL files. v2 normalization strips system tags and hook chrome. Scope per project with --wing <project_name>.

Sweep (per-message): mempalace sweep <transcript_dir> — one drawer per user/assistant message. More granular than convo mining. Idempotent.

Agent Diaries

Each specialist agent gets a private diary in the palace. mempalace_diary_write appends entries; mempalace_diary_read retrieves them. Diaries are scoped per agent identity and persist across sessions. mempalace_list_agents discovers all agents with diaries — agents are not pre-declared in configuration.

Persistence Scope

Global: knowledge graph, identity, agent diaries. Project-scoped: palace collections at palace_path. Multiple palaces can be maintained simultaneously (e.g., one per project).

Normalization Version

NORMALIZE_VERSION = 2. Drawers mined with earlier normalization are rebuilt transparently on the next mine pass — no manual migration required. The version is stored in drawer metadata.

07

Orchestration

mempalace — Orchestration

Multi-Agent Pattern

mempalace is a memory layer, not an orchestrator. Multi-agent support is through the palace hierarchy:

Wing-per-agent: Each specialist agent gets its own wing in the palace. Wings function as agent namespaces — agent A's observations don't pollute agent B's unless explicitly shared via tunnels.

Diary system: mempalace_diary_write / mempalace_diary_read — each agent has a private diary. Cross-agent diary reading is possible if the reading agent knows the other agent's identity.

Discovery: mempalace_list_agents — dynamically discovers all agents that have diaries in the palace. No static agent registration. Agents announce themselves by writing their first diary entry.

Tunnels for cross-agent context: mempalace_create_tunnel creates cross-wing shortcuts. An orchestrator can create a tunnel from the security-agent wing to the backend-agent wing to share authentication patterns without duplicating drawers.

Isolation Mechanism

Wing-level isolation: each wing is a distinct namespace in ChromaDB. mempalace_search with a wing filter stays in that agent's namespace. Without a filter, search runs across the entire palace.

No container-level or process-level isolation. All agents share the same ChromaDB instance and the same SQLite knowledge graph.

Parallelism Model

mempalace is passive — it stores and retrieves; agents call it. Multiple agents can call the MCP server concurrently. ChromaDB handles concurrent reads; writes are isolated by collection (wing/room).

No built-in coordination between agents. Coordination (which agent does what) is left to the orchestrating harness.

Cross-Tool Support

mempalace works with any MCP-capable agent. The .claude-plugin/ provides native Claude Code integration; the mempalace-mcp binary works with any host that supports stdio MCP servers.

No agent-specific adapters needed beyond MCP config. The CLI is harness-agnostic — mempalace hook run --harness <name> accepts arbitrary harness identifiers.

Team / Shared Memory

No explicit team-sharing mechanism (unlike agentmemory's memory_team_share). Cross-agent sharing in mempalace is via shared palace + tunnel navigation. If all agents point at the same palace, they share the same ChromaDB and knowledge graph. Access is unmediated — any agent can read any wing.

08

Ui Cli Surface

mempalace — UI and CLI Surface

CLI Binary: mempalace

Installed via uv tool install mempalace. 15 subcommands:

mempalace init <path>              # initialize palace
mempalace mine <path>              # mine files or convos (--mode convos)
mempalace sweep <transcript_dir>   # per-message sweep
mempalace sync                     # sync palace
mempalace search "<query>"         # semantic search
mempalace wake-up                  # load L0+L1 context for session start
mempalace split                    # split large drawers
mempalace migrate                  # migrate palace schema
mempalace status                   # palace health
mempalace repair-status            # detailed repair diagnostics
mempalace repair                   # repair corrupted palace
mempalace hook run --hook <event> --harness <name>  # internal hook runner
mempalace instructions <command>   # get live instructions (used by skill)
mempalace mcp                      # start MCP server
mempalace compress                 # compress palace

Also: mempalace --version for version check.

Claude Code Slash-Commands (5)

All are thin wrappers that call mempalace instructions <command> via the skill:

/help     — general help
/init     — guided setup
/mine     — mine content
/search   — semantic search
/status   — palace health

Claude Code Skill

/mempalace — the master skill. Handles all operations by calling mempalace instructions <command> and following the returned steps. Allowed tools: Bash, Read, Write, Edit, Glob, Grep.

MCP Server

mempalace-mcp binary — stdio MCP server. 30 tools covering palace reads/writes, knowledge graph, tunnels, diary, and system ops.

MCP server configuration in .claude-plugin/.mcp.json:

{
  "mcpServers": {
    "mempalace": {
      "command": "mempalace-mcp"
    }
  }
}

No AGENTMEMORY_URL-style env var — the mempalace-mcp binary connects to the local ChromaDB and SQLite directly (no separate server process).

Hooks (2)

Stop hook (30s timeout) and PreCompact hook (90s timeout). Both are bash scripts that call mempalace hook run. The 90s PreCompact timeout accounts for mining the full current session before compaction.

No Web Dashboard

mempalace has no web UI (unlike agentmemory's real-time viewer on port 3113). All interaction is CLI-based or via MCP tools.

Onboarding

python -m mempalace.onboarding — interactive onboarding that offers embedding model choice (embeddinggemma-300m multilingual 300 MB recommended vs all-MiniLM-L6-v2 English-only 30 MB).

Dynamic Instructions Pattern

mempalace instructions <command> returns live Markdown instructions from the CLI. This means the skill doesn't hard-code prompt text — instead it fetches current instructions at runtime. Prompt updates ship with pip install --upgrade mempalace without plugin reinstall.

Related frameworks

same archetype · same primary tool · same memory type

Beads (Yegge) ★ 24k

Dolt-powered distributed graph issue tracker where AI agents track tasks with hierarchical IDs and dependency edges, claim work…

deepagents (LangChain) ★ 23k

Opinionated Python agent harness on top of LangGraph with sub-agents, filesystem, memory, and context compaction bundled in

agentmemory ★ 18k

Persistent, searchable memory for AI coding agents that captures every tool interaction, compresses it via LLM, and injects…

Open Multi-Agent ★ 6.3k

Give a natural-language goal to a coordinator agent and get a dynamically decomposed, parallelized task DAG executed by…

Basic Memory ★ 3.1k

Gives AI agents a persistent, human-readable knowledge graph of project decisions, observations, and relations stored as plain…

Claude-Supermemory ★ 2.6k

Gives Claude Code team-level persistent memory via a cloud API, sharing project knowledge across developers and sessions without…