mcp-memory-service
doobidoo · doobidoo/mcp-memory-service
Dịch vụ bộ nhớ MCP mã nguồn mở này cung cấp bộ nhớ bền vững, chia sẻ và biểu đồ tri thức cho các quy trình tác nhân AI.
Bộ nhớ bền vững nguồn mở cho các pipeline AI agent (LangGraph, CrewAI, AutoGen) và Claude. REST API + biểu đồ tri thức + củng cố tự động.
Xem trước
Bạn có thể làm gì với nó
- Cho phép một tác nhân AI ghi nhớ kiến trúc dự án qua các phiên trò chuyện.
- Chia sẻ biểu đồ tri thức nhân quả giữa các tác nhân AI khác nhau trong một quy trình.
- Truy xuất ngữ cảnh cho các phiên tác nhân mới ngay lập tức mà không cần giải thích lại.
Kiểm tra an toàn
Dùng được, nhưng nên đọc ghi chú trước.
- ●Gửi biến môi trường hoặc token qua mạng.
docs/agents/http-generic.md
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
mcp-memory-service
Persistent Shared Memory for AI Agent Pipelines
Open-source memory backend for AI agents — REST API, MCP, OAuth, CLI, dashboard. One self-hosted service, every transport. Agents store decisions, share causal knowledge graphs, and retrieve context in 5ms — without cloud lock-in or API costs.
Works with LangGraph · CrewAI · AutoGen · any HTTP client · Claude Desktop · OpenCode
Why Agents Need This
Your AI assistant forgets everything when you start a new chat. You spend 10 minutes re-explaining your architecture. Again. MCP Memory Service captures project context, architecture decisions, and code patterns automatically — new sessions start with everything already known.
| Without mcp-memory-service | With mcp-memory-service |
|---|---|
| Each agent run starts from zero | Agents retrieve prior decisions in 5ms |
| Memory is local to one graph/run | Memory is shared across all agents and runs |
| You manage Redis + Pinecone + glue code | One self-hosted service, zero cloud cost |
| No causal relationships between facts | Knowledge graph with typed edges (causes, fixes, contradicts) |
| Context window limits create amnesia | Autonomous consolidation compresses old memories |
Key capabilities for agent pipelines:
- Framework-agnostic REST API — no MCP client library needed; the live endpoint list is at
/api/docs - Knowledge graph — agents share causal chains, not just facts
X-Agent-IDheader — auto-tag memories by agent identity for scoped retrievalconversation_id— bypass deduplication for incremental conversation storage- SSE events — real-time notifications when any agent stores or deletes a memory
- Embeddings run locally via ONNX — memory never leaves your infrastructure
🚀 Get Started in 60 Seconds
Not sure which setup fits? The Setup Guide walks you to the right path in under a minute.
1. Install:
pip install mcp-memory-service
2. Configure your AI client:
Claude Desktop
Add to your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"memory": {
"command": "memory",
"args": ["server"]
}
}
}
Restart Claude Desktop. Your AI now remembers everything across sessions.
Claude Code
claude mcp add memory -- memory server
Restart Claude Code. Memory tools will appear automatically.
Agent pipelines (REST API — LangGraph, CrewAI, AutoGen, any HTTP client)
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
# REST API running at http://localhost:8000
Store a memory with POST /api/memories, search with POST /api/search, retrieve by tag
with POST /api/search/by-tag. Send X-Agent-ID: <id> on a store request and the server
tags the memory agent:<id>, which a tag search then scopes retrieval by.
Worked examples per framework, the tag conventions and the async patterns: docs/agents/
OpenCode
MCP_ALLOW_ANONYMOUS_ACCESS=true memory server --http
The plugin ships as repository files for the local plugin directory, so clone the
repository once even if you installed from PyPI. Install steps, the /memory slash
command and the endpoint override:
opencode/README.md
claude.ai and ChatGPT (browser — Remote MCP)
Remote MCP puts persistent memory in the browser on any device, no desktop app required: OAuth 2.0 over HTTPS, self-hosted or cloud-hosted. Both claude.ai and ChatGPT (Developer Mode) connect to the same endpoint.
Cloudflare Tunnel quick start, Let's Encrypt, nginx, Caddy and Docker production setups: Remote MCP Setup · 5-minute tutorial
Advanced: custom backends and team setup
git clone https://github.com/doobidoo/mcp-memory-service.git
cd mcp-memory-service
python scripts/installation/install.py
Choose from SQLite (local, fast, single-user), Cloudflare (cloud, multi-device sync), Hybrid (5ms local reads with background cloud sync — recommended for production) or Milvus (dedicated vector DB: Lite file, self-hosted, or Zilliz Cloud).
For long-lived services, prefer Docker Milvus or Zilliz Cloud over Milvus Lite — why.
⚡ Works With Your Favorite AI Tools
- Agent frameworks (REST): LangGraph · CrewAI · AutoGen · OpenClaw/Nanobot · any HTTP client
- CLI and terminal (MCP): Claude Code · Gemini CLI · OpenCode · Codex CLI · Goose · Aider · Amp
- Desktop and IDE (MCP): Claude Desktop · VS Code · Cursor · Windsurf · Raycast · JetBrains · Zed
- Chat (MCP): ChatGPT (Developer Mode) · claude.ai (Remote MCP over HTTPS)
Full list, plus clients without OAuth such as Home Assistant: docs/integrations.md
✨ Features
🧠 Persistent Memory – Context survives across sessions with semantic search 🔍 Smart Retrieval – Finds relevant context auto