localmem-mcp
Enables Amazon Q to store facts, decisions, and preferences in a local memory store and later find or recall them with semantic search.
Enables the Amp coding agent to store facts, decisions, and preferences in a local memory store and later find or recall them with semantic search.
Enables JetBrains IDEs to store facts, decisions, and preferences in a local memory store and later find or recall them with semantic search.
Enables Warp to store facts, decisions, and preferences in a local memory store and later find or recall them with semantic search.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@localmem-mcp Remember that we chose SQLite over Postgres for this project because it ships in a single file."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Just SQLite and local embeddings.
Quickstart (30 seconds)
1. Add it to your MCP client. No install step — uvx fetches and runs it:
// Claude Desktop: claude_desktop_config.json
// Cursor: .cursor/mcp.json
// Claude Code: claude mcp add localmem -- uvx localmem-mcp
{
"mcpServers": {
"localmem": {
"command": "uvx",
"args": ["localmem-mcp"]
}
}
}2. Restart the client and talk to it:
"Remember that we chose SQLite over Postgres for this project because it ships in a single file."
…then, in a completely new session tomorrow:
"What database did we pick, and why?"
That's it. Your agent now remembers, and nothing left your laptop.
pip install localmem-mcp # then use "command": "localmem-mcp" in the config aboveThe config above covers most clients, but several agents want a different shape —
and get it wrong silently. VS Code's root key is servers; Codex uses TOML;
OpenCode and Kilo Code take command as an array; Goose calls them extensions;
Zed nests them under context_servers.
Integrations → has the verified config for 20+ agents: Claude Code, Codex, Gemini CLI, Copilot CLI, Goose, OpenCode, Crush, Amp, Amazon Q, Qwen Code, Junie, Antigravity, Warp, Cursor, Windsurf, Zed, VS Code, JetBrains, Trae, Cline, Roo Code, Kilo Code, Continue, and Claude Desktop.
Related MCP server: ClawMem MCP Server
The three tools
Tool | What the agent uses it for |
| Save a durable fact, decision, or preference — with optional tags. |
| Find memories by meaning, not keywords. "which database?" finds "we went with SQLite". |
| Re-read a specific memory by id, or catch up on the most recent ones. |
Plus memory_stats for where the database lives and how much is in it.
Also a Python library
The MCP server is a thin shell over a store you can import directly:
from localmem_mcp import MemoryStore
store = MemoryStore() # ~/.localmem/memories.db
store.add("We chose SQLite over Postgres", tags=["decision", "architecture"])
for hit in store.search("what database are we using?"):
print(hit.score, hit.memory.content)And a CLI, for when you just want to look:
localmem-mcp add "Deploys go out on Thursdays" --tag ops
localmem-mcp search "when do we ship?"
localmem-mcp recall -n 5
localmem-mcp stats
localmem-mcp export > memories.jsonl # take your memories elsewhere
localmem-mcp import memories.jsonlPrivacy
Nothing is sent anywhere. Memories live in one SQLite file you own, and
embeddings are computed on-device with fastembed.
The only network request the package ever makes is the one-time download of the
embedding model (~90 MB, from Hugging Face) on first use — after that it works
fully offline. Delete ~/.localmem/memories.db and the memory is gone.
Why localmem-mcp
The privacy pitch is the headline, but the cost story matters just as much:
recall never calls an LLM. search_memory is local cosine similarity plus an
FTS5 keyword bonus, both computed on-device — no tokens spent, no round trip,
no per-call bill, whether you store ten memories or ten thousand. Most memory
tools in this space run an LLM on the way in and the way out; localmem-mcp
only ever runs the embedding model, locally, and only on the way in.
localmem-mcp | OpenMemory MCP (Mem0) | mem0-mcp-server | Zep / Graphiti | |
Cloud calls | Zero, ever, after the one-time model download | Yes — LLM call to extract facts | Yes — hosted Mem0 platform | Yes — LLM call to build/update the graph |
API key required | None |
|
| An LLM provider key |
LLM on the recall path | No — cosine similarity + FTS5, both local | Yes — LLM involved in storing and recalling | Yes — hosted LLM involved in storing and recalling | Yes — LLM traverses/summarizes the graph |
Install footprint |
| Docker Compose stack (API + vector DB) | Package + a hosted Mem0 account | Self-hosted graph DB + LLM, or hosted Zep Cloud |
Datastore | One SQLite file | Qdrant (vector DB) + a history DB | Mem0's hosted store | Neo4j / FalkorDB (graph DB) |
Based on each project's own setup docs as of August 2026 — verify against their READMEs before deciding, since requirements like these change fast. None of this makes the others wrong: a temporal knowledge graph or LLM-extracted facts are real capabilities localmem-mcp doesn't have. The trade is deliberate — this project stays a SQLite file and an embedding model, on purpose, rather than growing into an agent framework or a hosted service. See ROADMAP.md for where the line is drawn.
Architecture
MCP client (Claude Code, Cursor, Claude Desktop, OpenClaw…)
│ stdio / JSON-RPC
▼
server.py FastMCP — store_memory · search_memory · recall_memory
▼
store.py MemoryStore
├── SQLite memories table + FTS5 index (durable, single file)
└── fastembed ONNX embeddings, lazy-loaded (on-device, 384-dim)Search is hybrid: every memory is scored by cosine similarity against the
query embedding, and memories that also hit the FTS5 keyword index get a bounded
bonus — so paraphrases are found and exact terms like error codes or names
aren't lost. Embeddings are stored as float32 blobs alongside the text, so a
memory is one row and there is no second datastore to keep in sync.
The model loads lazily on the first store/search call, which keeps server startup near-instant for clients that spawn it eagerly.
Configuration
Environment variable | Default | Purpose |
|
| Full path to the SQLite file. |
|
| Directory used when |
|
| Any model name supported by fastembed. |
Point separate projects at separate databases with --db or LOCALMEM_DB_PATH.
Star History
Contributing
Issues and PRs are welcome, and the project is deliberately small enough to read
in one sitting — store.py is the whole thing, and everything else is a shell
over it.
git clone https://github.com/OpenAgentHQ/localmem-mcp && cd localmem-mcp
python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest -q # offline, about a secondCONTRIBUTING.md covers the layout, the testing approach, and what does and doesn't fit the project. Good first issues are scoped to be approachable without deep context.
Security policy — report vulnerabilities privately, please
License
Available Tools
8 toolsforget_memoriesA
Permanently delete memories by tag and/or age.
Use this to prune stale facts en masse — drop every memory tagged "scratch", or everything older than 90 days. At least one filter is required; an unfiltered call is rejected so the store can't be wiped by accident. Deletion is hard: matching rows are gone, not hidden.
Inputs: tags, older_than_days. Returns: object
forget_memoryA
Permanently delete one memory by id.
Use this when a stored memory is wrong beyond correction, sensitive, or simply no longer wanted — prune it so stale facts stop outranking current ones. To fix a memory instead of deleting it, use update_memory. The delete is hard: the row is gone, not hidden.
Inputs: memory_id (required). Returns: object
list_memoriesA
Enumerate memories with tag filtering, ordering, and pagination.
Use this to browse stored memories without requiring a search query — to audit memories, paginate through tag categories, or view memories in chronological or reverse-chronological order.
Filtering and ordering only — no embedding model or scoring is used.
Inputs: tags, limit, order, offset. Returns: object
memory_statsA
Report where memories are stored, how many there are, and which model is used.
Inputs: no named parameters. Returns: object
recall_memoryA
Re-read a specific memory by id, or the most recent memories.
Use this when you already know which memory you want (from a previous store_memory or search_memory call), or to catch up on what was recorded most recently. To find memories by meaning, use search_memory instead.
Inputs: limit, memory_id. Returns: object
search_memoryA
Find memories by meaning.
Semantic search over everything stored, so "what database did we pick?" finds a memory that says "we went with SQLite". Results are ranked by similarity, highest first.
To page through more matches, keep the same query and advance offset by
limit — ranking is stable, so pages don't overlap or skip. An offset past
the last match returns no results.
Inputs: query (required), tags, limit, offset, +1 more. Returns: object
store_memoryA
Save something worth remembering across sessions.
Store durable facts, decisions, preferences, and project context — not transient chatter. The text is embedded locally so it can be found later by meaning, not just exact words.
Inputs: content (required), tags, source. Returns: object
update_memoryA
Correct an existing memory in place.
Use this when a stored memory is wrong — a misremembered decision, a misspelled name, a fact that has since changed. It edits the original record rather than adding a related one, and re-embeds the text so search finds the correction. Only the fields you pass are changed.
Inputs: memory_id (required), tags, source, content. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct operation (store, search, recall by id, list, update, delete, bulk delete, stats), and descriptions clearly separate search from recall and list. The only mild overlap is recall_memory's 'most recent memories' versus list_memories in chronological order, but the descriptions give enough guidance to choose correctly.
Most tools follow a consistent verb_noun pattern (store_memory, search_memory, update_memory, forget_memory), and all names are lowercase snake_case. memory_stats breaks the pattern by using a noun_noun form rather than a verb like get_stats, and singular/plural alternates between memory and memories.
Eight tools is well-scoped for a memory store: create, read (three retrieval modes), update, delete (single and bulk), and stats. Each tool earns its place without redundancy or bloat.
The surface covers the full memory lifecycle: store, retrieve by meaning/id/browse, update, delete, bulk prune, and inspect storage. There are no obvious dead ends; even bulk deletion is safely gated by requiring a filter.
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Related MCP Servers
- AlicenseAqualityCmaintenanceLocal-first memory for AI agents. On-device hybrid retrieval over a single SQLite file.164Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to maintain persistent, local memory with retrieval-augmented search, knowledge graphs, and context surfacing, without any cloud dependencies.416 npmMIT
- AlicenseNot gradedqualityBmaintenanceGives AI agents a private, on-device persistent memory using semantic search over stored facts, preferences, and decisions. It enables agents to remember information, recall it by meaning even without keyword overlap, delete memories, and list them by tag.12 npm4MIT

memiofficial
AlicenseNot gradedqualityBmaintenanceGives AI agents a local-first, persistent memory backed by a single SQLite file, letting them save decisions, preferences, and facts, then recall them by meaning or keyword across sessions and projects. Exposes tools for loading pinned context, searching, adding, updating, listing, and deleting memories, so agents stop forgetting between sessions.14 npm1Apache 2.0