Give your AI agents persistent memory via the Model Context Protocol. MCP v3.2 tools: memory_search, memory_add, memory_get, memory_list, memory_clear. 100% local. No API key. MIT license.
Last updated: March 2026 · View on GitHub →
An MCP memory server exposes memory tools to AI agents via the Model Context Protocol (MCP). Your agent can store, search, and retrieve information across sessions — without relying on the context window alone. MCP is the standard protocol for connecting AI agents to tools, adopted by OpenClaw, Claude Desktop, Cursor, and more.
agent-memory is a lightweight, open-source MCP v3.2 server for AI agent memory. Unlike cloud-based alternatives, it runs entirely on your machine. No account. No API key. No data leaves your device.
# Install agent-memory
pip install agent-memory
# Start the MCP memory server
python -m agent_memory.mcp_server
# Your AI agent can now use:
# memory_search(query) — find relevant memories
# memory_add(text, ttl='7d') — store a memory
# memory_get(id) — retrieve specific memory
# memory_list() — list recent memories
# memory_clear() — clear all memories
Beyond MCP, use agent-memory directly in Python:
from agent_memory import Memory
m = Memory(storage="json", path="./memory.json")
# Store memories with automatic TTL
m.add("User prefers dark mode", ttl="30d")
m.add("API endpoint: /api/v2/users", ttl="7d")
# Retrieve via semantic search
results = m.search("dark mode preference")
for r in results:
print(r["text"], r["score"])
# Or use encrypted storage
m_enc = Memory(encryption_key="my-secret-key")
m_enc.add("Admin password hint")
AI Coding Agents (Cursor, Claude Code): Remember project conventions, API shapes, architectural decisions, and user preferences across sessions. No more re-explaining your codebase every time.
Research Agents: Store facts, URLs, and insights from web searches. Retrieve relevant context when working on related topics.
Customer Support Agents: Remember user preferences, past issues, and conversation history for personalized support.
DevOps Agents: Track server configurations, deployment history, and operational patterns for reliable automation.