Local-first memory for coding agents β MCP server, single SQLite file, local embeddings
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Palace.
palace_statusPalace overview + protocol
palace_gainMCP usage gains, estimated savings, and per-project value
palace_verifyVerify MCP tools, database health, embeddings, and model cache
palace_recall_checkRun project-memory probes and report expected-memory hits
palace_conflictsSurface likely stale or contradictory KG facts
palace_list_wingsList registered wings: kind, description, project path, last mined time, drawer counts
A local-first memory retrieval engine for coding agents, implemented in Rust.
This project stores verbatim project and conversation memory, embeds it locally, and retrieves source-grounded context through MCP. It is built for coding agents that need to remember decisions, prior fixes, commands, project conventions, and user preferences across sessions without running a separate vector database.
all-MiniLM-L6-v2.preference_match score for preference-shaped queries.preference, decision, how_to, definition,
temporal, unknown) and can optionally rerank top results with a local
interaction reranker.palace gain precision metrics and
optional folded feedback on the existing palace_gain MCP tool.alwaysLoad so the
memory protocol doesn't depend on tool-search deferral (Claude Code >= 2.1.121).SessionStart, not just protocol text.Palace focuses on the retrieval cases that matter most during coding
work: preferences, project conventions, recent session continuity,
source-grounded answers, and measurable usefulness in real agent sessions.
Drawers that look like user preferences or conventions are tagged in metadata
during writes and updates, record the matched preference span, and can store a
secondary preference embedding. Preference-shaped queries receive a dedicated
preference_match score alongside hybrid semantic/BM25 search.
MCP search responses expose score provenance (combined, cosine, bm25, and
coding_boost, preference_match, optional rerank_score, and intent) plus
adjacent source context so agents can cite why a memory was returned. Diary tools
provide warm-start context for recent sessions, including project path, topic,
timestamp, session ID, tags, and compact text.
Library consumers can use Palace::search_with_provenance when they need the
same structured score details that MCP tools return.
Collapses Python's dual-store (ChromaDB + SQLite) into one file at ~/.palace/palace.db:
| Table | Purpose |
|---|---|
drawers | Text content + embedding BLOB + metadata |
entities | KG entity nodes |
triples | KG temporal relationship edges |
Embeddings are stored as f32 vectors from all-MiniLM-L6-v2. Search uses local cosine similarity over the stored vectors.
The repository includes a focused eval fixture for practical coding-agent memory questions. It stores realistic memories about project decisions, prior failures, commands, conventions, user preferences, and current direction, then asks 40 questions such as:
Run it with:
The test reports recall@1 and recall@5 and fails if retrieval drops below the
stable threshold. This is the product-shaped proof: not broad memory theater,
but whether a coding agent can recover the right project context when it matters.
Retrieval recall on the LongMemEval s_cleaned split β 500 questions over conversational haystacks of ~50 sessions / ~115k tokens each (30 abstention questions are filtered out per the standard convention, leaving 470 evaluated).
The recipe behind the numbers below:
all-MiniLM-L6-v2 (384-dim, ONNX), 512-token cap, run locally β no API calls.recall_any@K at session granularity β does any gold session appear in the top-K results?| Split | R@1 | R@5 | R@10 |
|---|---|---|---|
longmemeval_oracle (sanity check) | 1.000 | 1.000 | 1.000 |
longmemeval_s_cleaned | 0.889 | 0.981 | 0.991 |
Per-question-type on s_cleaned:
| Question type | R@1 | R@5 | R@10 |
|---|---|---|---|
| knowledge-update | 0.944 | 1.000 | 1.000 |
| multi-session | 0.909 | 0.983 | 1.000 |
| single-session-assistant | 1.000 | 1.000 | 1.000 |
| single-session-preference | 0.633 | 0.867 | 0.933 |
| single-session-user | 0.922 | 1.000 | 1.000 |
| temporal-reasoning | 0.835 | 0.976 | 0.984 |
oracle is a sanity check, not a real result. That split hands the retriever only the sessions known to contain the answer, so perfect recall just confirms the pipeline is wired up correctly.s_cleaned is the real test. ~50 sessions / ~115k tokens of conversational haystack per question, no hints. R@5 = 0.981 means that for 461 of 470 evaluated questions, a gold session appears somewhere in the top 5 retrieved.single-session-assistant, single-session-user, knowledge-update: β₯0.94 at R@1, β1.0 at R@5. The retriever handles direct questions where the answer is stated verbatim in one session.multi-session and temporal-reasoning: strong at R@5 (~0.98) but lower at R@1 (~0.83β0.91). Multiple sessions are relevant and the "best" one is a judgement call β top-1 ranking among near-equivalents is genuinely ambiguous.single-session-preference: the visible weak spot at 0.633 / 0.867 / 0.933. Preference questions ("what's my favorite X") are answered by sentences like "I likeβ¦" / "I preferβ¦" that don't share keywords with the question. Pure BM25 + frozen MiniLM has no signal for preference-shaped sentences specifically; closing this gap would require either an LLM-extracted preference index or a hand-rolled pattern booster.Note: macOS Intel is not supported due to ONNX Runtime unavailability. Apple Silicon and Linux x86_64 are fully supported.
macOS / Linux:
Windows:
The installer downloads the matching GitHub Release binary, verifies its SHA-256 checksum, installs it locally, and registers the MCP server with Cursor, Codex, and Claude Code.
Palace is published to the official MCP registry
as io.github.ancientice/palace-rs. Registry-aware clients can discover and
install it directly. Each release also ships a self-contained palace-<version>.mcpb
bundle (Linux x86_64, macOS arm64, Windows x86_64) as a GitHub Release asset for
one-click install in MCPB-aware hosts such as Claude Desktop.
The first time you run mine, the embedding model is downloaded automatically from HuggingFace and cached.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/palace)<a href="https://allmcps.com/mcp/palace"><img src="https://allmcps.com/api/badge/palace?style=directory" alt="Palace on AllMCPs" /></a>