# Palace [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/AncientiCe/palace-rs  
**GitHub Stars:** 14  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/palace

## Description
Local-first memory for coding agents — MCP server, single SQLite file, local embeddings

## Tools
Capabilities this server exposes over MCP:

- **palace_status** — Palace overview + protocol
- **palace_gain** — MCP usage gains, estimated savings, and per-project value
- **palace_verify** — Verify MCP tools, database health, embeddings, and model cache
- **palace_recall_check** — Run project-memory probes and report expected-memory hits
- **palace_conflicts** — Surface likely stale or contradictory KG facts
- **palace_list_wings** — List registered wings: kind, description, project path, last mined time, drawer counts
- **palace_project_status** — Check whether the current project/topic is mined, registered but unmined, or unknown
- **palace_mine** — Mine a code repository on demand, after the user agrees
- **palace_create_wing** — Declare a topic or project wing in the registry
- **palace_list_rooms** — List rooms within a wing
- **palace_get_taxonomy** — Full wing → room → count tree
- **palace_get_aaak_spec** — AAAK compressed memory dialect spec
- **palace_search** — Semantic search over drawers
- **palace_preference_search** — Dedicated recall pass for preference-shaped queries
- **palace_check_duplicate** — Check if content already exists
- **palace_add_drawer** — File content into the palace
- **palace_remember** — Shortcut for `palace_add_drawer` with importance=5
- **palace_get_drawer** — Get a drawer by ID
- **palace_list_drawers** — List drawers with optional wing/room filters
- **palace_update_drawer** — Update drawer content and refresh metadata
- **palace_delete_drawer** — Remove a drawer by ID
- **palace_forget** — Delete a drawer by ID (outdated/incorrect memory)
- **palace_explain** — Full provenance for a drawer: who filed it, when, from where, importance
- **palace_kg_query** — Query entity relationships
- **palace_kg_add** — Add a fact (subject → predicate → object)
- **palace_kg_invalidate** — Mark a fact as no longer true
- **palace_kg_timeline** — Chronological fact history
- **palace_kg_stats** — Knowledge graph overview
- **palace_seed_adoption_facts** — Seed durable KG facts for four-client adoption
- **palace_traverse** — BFS graph walk from a room
- **palace_find_tunnels** — Rooms bridging two wings
- **palace_create_tunnel** — Create a persisted tunnel between two wing/room pairs
- **palace_list_tunnels** — List persisted tunnels
- **palace_delete_tunnel** — Delete a persisted tunnel
- **palace_follow_tunnels** — Follow persisted tunnels from a wing/room pair
- **palace_graph_stats** — Palace graph summary
- **palace_diary_write** — Write a diary entry in AAAK format
- **palace_diary_read** — Read recent diary entries
- **palace_diary_search** — Search within an agent's diary entries (or `all_agents: true` for cross-agent)
- **palace_session_context** — Get recent diary context for agent warm-start
- **palace_list_agents** — List agent diary wings
- **palace_export** — Export/import palace data
- **palace_upgrade_embeddings** — Re-embed drawers; refresh preference-span vectors
- **palace_prune** — Prune stale or low-value drawers
- **palace_hook_settings** — Return hook settings
- **palace_memory_report** — Human-readable inventory of what the palace remembers: profile, per-wing/room counts, recent activity — inspect memory without a UI

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/AncientiCe/palace-rs), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
curl -fsSL https://raw.githubusercontent.com/AncientiCe/palace-rs/main/scripts/install.sh | sh
```

2. Install:

```sh
irm https://raw.githubusercontent.com/AncientiCe/palace-rs/main/scripts/install.ps1 | iex
```

3. Install:

```sh
brew tap AncientiCe/palace
```

4. Install:

```sh
brew install palace
```

5. Install:

```sh
git clone https://github.com/AncientiCe/palace-rs && cd palace-rs
```

6. Install:

```sh
cargo build --release   # binary at target/release/palace
```

## Documentation

## What Palace does

Palace provides persistent memory for coding agents through MCP. It stores source text verbatim rather than reducing it to an LLM-generated summary, then attaches embeddings and metadata for retrieval. Memories can represent code excerpts, notes, conversations, diary entries, decisions, commands, or preferences.

Its storage model is organized into wings, rooms, and drawers. A wing represents a project or topic, a room groups related content, and a drawer contains one stored text item with metadata. Project wings correspond to folders on disk; topic wings can hold material such as meeting notes or chat history without a project folder.

Palace also maintains a time-stamped knowledge graph. Facts use a subject, predicate, and object structure, such as a project using a particular queue. Tools can add, invalidate, inspect, and traverse those relationships. Results include provenance such as the wing, room, source file, drawer ID, and score details.

## How it works

The server runs locally and stores its data in a SQLite database. Embeddings are generated on the local CPU through ONNX Runtime. The default model is `all-MiniLM-L6-v2`; the embedding model can be changed, with vectors rebuilt from the original stored text.

Search combines BM25 keyword matching with cosine similarity over embeddings. Query intent can be classified as a preference, decision, how-to question, definition, temporal query, or unknown request. Coding-related boosts and a separate preference search pass refine retrieval, and an optional local cross-encoder reranker can be enabled with `--rerank` or `PALACE_RERANK=1`.

Hooks can add relevant memory when a session starts, when a prompt is sent, and while an agent investigates. Repository mining is available on demand after user agreement. The resulting memory can be searched by the connected agent or from the terminal with the Palace CLI.

## Setup and configuration

Install the `palace` binary with the macOS/Linux installer, the Windows PowerShell installer, Homebrew on macOS Apple Silicon or Linux, an MCPB bundle, or a source build using Rust 1.82 or newer. Supported binary platforms are Linux x86_64, macOS Apple Silicon, and Windows x86_64. macOS Intel is not supported because an ONNX Runtime build is unavailable.

After installation, run `palace install` to connect supported agents and restart the agent application so it reloads its MCP configuration. `palace doctor` checks client wiring. A project can be initialized with `palace init <path> --yes --auto-mine`, which detects rooms, writes `palace.yaml`, and mines the repository.

The embedding model downloads from Hugging Face the first time mining or search requires it, then remains cached under `~/.cache/huggingface`. Palace does not require API keys for its local operation.

## Tools and capabilities

The MCP tool set covers four main areas:

- Inspecting operation with `palace_status`, `palace_verify`, and `palace_gain`.
- Managing projects and topics with wing, room, taxonomy, and project-status tools.
- Storing and retrieving memory with search, recall checks, duplicate detection, drawer CRUD, provenance, and forgetting tools.
- Working with structured knowledge through graph queries, fact updates, invalidation, timelines, statistics, seeding, and graph traversal.

`palace_mine` scans a repository on demand, while `palace_create_wing` registers a project or topic. `palace_remember` provides a fixed-importance shortcut for adding a drawer.

## Limitations and notes

Palace is designed around local storage and local embeddings, so first-use model downloads and indexing require local disk and CPU resources. Its one-file database and cached model make it suitable for local-first use, but database backups and migration are part of the operator's responsibility. Switching embedding models rebuilds vectors from stored text rather than discarding the underlying memories.

_Full upstream README: https://allmcps.com/mcp/palace/readme_

