mycelium-palace
A personal, local-first memory system for AI agents. It gives an assistant (Claude Desktop, Claude Code, Cursor, …) a durable memory across sessions:
- notes — curated synthesis you (or the agent) write down
- drawers — verbatim captures (command output, pastes, file contents)
- links — a typed semantic graph connecting the two
Everything is stored as plain Markdown files on your disk (git-backed, yours to
read), with a PostgreSQL/pgvector index for hybrid keyword + semantic search.
It speaks MCP, so any MCP-capable client can
use it. The PyPI package is mycelium-palace; the Python import is mycelium.
Requirements
- Python 3.12+
- PostgreSQL with the
pgvectorextension. A one-file Docker setup is included (docker-compose.yml) — you don't need to know Postgres. - An MCP client: Claude Desktop (easiest for a personal setup) or Claude Code.
Quick start
1. Install
pip install mycelium-palace # or: uv tool install mycelium-palace
2. Start the database
mycelium needs a PostgreSQL with the pgvector extension. The quickest way —
one command, nothing to clone:
docker run -d --name mycelium-db -e POSTGRES_PASSWORD=changeme -p 5432:5432 -v mycelium-pgdata:/var/lib/postgresql/data pgvector/pgvector:pg17
That runs Postgres with pgvector on localhost:5432. mycelium creates its own
tables and the vector extension on first connect — nothing else to set up.
(Prefer Docker Compose? This repo ships an equivalent docker-compose.yml; if
you cloned it, docker compose up -d does the same thing.)
Windows: install Docker Desktop (free for personal use; runs on Windows Home via the WSL2 backend), then paste the single-line
docker run …command above into PowerShell.
3. Wire it into your assistant
Claude Desktop (recommended for a personal setup — Windows/macOS/Linux):
mycelium install-desktop --db-url postgresql://postgres:changeme@localhost:5432/postgres
This writes an MCP server entry into Claude Desktop's config
(%APPDATA%\Claude\claude_desktop_config.json on Windows;
~/Library/Application Support/Claude/ on macOS; ~/.config/Claude/ on Linux),
launching mycelium over stdio. Restart Claude Desktop to load it. Run with
--dry-run first to preview the config.
Claude Code:
mycelium install --auto-hooks # merges recall/capture hooks into ~/.claude/settings.json
4. Use it
Ask your assistant to remember something ("capture this…", "make a note that…") and to recall ("what do we know about…").
Where your memory lives
Everything is plain Markdown on your own machine, under
~/.mycelium/data/vault/ (macOS/Linux) or %USERPROFILE%\.mycelium\data\vault\
(Windows), split into notes/, drawers/, diary/, concepts/, and links/.
These files are the canonical record — the Postgres index is just a
rebuildable derivative. Read them, grep them, back them up, edit them by hand.
Optional: version and sync your vault to GitHub
mycelium auto-commits every write and pushes to a git remote named origin
— but only once the vault is a git repo with that remote. Wire it up once (use a
private repo — this is your memory):
cd ~/.mycelium/data/vault # Windows: cd %USERPROFILE%\.mycelium\data\vault
git init && git branch -M main
git remote add origin https://github.com/<you>/<your-vault-repo>.git
git add -A && git commit -m "initial vault"
git push -u origin main
After that, every note/drawer/link write auto-commits and pushes in the
background. On Windows the first push prompts for GitHub credentials via Git
Credential Manager and caches them. Set MYCELIUM_GIT_AUTHOR /
MYCELIUM_GIT_EMAIL to stamp commits with your name (defaults: mycelium /
mycelium@localhost); set MYCELIUM_GIT_AUTHOR="" to disable git entirely.
How recall reaches the model
This is the one behaviour that differs by client:
-
Claude Code injects relevant memory automatically before every prompt via the
UserPromptSubmithook. Zero effort. -
Claude Desktop has no hooks, so recall is triggered two ways:
- The
contexttool — the model calls it when it judges memory is relevant (its description tells it to, at task start). Reliable but model-elective. - The
/recallprompt — pick recall from the "+" menu to deterministically inject memory into the conversation (optionally with a query). This is the manual analogue of the Claude Code hook.
For more consistent automatic recall, add a line to your Claude Desktop Project custom instructions: "At the start of each task, call the mycelium
contexttool to recall relevant memory." - The
How agent guidance is distributed
Guidance is authored once and travels with the package — update mycelium and every connected client picks up the new behaviour:
| Layer | Where it lives | How clients see it |
|---|---|---|
Per-tool guidance (when to call context(), capture rules) |
@mcp.tool() docstrings in mycelium/server.py |
Sent in tools/list; surfaced by all clients incl. Claude Desktop |
| Server instructions (broader usage notes) | FastMCP instructions= field |
Sent in initialize; honoured by Claude Code — ignored by Claude Desktop, which is why the recall imperative also lives in the context() tool description |
| Hook wiring (Claude Code) | ~/.claude/settings.json |
mycelium install --auto-hooks merges it for you |
Advanced: running behind a gateway
For multi-client or team setups, mycelium runs behind a gateway like
contextforge. mycelium serve
exposes SSE/HTTP transports (--transport sse|streamable-http|stdio) and
mycelium install --add-mcp-server registers a gateway endpoint. The gateway
must forward the upstream instructions field; IBM's upstream drops it as of
c3251f616, so the l-v-b fork
carries a forwarding patch.
Credits
The verbatim-capture / drawer storage / hybrid BM25+vector search at the heart of mycelium-palace originated in mempalace by milla-jovovich. mycelium-palace folds that design into a single-process server alongside the curated-note and typed-link layers; mempalace remains the authoritative source for the verbatim-only use case.
License
MIT — see LICENSE.
Metadata
Release files for mycelium-palace 2.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mycelium_palace-2.7.1.tar.gz | 83.3 MB | Without provenance | Details for mycelium_palace-2.7.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mycelium_palace-2.7.1-py3-none-any.whl | Python 3 | none | any | Details for mycelium_palace-2.7.1-py3-none-any.whl |
Total release size: 166.6 MB
Release files / mycelium_palace-2.7.1.tar.gz
| Download URL | mycelium_palace-2.7.1.tar.gz |
|---|---|
| Size | 83.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
235a4055f8f5c6c77834cc4ea1dfc0a8d243496d09501eeeae6cb5583ba470af
|
|
BLAKE2b-256 checksum How to use checksums |
5b4aba6a67c189a25110411e4bcc2571c9896adf65de9562776f1279d31a4a60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mycelium_palace-2.7.1-py3-none-any.whl
| Download URL | mycelium_palace-2.7.1-py3-none-any.whl |
|---|---|
| Size | 83.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8140e666336b9c25124cb6e87cc52264f1af93fc647d8315b6b48a19c3d16d32
|
|
BLAKE2b-256 checksum How to use checksums |
553f0e2d5889631861c2cd07173705e6c70ed06d3e9282e0581f54d86eb7eb22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mycelium-palace 2.7.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.