palace-rs
Local-first memory for coding agents — MCP server, single SQLite file, local embeddings
Install / Use
claude mcp add AncientiCe -- npx -y github:AncientiCe/palace-rsIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of palace-rs
palace-rs scores 81/100 on our quality scale, 741st of 941 AI & Machine Learning skills we index.
Its MCP Server is 34 KB long, well organised into 29 sections with 25 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 2 days ago, so palace-rs is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
palace-rs compared with similar skills
All 4 of these similar skills score higher than palace-rs; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| palace-rs (this skill)by AncientiCe | 81 | 10 | 2d ago | MCP Server |
| claude-memby thedotmack | 100 | 102.4k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 101.1k | 2d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 87.8k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 77.6k | today | CLAUDE.md |
Frequently asked questions
- How do I install palace-rs?
- Run
claude mcp add AncientiCe -- npx -y github:AncientiCe/palace-rs. The install tabs above show the steps for each supported agent. - Which AI agents does palace-rs work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is palace-rs safe to use?
- It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is palace-rs still maintained?
- The repository was last updated 2 days ago, so palace-rs is actively maintained.
Skill content
View source on GitHubPalace gives Claude Code, Codex, Cursor, Gemini CLI, VS Code, OpenCode, Cline, Zed, Goose, Windsurf, and Claude Desktop a memory that lasts between sessions. It stores what happened verbatim, recalls it automatically when it's relevant, and cites where each answer came from.
You: why did we switch the queue to SQLite last month?
Agent: [palace_search → wing my_api, room decisions, filed 2026-09-03]
You dropped Redis because the deploy target had no persistent volume.
The benchmark you ran is in the same drawer.
🧭 Why Palace
Every new agent session starts with no memory. You explain the architecture again. The agent repeats a fix you rejected last week. It greps the whole repo to rediscover a convention you settled months ago.
Palace fixes that by:
- Storing text verbatim. Code, notes, and conversations are stored as written, not as an LLM summary that loses detail.
- Running locally. Embeddings come from
all-MiniLM-L6-v2on ONNX Runtime, on your CPU. Nothing leaves your machine unless you turn on remote mode. - Recalling without being asked. Hooks inject relevant memory when a session starts, when you send a prompt, and while the agent investigates. The agent does not need to remember to search.
- Citing sources. Every result carries its wing, room, source file, drawer id, and score breakdown, so you can check where an answer came from.
- Shipping as one binary. No Python, no vector database, no Docker. One
palaceexecutable and onepalace.dbfile.
It also works outside software projects. The creative and personal
profiles adapt it for worldbuilding, fiction, coaching, or
household notes.
📦 Install
Pick one. Each method installs the palace binary. Run palace install
afterwards to connect your agents.
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/AncientiCe/palace-rs/main/scripts/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/AncientiCe/palace-rs/main/scripts/install.ps1 | iex
The scripts download the matching GitHub Release binary, verify its SHA-256 checksum, and install it. To upgrade later, run the same command again.
Homebrew (macOS Apple Silicon / Linux)
brew tap AncientiCe/palace
brew install palace
To upgrade, refresh the tap first. Without brew update, Homebrew can keep
reporting the old version as already installed:
brew update && brew upgrade palace
When a release changes the memory protocol rule (the CHANGELOG says so), run
palace install again afterwards so your agents get the new rule text.
MCP registry / MCPB bundle. Palace is listed in the official
MCP registry as
io.github.ancientice/palace-rs. Each release also ships a palace-<version>.mcpb
bundle (Linux x86_64, macOS arm64, Windows x86_64) for one-click install in
MCPB-aware hosts such as Claude Desktop.
From source
git clone https://github.com/AncientiCe/palace-rs && cd palace-rs
cargo build --release # binary at target/release/palace
| Platform | Status | |---|---| | Linux x86_64 | Supported | | macOS Apple Silicon | Supported | | Windows x86_64 | Supported | | macOS Intel | Not supported (no ONNX Runtime build) |
The embedding model (~90 MB) downloads from Hugging Face the first time you
mine or search, then stays cached in ~/.cache/huggingface.
⚡ Quick start
palace install # connect every supported agent on this machine
palace doctor # check that every client is wired up
palace init ~/my-project --yes --auto-mine # detect rooms, write palace.yaml, mine
Restart your agent app so it reloads its MCP config. Then try:
"What do we know about how this project handles database migrations?"
The agent should call palace_search and answer from memory, citing the
drawer it used. You can also search from the terminal:
palace search "how did we decide on the database schema"
From then on, the agent writes a diary entry after substantial work and stores durable decisions as facts. Tomorrow's session, from any of your agents, picks up where today's left off.
🔍 How it works
The palace
Memory is organised like a building, which keeps search focused:
<p align="center"> <img src="docs/images/structure.svg" alt="Inside a palace: a project wing my_api with rooms backend, decisions, and testing full of drawers; a topic wing sales_notes; a knowledge graph fact my_api uses_queue SQLite; and agent diaries from claude and codex" width="100%"> </p><sub><i>Figure 1. One palace holds many wings. Rooms group drawers, and the knowledge graph and diaries sit alongside them.</i></sub>
| Concept | What it is | Example |
|---|---|---|
| Wing | A project or a topic | my_api, sales_notes |
| Room | An area inside a wing | backend, testing, decisions |
| Drawer | One chunk of verbatim text plus its embedding and metadata | a paragraph of db.rs, a diary entry |
| Knowledge graph | Time-stamped facts: subject → predicate → object | my_api → uses_queue → SQLite (valid from 2026-09-03) |
| Diary | Per-agent session notes for continuity | "Fixed the flaky migration test by…" |
| Tunnel | A link between rooms in different wings | my_api/auth ↔ my_web/login |
Wings are either project wings (a folder on disk, created by palace mine)
or topic wings (no folder, such as chat history or meeting notes, created
with palace_create_wing).
Retrieval
flowchart LR
Q["💬 Question<br/>from you or the agent"] --> S["Sanitize<br/>strip pasted dumps"]
S --> I["Classify intent<br/>decision · how_to · preference …"]
I --> H["Hybrid search<br/>BM25 + cosine"]
H --> B["Coding boosts<br/>+ preference pass"]
B --> R{"Rerank?<br/>optional"}
R --> OUT["📎 Results<br/>scores + source + neighbours"]
DB[("palace.db<br/>local embeddings")] -.-> H
<sub><i>Figure 2. What happens to a query. Everything runs locally on your CPU.</i></sub>
Search fuses BM25 keyword scoring with cosine similarity over local
embeddings. It then applies intent boosts for coding questions. Each query is
classified as preference, decision, how_to, definition, temporal, or
unknown. Preference-shaped questions ("how do I like my commits?") get a
dedicated pass against tagged preference spans. A local cross-encoder
reranker is available as an option (--rerank or PALACE_RERANK=1).
Agent-generated query dumps are cleaned up before retrieval. Results come back
with score provenance (combined, cosine, bm25, coding_boost,
preference_match, rerank_score, intent) and the neighbouring chunks from
the same source file.
Automatic recall (hooks)
palace install registers user-level hooks, so memory works in every project
without editing per-project files:
<sub><i>Figure 3. Three hooks read memory into the session. The fourth makes sure the session's lessons get written back.</i></sub>
| Hook | What it does |
|---|---|
| Session start | Injects the memory protocol, your standing rules from general/preferences (verbatim, in every project), recent diary entries for this project (from any agent), and the top drawers of the project's wing. |
| Prompt submit | Searches Palace with your actual question and injects matching drawers before the agent answers. If a history question finds nothing, it tells the agent to run palace_search. In Claude Code it also adds a one-line reminder until the session calls a Palace tool. Skips short prompts and slash commands. Claude Code and Codex only. |
| Post tool use | While the agent greps and reads files, recalls related memory so earlier decisions surface without a search. In Claude Code it also records the session's Palace calls. |
| Stop | If the session did real work but saved nothing, asks the agent once to write a diary entry and record decisions before it finishes. In Claude Code this is judged per session, including sessions that never used Palace; other agents use a recent-activity window. |
Auto-recall is limited to the current project. Drawers from your other project wings and diaries from other projects stay out. Topic wings still appear.
All hooks fail open: if the palace is missing or empty, the agent works as normal.
The memory protocol
palace install also writes a short rule into each client's instruction file.
The rule tells the agent when to use memory:
- Session start:
palace_status→palace_session_context→palace_diary_search. - Before answering a question about past decisions, preferences, or
history:
palace_searchandpalace_kg_query, before grep. - After work:
palace_diary_write, pluspalace_kg_addfor durable facts.
Grep remains the right first tool for current symbols, exact definitions, and code that may have changed since it was mined.
The nine protocol tools are marked _meta."anthropic/alwaysLoad" = true, so
Claude Code 2.1.121 and later keeps them loaded instead of deferring them
behind tool search.
Memory layers
| Layer | Name | Contents |
|---|---|---|
| L0 | Identity | ~/.palace/identity.txt, always loaded (~100 tokens) |
| L1 | Essential story | Top drawers by importance, grouped by room (~600–900 tokens) |
| L2 | On demand | Wing- and room-filtered retrieval |
| L3 | Deep search | Full hybrid search across the palace |
palace wake-up prints L0 and L1. Agents reach L2 and L3 through MCP tools.
🔌 Supported clients
palace install configures every supported client by default
(--client all). Gemini CLI, VS Code, Windsurf, OpenCode, Cline, Zed and
Goose are included only when their config folder exists, so Palace never sets up an agent you don't
have. Use `--client
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
102.4kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
101.1kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
87.8kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
77.6kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
