• Open source
  • Apache 2.0
  • Self-hosted

Memory for AI agents

One self-hosted service that keeps what your agents learn and finds it again by meaning, over MCP, REST, OAuth or the CLI.

Python 3.11 or newer. The sqlite extra adds the local embedding model for semantic search.

recallexample data
>why did we stop using the global sync lock?
  1. 0.91

    Dropped the global sync lock: the HTTP server is the only sync owner, the MCP server talks to SQLite directly.

    decision · hybrid · 3 weeks ago

  2. 0.84

    Delta-sync deadlocked on empty-content events; skip and log instead of retrying forever.

    fix · sync · 5 weeks ago

  3. 0.67

    WAL mode is required, otherwise two servers on one file give "database is locked".

    config · sqlite · 2 months ago

local reads on SQLite-vec, approx.
5 ms
LongMemEval R@5, session mode, no LLM calls
86%
tests
6,831
AI apps supported
25+

What it is

MCP Memory Service is an open-source server that gives AI agents a memory that outlives the session. Agents and assistants forget everything when a conversation ends; this service stores what they learned on your own machine or server and hands it back when it is relevant. It is built for developers who work with coding agents, and for teams that run several agents on shared knowledge.

  1. Persistent memory

    A client stores a decision, a fix or a preference as a memory with tags and a type. It stays in a database you control: SQLite-vec on disk by default, Cloudflare, a hybrid of both, or Milvus.

  2. Semantic search

    By default each memory is embedded by a local ONNX model, so a later question finds it by meaning even when the wording differs. Hybrid search adds BM25 keyword matching to the vector results; tags and time ranges narrow them.

  3. Knowledge graph

    Memories are linked by typed relationships such as causes, fixes, contradicts and supports. Scheduled consolidation lets stale entries decay and compresses related ones.

Every memory is a node, every relationship an edge. Recall works by meaning, not keywords.
See it in 50 seconds: store, retrieve, link and consolidate. Narrated with a local text-to-speech model.

What's new in v12.9

The ontology overlay gets a REST API, a dashboard section and sync between nodes, and two access-scope leaks are closed.

  • Ontology

    REST API and dashboard section

    GET /api/ontology returns the merged memory types, relationships, type patterns and retention periods. Writes go through the same validated storage methods and need the global write scope.

  • Sync

    The ontology overlay syncs through the hub

    Overlay writes become sync events that peers resolve per key. A peer that does not advertise ontology_sync keeps syncing memories without stalling.

  • Security

    MCP prompts and server status respect scope

    prompts/get now requires a global read scope, and /api/server/status returns process, OS and Python details to admin callers only.

  • Dashboard

    Tag management minimum-use filter

    Tag management hides tags used fewer than twice by default, with an adjustable threshold. The disabled System Maintenance placeholders are gone.

  • Search

    Recall ranges keep both ends

    "From January to March" now parses as the whole window instead of keeping only the start.

Full release notes for v12.9.0

One service, three ways in

Agents on your machine talk to it over stdio, frameworks over REST, and browser chat apps over Remote MCP with OAuth 2.1.

Terminal and IDE agentsClaude Code, Codex CLI, Cursor, OpenCode
Local MCPstdio, on your machine
Agent frameworksLangGraph, CrewAI, AutoGen, any HTTP client
REST APIHTTP with API key or OAuth
Browser chatclaude.ai, ChatGPT (Developer Mode)
Remote MCPStreamable HTTP, OAuth 2.1 + PKCE
Memory service Search by meaning, knowledge graph, consolidation SQLite-vec, Cloudflare or Hybrid storage

The underlined lane is the one that crosses the network with OAuth. Local MCP is a process on your machine, with no network hop.

In the wild

Three deployments people built and run themselves.

"After I work with one of the cluster agents on something I want my local agent to know about, the cluster agent adds a special tag to the memory entry that my local agent recognizes as a message from a cluster agent. So they end up using it as a comms bridge, and it's pretty delightful."
@jeremykoerber

A five-agent cluster uses one memory service as shared state and as an inter-agent channel, with no custom protocol: cluster agents write a sentinel tag, the local agent filters on it. The pattern

"File-based memory demands constant discipline. Semantic recall from a live database doesn't. Storing data on my own hardware while making it remotely accessible across platforms turned out to be a feature I didn't know I needed."
@PL-Peter

Two Docker containers on one SQLite backend, a Cloudflare tunnel for name-based routing, and an auth gateway in front. The checklist

"Claude Code, Claude Desktop, Codex CLI and OpenCode all talk to the same sqlite-vec DB over stdio on my Mac. ~5,900 memories and counting. It's the closest thing to persistent identity my agents have."
Mingjian Shao, AI PM and consultant, September 2026

One local sqlite-vec database shared by four agents: no server, no cloud, offline embeddings, daily backups and scheduled consolidation.

How it compares

Against the commercial memory APIs and the MCP-native alternatives.

Commercial memory APIs

