YourMemory — Claude Code MCP server: what it does, how to install
Adds persistent memory to coding agents using forgetting curves and entity graphs. Keeps project context intact between sessions without bloating the context window.
claude mcp add --env PYTHONIOENCODING=<PYTHONIOENCODING> --transport stdio yourmemory -- uvx yourmemoryWhat YourMemory does
YourMemory stores facts and working context locally inside ~/.yourmemory/. DuckDB serves as the default zero-config storage engine, while teams can route shared memories to Postgres using pgvector. As facts pile up, the engine summarizes related entries into single records and archives the source items.
The retrieval layer blends vector search, BM25 keyword matching, and an entity relationship graph. Unused memories fade over time following the Ebbinghaus forgetting curve, whereas recalled knowledge stays fresh. Read, write, and deletion events get recorded in a hash-chained audit log.
Running the tool requires Python 3.11 to 3.14 alongside an activation token from yourmemoryai.xyz. Without initial token setup in the CLI, the server will not function.
What it helps with
- retain user preferences across agent resets
- compress redundant project facts into consolidated summaries
- trace related entities during multi-hop lookups
- audit memory operations via a tamper-evident log
Example prompts for the agent
- Recall our architectural decisions regarding database migrations from earlier sessions.
- Store the new deployment guidelines for our backend microservices.
- Purge deprecated API credentials and old notes from agent memory.
How to install YourMemory
Platform CLI
claude mcp add --env PYTHONIOENCODING=<PYTHONIOENCODING> --transport stdio yourmemory -- uvx yourmemoryReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>
Platform CLI
codex mcp add yourmemory --env PYTHONIOENCODING=<PYTHONIOENCODING> -- uvx yourmemoryReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>
Config file
{
"mcpServers": {
"yourmemory": {
"command": "uvx",
"args": [
"yourmemory"
],
"env": {
"PYTHONIOENCODING": "<PYTHONIOENCODING>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>
Config file
{
"servers": {
"yourmemory": {
"type": "stdio",
"command": "uvx",
"args": [
"yourmemory"
],
"env": {
"PYTHONIOENCODING": "<PYTHONIOENCODING>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>
Platform CLI
gemini mcp add -e PYTHONIOENCODING=<PYTHONIOENCODING> yourmemory uvx yourmemoryReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from yourmemory <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about YourMemory
How do I install YourMemory in Claude Code?
Run claude mcp add yourmemory -- uvx yourmemory. If you need custom encoding, run claude mcp add --env PYTHONIOENCODING=<PYTHONIOENCODING> --transport stdio yourmemory -- uvx yourmemory.
Where does YourMemory keep stored data?
It defaults to a single DuckDB database file in ~/.yourmemory/. Teams can switch to a remote Postgres database with the pgvector extension enabled.
What prerequisites are needed before starting YourMemory?
You need Python 3.11 through 3.14 and an email verification token obtained from yourmemoryai.xyz. Register it with yourmemory-register <your-token> before running yourmemory-setup.