Local Memory — Claude Code MCP server: persistent local recall
Your assistant starts each chat with context from earlier ones. Everything lives in one SQLite file on your disk, with no cloud and no API keys.
claude mcp add --env MEMORY_DB_PATH=<MEMORY_DB_PATH> --env MEMORY_EMBED_DISABLED=<MEMORY_EMBED_DISABLED> --env MEMORY_EMBED_MODEL=<MEMORY_EMBED_MODEL> --env MEMORY_EMBED_CACHE_DIR=<MEMORY_EMBED_CACHE_DIR> --transport stdio local-memory -- npx -y @studiomeyer/local-memory-mcpWhat Local Memory does
On session start the server pulls context from previous conversations, so the model picks up where you left off. While you work it can log findings through memory_learn and record facts about people, projects and tools through memory_entity_observe, which grows a knowledge graph over time. Making that automatic takes one line in CLAUDE.md or a SessionStart hook in ~/.claude/settings.json that triggers memory_session_start.
Searches through memory_search default to hybrid mode: BM25 ranking from FTS5 is merged with vector cosine scores using Reciprocal Rank Fusion. Vectors come from the Xenova/multilingual-e5-small model running through Transformers.js on CPU, q8-quantized, with roughly 30 MB of cache. A query for “send” can surface “publish”, and the languages of query and notes need not match. Should the vector extension fail to load, search drops back to FTS5 alone without an error.
Node.js is a prerequisite: npx fetches the @studiomeyer/local-memory-mcp package. Mind the scoped name. A separate project ships as local-memory-releases under the same descriptive title, and installing that one gets you different software.
What it helps with
- recover context from an earlier session without retelling it
- find a note by meaning rather than an exact word
- keep facts about people and projects across chats
- avoid storing the same finding twice
- keep assistant memory in a local file instead of a cloud service
Example prompts for the agent
- Call
memory_session_startand tell me what we were working on last time. - Search
memory_searchfor everything we decided about deployment. - Record through
memory_entity_observethat this project runs on Postgres.
How to install Local Memory
Platform CLI
claude mcp add --env MEMORY_DB_PATH=<MEMORY_DB_PATH> --env MEMORY_EMBED_DISABLED=<MEMORY_EMBED_DISABLED> --env MEMORY_EMBED_MODEL=<MEMORY_EMBED_MODEL> --env MEMORY_EMBED_CACHE_DIR=<MEMORY_EMBED_CACHE_DIR> --transport stdio local-memory -- npx -y @studiomeyer/local-memory-mcpReplace <…> with your own values
Platform CLI
codex mcp add local-memory --env MEMORY_DB_PATH=<MEMORY_DB_PATH> --env MEMORY_EMBED_DISABLED=<MEMORY_EMBED_DISABLED> --env MEMORY_EMBED_MODEL=<MEMORY_EMBED_MODEL> --env MEMORY_EMBED_CACHE_DIR=<MEMORY_EMBED_CACHE_DIR> -- npx -y @studiomeyer/local-memory-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"local-memory": {
"command": "npx",
"args": [
"-y",
"@studiomeyer/local-memory-mcp"
],
"env": {
"MEMORY_DB_PATH": "<MEMORY_DB_PATH>",
"MEMORY_EMBED_DISABLED": "<MEMORY_EMBED_DISABLED>",
"MEMORY_EMBED_MODEL": "<MEMORY_EMBED_MODEL>",
"MEMORY_EMBED_CACHE_DIR": "<MEMORY_EMBED_CACHE_DIR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"local-memory": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@studiomeyer/local-memory-mcp"
],
"env": {
"MEMORY_DB_PATH": "<MEMORY_DB_PATH>",
"MEMORY_EMBED_DISABLED": "<MEMORY_EMBED_DISABLED>",
"MEMORY_EMBED_MODEL": "<MEMORY_EMBED_MODEL>",
"MEMORY_EMBED_CACHE_DIR": "<MEMORY_EMBED_CACHE_DIR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MEMORY_DB_PATH=<MEMORY_DB_PATH> -e MEMORY_EMBED_DISABLED=<MEMORY_EMBED_DISABLED> -e MEMORY_EMBED_MODEL=<MEMORY_EMBED_MODEL> -e MEMORY_EMBED_CACHE_DIR=<MEMORY_EMBED_CACHE_DIR> local-memory npx -y @studiomeyer/local-memory-mcpReplace <…> with your own values
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 Local Memory
How do I install Local Memory in Claude Code?
Run claude mcp add local-memory-mcp -- npx -y @studiomeyer/local-memory-mcp. A second variant adds --env flags and --transport stdio if you want to set environment variables yourself.
What does Local Memory do?
It gives the assistant durable memory backed by a local SQLite file: stored findings, decisions and entities, keyword plus semantic search, and a knowledge graph. Nothing leaves your machine.
Does it need API keys or a network connection?
No. Embeddings are computed by a local model on CPU, and no outside service is involved. The model is fetched into the cache on the first embed call.