mcp-memory-service compared with Mem0, Zep and a self-built Redis and Pinecone stack
mcp-memory-serviceMem0ZepDIY Redis+Pinecone
LicenseApache 2.0ProprietaryEnterprise—
CostNo license fee, your own hostingPer-call APIEnterpriseInfra costs
claude.ai browserRemote MCPDesktop onlyDesktop onlyNo
OAuth 2.1 + DCRYesUnknownUnknownNo
Streamable HTTPYes (SSE too)NoNoNo
Framework integrationREST, any HTTP clientSDKSDKManual
Knowledge graphYes, typed edgesNoLimitedNo
Auto consolidationYes, decay + compressionNoNoNo
On-premise embeddingsYes, ONNX localNoNoManual
Data locationYour machine by defaultCloudCloudPartial
Hybrid searchYes, BM25 + vectorNoYesManual
MCP protocolYesNoNoNo

MCP-native: MemPalace

mcp-memory-service compared with MemPalace
mcp-memory-serviceMemPalace
LongMemEval R@5 (raw ChromaDB, zero LLM)86.0% session / 80.4% turn96.6%1
LongMemEval R@5 (with reranking)—100%2
Storage granularityTurn-level and session-levelSession-level
Team / multi-device syncCloudflare syncLocal only
REST API / web dashboardYesNo
OAuth 2.1 + multi-userYesNo
Knowledge graphYes, typed edgesNo
Auto consolidationYes, decay + compressionNo
LicenseApache 2.0MIT

Why the benchmark gap? MemPalace stores whole sessions as single units, and LongMemEval asks which session contains the answer, so that granularity answers the question structurally. This service defaults to turn-level storage for finer retrieval; session-mode ingestion brings it to 86.0% R@5.
1 Measured in MemPalace "raw mode": plain text in ChromaDB with default embeddings. Per Issue #27, the Palace structural features are bypassed in that configuration, and the maintainers acknowledged most of the review's points.
2 Uses optional LLM reranking (~500 API calls) on a partially tuned test set. Clean held-out score as reported by the maintainers: 98.4% R@5.
Full numbers and the run commands: docs/BENCHMARKS.md

SHODH ecosystem

Fully compatible with the SHODH Unified Memory API Specification: every SHODH implementation shares the same memory schema (emotional metadata, episodic memory, source tracking, quality scoring), so memories export and import across implementations with full fidelity. The reference implementation is shodh-memory (RocksDB); shodh-cloudflare runs on Workers + Vectorize; this service runs SQLite-vec or Hybrid.

In the media

Talks and coverage from the community.

  • Heavybit, Humans in the Loop
    Agents Overdrawn at the Memory Bank

    A deep dive with maintainer Heinrich Krupp on agent amnesia and why persistent memory is the missing infrastructure layer for agentic systems.

  • AI Tinkerers Zürich
    Talk by Heinrich Krupp · full video

    Persistent memory architecture, semantic search, and multi-agent memory sharing.

  • LinkedIn, Dr. Álvaro Cintas
    Solving session amnesia

    How mcp-memory-service gives Claude Code, Cursor and OpenCode a shared memory over MCP, with on-device ONNX embeddings and no external API calls.

"Your project has inspired me in many ways. In my view, it's the best implementation of MCP memory I've found so far." — Michał Zubkowicz

Questions

What it stores, where the data lives, and where the limits are.

Does it save every conversation automatically?

No. Connecting the service over MCP gives your client tools to store and recall memories; the client has to call them. Optional hooks for Claude Code and a session import have their own setup.

Where is my data stored?

With the default SQLite-vec backend, memories and their embeddings live in a database file on the machine that runs the service, and embeddings are computed there. The embedding model is downloaded once on first start. Cloudflare storage, hybrid sync and Milvus are optional backends you configure yourself. What your AI client sends to its own model provider is up to that client.

Which clients and frameworks work with it?

Any MCP client over stdio, such as Claude Code, Claude Desktop, Codex CLI, Cursor, OpenCode, Gemini CLI, VS Code, Windsurf and Zed. Browser chat apps such as claude.ai and ChatGPT (Developer Mode) connect over Remote MCP with OAuth 2.1. Frameworks such as LangGraph, CrewAI and AutoGen use the REST API. The integrations list has the details.

How do I install and run it?

Install with pip install "mcp-memory-service[sqlite]" on Python 3.11 or newer, then add it to your client, for example claude mcp add memory -- memory server for Claude Code. The same package runs the HTTP server with the REST API, the dashboard and Remote MCP. The setup guide walks through it.

Is it free?

The software is open source under Apache 2.0 and has no license fee. You run it yourself, so hosting, your AI client's subscription or API usage, and any optional external service such as Cloudflare are your own costs.

What are the limits?

It is a memory store, not a model: it does not answer questions, it returns the memories that match. Search quality depends on the embedding model, and changing its dimensions means re-embedding every memory. External embedding APIs are supported on the SQLite-vec backend only.

Get started in seconds

Install from PyPI and connect your agents to persistent memory.

Deploying for a team?I help teams run self-hosted memory in production: OAuth, hybrid sync, multi-client rollout. Free 30-minute intro call.

Get in touch