mem0-lite
Self-hosted MCP memory server for coding agents: store, search, retrieve, update, and delete persistent memories locally via Qdrant, plus optional feedback rating.
add_memory: store explicit facts with optional inference, memory type, user/agent scope, and metadata; avoids secrets and tool dumps.search_memories: semantic search with rewritten keyword queries, configurable top_k, and scope/memory-type filters.get_memory_by_id: fetch a single memory by ID.list_memories: list memories in the current scope.update_memory: replace memory text in place when a fact changes.delete_memory: delete one memory by ID.delete_all_memories: delete all memories in scope, requiring confirmation.rate_memory_call: rate prior retrieval calls when feedback mode is enabled (used,miss,noise, etc.).Local data, logs, and coordination under
~/.mem0with no Docker, REST daemon, or external platform required.
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., "@mem0-lite search for anything i know about the project's authentication flow"
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.
mem0-lite
Self-hosted memory for coding agents via MCP. No Docker. No Mem0 Platform. No REST daemon.
The MCP wraps mem0ai Memory(), with vectors on disk under ~/.mem0/qdrant. Tool calls stay in-process. The sidecar keeps Qdrant open; a second MCP on the same dir yields via lite.lock / lite.want — no extra daemon.
Why this exists
Official Mem0 gives you three things that do not compose for a local MCP setup:
Official path | Problem here |
Platform MCP ( | Memory leaves your machine, costs money. |
OSS REST server | Docker + Postgres; Heavy, hard to maintain, kills battery on non-Linux machines. |
| Client only, does not include server |
mem0-lite is a liteweight local Python app that exposes the OSS mem0 library as an MCP service.
Related MCP server: int
What you get
MCP tools —
add_memory,search_memories,get_memory_by_id,list_memories,update_memory,delete_memory,delete_all_memories(how to call them is in the tool docs)Local store — Qdrant on disk (
on_disk=True), not/tmp, with concurrency coordinationWhen to use them — thin AGENTS.md pointer
MCP registration — uv launch snippet
What it stores
vector db, history, config, access log, lite.lock, and lite.want in ~/.mem0
Install
Requires Python 3.11+, OPENAI_API_KEY (or Ollama — see architecture), and just for the recipes below. just setup installs uv if it is missing.
Clone this repo.
just setup— installs uv when needed,uv sync --group dev, and symlinks bundled plugins into~/.mem0/plugins/.Register the MCP server with your host (snippet below). Set
OPENAI_API_KEYin the host config or your environment; do not commit it.Paste the AGENTS.md pointer.
Common commands:
just setup # install uv if needed, uv sync, link plugins into ~/.mem0/plugins
just test # pytest
just run # mem0-lite mcp (stdio)
just wipe # delete ~/.mem0 or $MEM0_DIR — stop MCP hosts firstEnv
The MCP reads these from the process environment. If a variable is set in your system environment and the MCP is not running in a sandbox, the host passes it through — you do not need to duplicate it in the host's env block. Values in that env block override the system environment.
OPENAI_API_KEY— required unless using Ollama (see below)MEM0_DIR— data directory (default~/.mem0)MEM0_LITE_USER_ID— default user scope (default$USER)MEM0_LITE_AGENT_ID— optional agent scopeMEM0_LITE_LOCK_TIMEOUT— store lock wait in seconds (default30)MEM0_LITE_LLM_PROVIDER— e.g.ollama(default: OpenAI via mem0ai)MEM0_LITE_LLM_MODEL— LLM model name (defaultllama3.2with Ollama)MEM0_LITE_EMBEDDER_PROVIDER— e.g.openaiorollamaMEM0_LITE_EMBEDDER_MODEL— embedder model (defaultnomic-embed-textwith Ollama)MEM0_LITE_PLUGINS_DISABLE— comma-separated plugin names to skip (e.g.git)MEM0_LITE_GIT_ROOTS— pathsep-separated allowlist for git toplevelsMEM0_LITE_GIT_FETCH/MEM0_LITE_GIT_GH/MEM0_LITE_GIT_PROMOTE— background git (all default off)
Full defaults: architecture. Opt-in rating: Feedback mode (MEM0_LITE_FEEDBACK_MODE, default off).
Plugins: source in repo plugins/<name>/ (entry: plugin.py or __init__.py). Runtime loads only from $MEM0_DIR/plugins/<name>/ (default ~/.mem0/plugins/). just setup symlinks bundled plugins there. That is code in the MCP process (D12). Not loaded from the agent workspace.
MCP registration
Merge into your MCP host's config. Cursor: ~/.cursor/mcp.json or project .cursor/mcp.json. Replace the directory path.
{
"mcpServers": {
"mem0-lite": {
"command": "uv",
"args": ["run", "--directory", "/ABS/PATH/TO/mem0-lite", "mem0-lite", "mcp"],
"env": { "OPENAI_API_KEY": "sk-..." }
}
}
}AGENTS.md
Paste into AGENTS.md (or user rules). How to call tools is in the MCP schemas. This is when.
## Memory
MCP `mem0-lite` is registered. Search at task start, context switch, or when the user references past work. Pass `cwd` when in a checkout (or `project` / `workstream` if already known). Include `memory_type: environmental` when the work will run local tools. After the reply, write only if a new agent would benefit in days/weeks (future utility, novelty, factual, no secrets). Do not announce recall, misses, or “memories didn’t help” — just continue. Prefer `update_memory`. Most turns write nothing. After a missing binary, wrong version, or version-manager PATH hole, write one standing `environmental` fact (how to invoke the tool, not a shell dump). Pass `cwd` so it stamps this repo.Metrics
Every tool call appends one line to ~/.mem0/access-log.jsonl (tool, agent, connection reuse, lock wait, duration, store_count). Search and list also stamp scope_count (memories matching that call's filters). Query logs without opening Qdrant:
uv run mem0-lite log report # access + feedback summary (JSON)
uv run mem0-lite log getByTs <ts> # access + feedback + debug rows for one ts
uv run mem0-lite log getColumn <column> # CSV of one field across all logsgetByTs follows ts / call_ts links, so a feedback rating timestamp still returns the original tool call. getColumn takes a top-level key or dotted path (tool, params.query, request.filters.project) and walks access, then feedback, then debug.
The report includes last/min/max store_count and feedback sliced by size at call time (0, 1-10, 11-50, 51+). Early empty_ok / miss at bucket 0 is expected; watch used vs noise as the corpus grows.
Feedback mode
Tracks effectiveness of the memory store.
When on, tool responses include a ts field, which can be used to rate a response using the rate_memory_call tool.
When on (MEM0_LITE_FEEDBACK_MODE=1):
Retrieval responses include
tsAgents can call
rate_memory_call(call_ts, helpful, reason)after a useful hit, a miss, or noiseRatings append to
~/.mem0/feedback.jsonlmem0-lite log reportjoins ratings to access-logtsand reports coverage, helpful rate, feedback latency (ts − call_ts), and helpful/reason rates by store size at the call
Enable in the MCP host env block (do not put this in the default registration snippet):
"env": {
"MEM0_LITE_FEEDBACK_MODE": "1"
}If you enable it, add this to AGENTS.md.
After a retrieval call, if you used a hit, clearly missed a fact, or got noise, call rate_memory_call with that response's ts.reason is one of: used | empty_ok | miss | noise | stale | bad_query. Skip empty-and-expected results.
Docs
Page | Contents |
Process model, tools, data layout | |
Platform, Docker REST, SDK-in-process, this repo | |
Files, SQLite, vector DBs, hosted memory | |
Why MCP, why | |
Keys in git, | |
|
Not this repo
A second Mem0 server implementation
A Platform-compatible HTTP API
A replacement for
mem0-cliGraph memory (Platform-only in practice)
This repo is MIT. mem0ai remains Apache-2.0. This wrapper is yours to keep local.
Available Tools
8 toolsadd_memoryA
Store a memory. Prefer infer=false with a self-contained third-person fact.
memory_type: decision | convention | anti_pattern | user_preference | task_learning | environmental | identity | rule | project
infer=true lets mem0 extract facts from raw conversation; skip for explicit facts.
Never store secrets. Skip small talk, tool dumps, and one-shot commands.
Inputs: text (required), infer, user_id, agent_id, +2 more. Returns: result
delete_all_memoriesC
Delete all memories in scope. Requires confirm=true.
Inputs: confirm, user_id, agent_id. Returns: result
delete_memoryC
Delete one memory by id.
Inputs: memory_id (required). Returns: result
get_memory_by_idA
Fetch one memory by id. When MEM0_LITE_FEEDBACK_MODE is enabled, rate via rate_memory_call(call_ts).
Inputs: memory_id (required). Returns: result
list_memoriesC
List memories in scope. Not a substitute for search_memories. When MEM0_LITE_FEEDBACK_MODE is enabled, responses include ts; rate useful/miss/noise via rate_memory_call.
Inputs: top_k, user_id, agent_id, memory_type. Returns: result
rate_memory_callA
Rate a prior retrieval by call_ts (from response ts when MEM0_LITE_FEEDBACK_MODE is enabled).
Call when you used a hit, clearly missed a fact, or got irrelevant noise. Skip empty-and-expected results.
reason: used | empty_ok | miss | noise | stale | bad_query
Inputs: reason (required), call_ts (required), helpful (required), note. Returns: result
search_memoriesA
Semantic search. Rewrite the query to 3-6 keywords matching stored third-person facts.
Do not pass the user's raw message. Drop pronouns and question words.
When useful, run 2-4 parallel searches with memory_type: decision, convention, anti_pattern, or omit for catch-all.
When MEM0_LITE_FEEDBACK_MODE is enabled, responses include ts; rate useful/miss/noise via rate_memory_call.
Inputs: query (required), top_k, user_id, agent_id, +1 more. Returns: result
update_memoryA
Replace memory text in place. Prefer this over delete+add when a fact changed.
Inputs: text (required), memory_id (required). Returns: result
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 has a clearly distinct purpose: add, update, search, get by ID, list, delete single, delete all, and rate. Potential confusion between search_memories and list_memories is addressed in descriptions, ensuring no ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., update_memory, search_memories, delete_all_memories). The naming is predictable and uniform across the set.
With 8 tools, the server is well-scoped for a memory management system. The count covers essential operations without being excessive or insufficient.
The tool surface provides complete coverage for memory CRUD (add, get, update, delete) plus search, listing, bulk deletion, and a feedback rating mechanism. No obvious gaps for the declared purpose.
Maintenance
Related MCP Connectors
Hosted MCP memory for coding agents: persistent across sessions, editable markdown, team sharing.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides persistent memory for AI coding agents via MCP, enabling agents to store and semantically recall facts, events, and lessons across sessions, all running locally without cloud dependencies.Apache 2.0
- FlicenseNot gradedqualityCmaintenanceSelf-hosted AI memory system for coding assistants, providing project-scoped memory storage and retrieval via MCP tools (add, search, list, delete) to recall prior learnings without re-running discovery.1-
- AlicenseNot gradedqualityBmaintenanceProvides persistent memory for AI coding agents, enabling them to save, search (hybrid vector/BM25/concept graph), list sessions, and forget memories via MCP tools.11 npmApache 2.0
- FlicenseNot gradedqualityAmaintenanceProvides local-first, cross-session persistent memory that lets AI coding agents store, semantically search, and recall project-specific and cross-project knowledge via MCP tools and resources, with an optional task queue for autonomous execution.-