---
name: mempalace
description: Local AI memory system with 96.6% recall - semantic search, temporal knowledge graph, palace architecture
---

# MemPalace — Local AI Memory System

This skill provides 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.

## When to Use This Skill

- Searching past conversations, decisions, or project details
- Querying knowledge graph for facts about people or projects
- Adding memories to the palace after sessions
- Managing wings (people/projects), rooms (topics), and drawers (memories)

## 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

## Instructions

### Setup

Install MemPalace:

```bash
pip install mempalace
mempalace init ~/my-convos
mempalace mine ~/my-convos
```

### Protocol — FOLLOW THIS EVERY SESSION

1. **ON WAKE-UP**: Call `mempalace_status` to load palace overview and AAAK dialect spec.
2. **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.
3. **IF UNSURE** about a fact (name, age, relationship, preference): say "let me check" and query. Wrong is worse than slow.
4. **AFTER EACH SESSION**: Call `mempalace_diary_write` to record what happened, what you learned, what matters.
5. **WHEN FACTS CHANGE**: Call `mempalace_kg_invalidate` on the old fact, then `mempalace_kg_add` for the new one.

### Available Tools

#### Search & Browse
- `mempalace_search` — Semantic search across all memories
  - `query` (required): natural language search — keep it short, keywords or a question
  - `wing`: filter by wing
  - `room`: filter by room
  - `limit`: max results (default 5)
- `mempalace_check_duplicate` — Check if content already exists before filing
- `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
- `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 with time filtering
  - `entity` (required): e.g. "Max", "MyProject"
  - `as_of`: date filter (YYYY-MM-DD)
  - `direction`: "outgoing", "incoming", or "both"
- `mempalace_kg_add` — Add a fact: subject -> predicate -> object
- `mempalace_kg_invalidate` — Mark a fact as no longer true
- `mempalace_kg_timeline` — Chronological story of an entity
- `mempalace_kg_stats` — Graph overview

#### Palace Graph (Cross-Domain Connections)
- `mempalace_traverse` — Walk from a room, find connected ideas across wings
- `mempalace_find_tunnels` — Find rooms that bridge two wings
- `mempalace_graph_stats` — Graph connectivity overview

#### Write
- `mempalace_add_drawer` — Store verbatim content into a wing/room
- `mempalace_delete_drawer` — Remove a drawer by ID
- `mempalace_diary_write` — Write a session diary entry
- `mempalace_diary_read` — Read recent diary entries

### 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.
- Diary entries accumulate across sessions. Write one at the end of each conversation.
- Use `mempalace_check_duplicate` before storing new content.

## Installation

```bash
pip install mempalace
mempalace init ~/my-convos
mempalace mine ~/my-convos
```

## License

MIT — see https://github.com/MemPalace/mempalace