Memory V2 MCP
Local-first long-term memory for AI agents: projects, branches and durable facts in one SQLite file. 10 MCP tools to search, restore dialog branches and save decisions. No cloud, no account.
Documentation
Memory v2.1
Local-first long-term memory for AI agents and long-running projects.
Memory v2.1 stores projects, conversation branches, messages and durable facts in a single SQLite database. It is built for people who want their agent memory to stay on their own machine: no cloud account, no vendor lock-in, no telemetry.
Status:
2.1.0-alpha.4. The core API, MCP server, web UI and offline installers are working and tested. Expect rough edges; back up your database.
Why
Long agent sessions get lost when a workspace is recreated, a model is switched, or a chat is closed. Memory v2.1 keeps the whole branch, not just a summary:
- one project can contain dozens of branches;
- a branch can be restored with one request;
- durable facts survive across sessions;
- full-text search covers both facts and messages;
- the database is a plain SQLite file you can copy and inspect.
Features
- Projects → branches → messages. One project, many conversations, shared logic and search.
- Durable memories. Facts, decisions, constraints and preferences with importance, confidence, status and supersede links.
- Message provenance. Every message keeps its original source fingerprint; edits create revisions instead of silently changing the archive. Soft-deleted messages stay recoverable and are excluded from search.
- Large branches. Paginated message loading, load-earlier, in-branch search and jump-to-message; role editing and edit history are built in.
- Full-text search. SQLite FTS5 plus Russian morphology (
pymorphy3); search memories and messages, optionally inside one project. - Idempotent archive. Re-sending the same branch appends only new messages; duplicates are skipped.
- Web UI. Projects, branches, messages, memory cards, search, triggers, settings and first-run onboarding. No Node.js build step.
- MCP server. Ten tools for Claude Desktop, Claude Code, Cursor, Cline, Continue, Windsurf, Zed and other MCP clients.
- Browser extension. Save selected text or the current page from
Chrome/Edge/Chromium and Firefox (experimental): context menu,
mem+ Tab, or the toolbar popup. - Offline installers. Windows and Linux packages with Python 3.12 and all wheels included. A visible status window/stage progress shows what is happening; no internet is needed during installation.
- Local-first. SQLite file, loopback-only by default, no cloud services.
- Backups and diagnostics. One-click SQLite backup API, JSON project export,
log rotation and
/diagnostics.
How it compares
Memory v2 is not a vector store and not an agent framework. It is a small, inspectable archive that an agent can query over MCP.
| Memory v2 | Hosted memory services (mem0, Zep Cloud) | Agent frameworks (Letta) | Markdown notes (basic-memory) | Plain files | |
|---|---|---|---|---|---|
| Data location | one SQLite file on your disk | vendor cloud | your server | Markdown files | anywhere |
| Account required | no | yes | no | no | no |
| MCP server | built in (7 tools) | usually separate | yes | yes | no |
| Editable history | revisions + soft delete | limited | limited | git | manual |
| Search | FTS5 + morphology | embeddings | embeddings | Markdown/grep | none |
| Works offline | yes, installers included | no | partial | no | yes |
| License | MIT | mixed | Apache-2.0 | MIT | — |
Details for the other projects change quickly — check their docs. The point here is the trade-off: hosted services give you convenience and sync, Memory v2 gives you a file you own, no account, and no network dependency.
Install
Where to get it
| Channel | Link |
|---|---|
| Offline installers (Windows, Linux) | Releases |
| MCP server package | memory-v2-mcp on PyPI — uvx memory-v2-mcp |
| Official MCP registry | io.github.DonParalon85/memory-v2 |
| Docker image (catalog PR in review) | Dockerfile.mcp, docker/mcp-registry#7997 |
| Docker Compose | docker compose up -d --build |
| From source | bash install/linux/install.sh |
Windows (recommended: offline installer)
- Download
MemoryV2-v2.1.0-alpha.2-Windows-x64.zipfrom Releases. - Extract it to any folder.
- Run
windows\install-memory.bat. - The app installs per user to
%LOCALAPPDATA%\MemoryV2, starts at logon and openshttp://127.0.0.1:8002/ui/.
No administrator rights and no internet connection are required. Windows may
show a SmartScreen warning because the installer is not code-signed yet.
Details: docs/installers.md.
Linux (recommended: offline installer)
- Download
MemoryV2-v2.1.0-alpha.2-Linux-x64.zipfrom Releases. - Extract it.
- Run:
bash linux/install.sh
The installer puts the app in ~/.local/share/memoryv2, creates a user systemd
service (or a nohup fallback), and starts it on
http://127.0.0.1:8002/ui/.
Python 3.12 is required. The installer can install it via the system package
manager if it is missing; the Python packages themselves are bundled offline
(cp312, x86_64).
Docker (from source)
cp .env.example .env
mkdir -p data
docker compose up -d --build
Open http://127.0.0.1:8002/ui/.
Manual native install (development)
python3.12 -m venv .venv
. .venv/bin/activate
pip install -r api/requirements.txt
pip install -r mcp/requirements.txt
cp .env.example .env
python api/init_db.py
python start_memory.py
See README-WINDOWS.md for the Windows native path.
First run
- The API listens on
127.0.0.1:8002by default. - If
MEMORY_API_TOKENis empty, only loopback clients are accepted. - The onboarding wizard offers language (RU/EN), an optional AI agent, and browser-extension installation.
- The demo seed is optional and fictional:
MEMORY_API=http://127.0.0.1:8002 python3 examples/seed_demo.py
Browser extension
The extension is included in both offline installers and in the app's first-run wizard. Standalone packages are attached to each release:
MemoryV2-v2.1.0-alpha.2-browser-extension.zip # Chrome/Edge/Chromium
MemoryV2-v2.1.0-alpha.2-firefox-extension.zip # Firefox
Chrome/Edge/Chromium:
- Open
chrome://extensions(Edge:edge://extensions). - Enable Developer mode.
- Choose Load unpacked and select the
memory-v2-extensionfolder. - Pin the icon and check the API URL in the extension settings.
Firefox (experimental):
- Unpack the Firefox ZIP.
- Open
about:debugging#/runtime/this-firefox. - Choose Load Temporary Add-on and select
manifest.json. - For a permanent install, submit the ZIP to
addons.mozilla.org(AMO); Firefox does not install unsigned XPI permanently. - If Firefox asks for access to
127.0.0.1:8002, allow it.
Usage:
- select text → right click → Memory v2.1 → project;
- type
mem, press Tab, thenпроект Home: textorsave this page to project Home; - click the toolbar icon for a popup with selection/page capture.
A search query typed into Google/Yandex goes to the search engine, not to Memory. Use the context menu,
mem+ Tab, or the popup instead. Firefox is experimental: use the separate Firefox ZIP; permanent install requires AMO signing.
See extension/README.md.
MCP
The MCP server lives in mcp/. It speaks stdio and uses the Memory HTTP API; it
never opens the SQLite file directly.
Published on PyPI as memory-v2-mcp:
uvx memory-v2-mcp # run without installing
pip install memory-v2-mcp # or install the console script
From the source tree:
python3.12 -m venv .venv-mcp
. .venv-mcp/bin/activate
pip install -r mcp/requirements.txt
python mcp/server.py
Tools:
| Tool | Purpose |
|---|---|
memory_health | Check API availability |
memory_list_projects | List projects |
memory_create_project | Create a project container |
memory_project_context | Restore a project and its branches |
memory_search | Search memories and messages |
memory_archive_conversation | Archive a branch idempotently |
memory_upsert | Store a fact, decision, constraint or preference |
memory_get | Read one memory by id |
memory_list_memories | List facts with filters |
memory_deprecate | Retire an old memory, optionally with a replacement |
Client configs (Claude Desktop, Claude Code, Cursor, Docker-only) are in
mcp/README.md and mcp/examples/.
API at a glance
GET /health
GET /projects
POST /projects
GET /projects/{id}/context
POST /conversations/archive
GET /memories/search?q=...&include_messages=true
POST /memories/upsert
POST /memories/{id}/deprecate
POST /capture
GET /settings
PUT /settings
POST /triggers/preview
POST /triggers/apply
GET /diagnostics
Interactive API reference: http://127.0.0.1:8002/docs.
Archive requests are idempotent; use a stable external_id:
{
"project_id": 1,
"title": "Demo / FastAPI async session debugging",
"source": "demo",
"external_id": "demo:fastapi:async-session:001",
"messages": [
{"role": "user", "content": "..."},
{"role": "assistant", "content": "..."}
]
}
Data model
| Table | Purpose |
|---|---|
projects | Shared project container |
conversations | A dialog branch |
messages | User/assistant messages |
memories | Durable facts, decisions, constraints, preferences |
events | Reserved for future timeline events |
settings | Language, AI agent, onboarding, triggers, extension status |
SQLite FTS5 indexes (memories_fts_norm, messages_fts) are kept in sync by
triggers. The schema is in migrations/schema.sql.
Configuration
| Variable | Default | Meaning |
|---|---|---|
MEMORY_DB | data/memory_v2.db | SQLite database path |
MEMORY_SCHEMA | migrations/schema.sql | Schema for first init |
MEMORY_HOST | 127.0.0.1 | Listen address |
MEMORY_PORT | 8002 | Listen port |
MEMORY_API_TOKEN | empty | Bearer token; empty means loopback-only |
MEMORY_TRUST_BRIDGE | empty | Set to 1 only for a loopback-published Docker port |
MEMORY_LANGUAGE | ru | Initial UI language (ru/en) |
MEMORY_LOG_DIR | logs | Log directory |
If you expose the API to a LAN, set MEMORY_API_TOKEN and use a reverse proxy
with HTTPS. Never expose an unauthenticated instance to the internet.
Development
python3.12 -m venv .venv
. .venv/bin/activate
pip install -r api/requirements.txt
pip install -r mcp/requirements.txt
sh scripts/ci_integration.sh
The integration script creates a clean database, starts the API on
127.0.0.1:8002, seeds the fictional demo project and runs the 13-check MCP
stdio test. The GitHub Actions workflow runs the same script on Python 3.12.
Repository layout:
api/ FastAPI application, auth, search, archive, capture, settings
mcp/ MCP stdio server, HTTP client, 13-check smoke test
web/ Static UI (HTML/CSS/JS, no build step)
extension/ Chrome/Edge MV3 extension
connectors/ OpenCode sync (Windows/Linux) and generic import
migrations/ SQLite schema and notes
install/ Docker/venv developer installers
scripts/ CI, backup, search and health helpers
docs/ Architecture, testing, integrations, installers
examples/ Fictional demo seed
Backup
The database is the source of truth. Use the SQLite backup API while the API is running, or copy the file while it is stopped.
python3 - <<'PY'
import sqlite3
src = sqlite3.connect("data/memory_v2.db")
dst = sqlite3.connect("data/backup.db")
src.backup(dst)
dst.close()
src.close()
PY
Security
- Loopback-only by default; empty token means non-local clients get
401. - Optional bearer token for LAN/reverse-proxy deployments.
- Connectors redact common token patterns before archiving, but this is not a guarantee. Do not put secrets into prompts or conversation text.
- Keep backups and restrict file permissions.
Roadmap
- Projects, branches, messages, durable memories.
- FTS5 + Russian morphology.
- Idempotent archive.
- Web UI with manual CRUD, triggers, settings and onboarding.
- MCP server for agent integrations.
- Chrome/Edge extension.
- Offline Windows and Linux installers.
- Firefox extension (experimental; temporary load or AMO signing).
- Importers for ChatGPT/Claude/Markdown exports.
- Alembic migrations and schema version history.
- Code-signed native Windows
.exe(the current installer is unsigned).
License
MIT. See LICENSE. The license can be switched to Apache-2.0 before
a stable release.