{
  "type": "comparison",
  "id": "coding-agent-memory-servers",
  "title": "Memory servers for coding agents compared: m3 Memory vs agentmemory vs Basic Memory vs MCP Memory Service",
  "summary": "Four self-hosted memory servers that give Claude Code, Codex, Cursor and other MCP clients one shared memory across sessions and tools. Covers install, storage, search, how memories get captured, hosted options and license.",
  "author": "Agentica Author",
  "tags": [
    "memory",
    "mcp",
    "coding-agents",
    "self-hosted",
    "local-first",
    "claude-code",
    "codex"
  ],
  "published": "2026-10-27",
  "last_verified": "2026-10-27",
  "entries": [
    "m3-memory",
    "agentmemory",
    "basic-memory",
    "mcp-memory-service",
    "claude-code",
    "codex-cli",
    "cursor",
    "gemini-cli",
    "mem0",
    "letta",
    "graphiti",
    "omnimemeval"
  ],
  "links": {
    "html": "https://indexagentica.com/compare/coding-agent-memory-servers/",
    "markdown": "https://indexagentica.com/compare/coding-agent-memory-servers.md",
    "json": "https://indexagentica.com/api/longform/compare/coding-agent-memory-servers.json",
    "source": "https://github.com/Drudley/indexagentica/blob/main/content-long/compare/coding-agent-memory-servers.md"
  },
  "status": "published",
  "comparison": {
    "subjects": [
      {
        "id": "m3-memory",
        "name": "m3 Memory",
        "summary": "Local-first, MCP-native memory layer for coding agents (Claude Code, Codex, Gemini CLI, Antigravity, OpenCode, OpenClaw) with hybrid search and chat capture.",
        "url": "https://indexagentica.com/entries/m3-memory/",
        "json": "https://indexagentica.com/api/entries/m3-memory.json"
      },
      {
        "id": "agentmemory",
        "name": "agentmemory",
        "summary": "Persistent memory server for coding agents (Claude Code, Copilot CLI, Cursor, Gemini CLI, Codex CLI, OpenCode and any MCP client) with hybrid search.",
        "url": "https://indexagentica.com/entries/agentmemory/",
        "json": "https://indexagentica.com/api/entries/agentmemory.json"
      },
      {
        "id": "basic-memory",
        "name": "Basic Memory",
        "summary": "Local-first MCP server that gives AI assistants persistent memory stored as Markdown files in a knowledge base you own.",
        "url": "https://indexagentica.com/entries/basic-memory/",
        "json": "https://indexagentica.com/api/entries/basic-memory.json"
      },
      {
        "id": "mcp-memory-service",
        "name": "MCP Memory Service",
        "summary": "Open-source persistent memory for AI agent pipelines and Claude, with a REST API, knowledge graph and autonomous consolidation.",
        "url": "https://indexagentica.com/entries/mcp-memory-service/",
        "json": "https://indexagentica.com/api/entries/mcp-memory-service.json"
      }
    ],
    "criteria": [
      "Install",
      "Storage",
      "Search",
      "How memories get in",
      "Hosted option",
      "License"
    ],
    "rows": {
      "m3-memory": {
        "Install": "pipx install m3-memory, then m3 setup (detects agents and wires them up) and m3 doctor. PyPI 2026.10.25.0, Python 3.12+",
        "Storage": "One SQLite file by default; PostgreSQL 16-18 as an alternative (pgvector optional), shared directly or synced hourly hub-and-spoke",
        "Search": "Hybrid keyword plus vector; knowledge-graph links up to 3 hops; supersession keeps earlier versions when a decision changes",
        "How memories get in": "Agents call MCP tools (only 6 of 100+ load at startup); chat-log capture saves turns before compaction for Claude Code, Codex, Gemini CLI, Antigravity, OpenCode, OpenClaw and Aider",
        "Hosted option": "None; runs on your machine, works offline",
        "License": "Apache-2.0"
      },
      "agentmemory": {
        "Install": "npx -y @agentmemory/agentmemory@latest (interactive setup; Node.js 20+). npm 0.9.31",
        "Storage": "Local data directory outside the repo (state_store.db); API on localhost:3111, viewer on :3113",
        "Search": "BM25 keyword search with no API key (keyless mode); local or remote embeddings add semantic search; graph matches fused in smart search",
        "How memories get in": "Lifecycle hooks and native plugins capture sessions automatically (12 hooks in Claude Code, 6 in Codex), with secret scrubbing; 54 MCP tools plus REST",
        "Hosted option": "None; local server, or self-host it remotely behind a secret",
        "License": "Apache-2.0"
      },
      "basic-memory": {
        "Install": "uv tool install basic-memory --prerelease=allow (Python 3.12+; needs a FastMCP 4 pre-release). PyPI 0.24.1",
        "Storage": "Plain Markdown files on disk with a local SQLite index; Postgres (optionally with Milvus vectors) for larger deployments",
        "Search": "Hybrid full-text plus vector (FastEmbed) with optional cross-encoder reranking; wikilinks and observations form a knowledge graph",
        "How memories get in": "The AI writes and edits notes through MCP tools, and humans edit the same Markdown (for example in Obsidian); a Claude Code plugin adds hooks and skills",
        "Hosted option": "Basic Memory Cloud: $15/month (7-day trial), cross-device sync, Teams workspaces",
        "License": "AGPL-3.0"
      },
      "mcp-memory-service": {
        "Install": "pip install mcp-memory-service, then memory server (stdio) or memory server --http. PyPI 12.4.0, Python 3.10+",
        "Storage": "SQLite locally, Cloudflare for multi-device sync, or Hybrid (local reads with background sync to Cloudflare or another instance); Milvus option",
        "Search": "Semantic search with local ONNX embeddings, tag search and a typed knowledge graph (causes, fixes, contradicts); scheduled consolidation",
        "How memories get in": "MCP tools, a REST API (POST /api/memories) with X-Agent-ID tagging, and optional hooks for Claude Code and Codex that retrieve and store context",
        "Hosted option": "None official; self-host, including remote MCP over HTTPS with OAuth 2.0 for claude.ai and ChatGPT",
        "License": "Apache-2.0"
      }
    },
    "table": [
      {
        "entry": "m3-memory",
        "name": "m3 Memory",
        "url": "https://indexagentica.com/entries/m3-memory/",
        "values": {
          "Install": "pipx install m3-memory, then m3 setup (detects agents and wires them up) and m3 doctor. PyPI 2026.10.25.0, Python 3.12+",
          "Storage": "One SQLite file by default; PostgreSQL 16-18 as an alternative (pgvector optional), shared directly or synced hourly hub-and-spoke",
          "Search": "Hybrid keyword plus vector; knowledge-graph links up to 3 hops; supersession keeps earlier versions when a decision changes",
          "How memories get in": "Agents call MCP tools (only 6 of 100+ load at startup); chat-log capture saves turns before compaction for Claude Code, Codex, Gemini CLI, Antigravity, OpenCode, OpenClaw and Aider",
          "Hosted option": "None; runs on your machine, works offline",
          "License": "Apache-2.0"
        }
      },
      {
        "entry": "agentmemory",
        "name": "agentmemory",
        "url": "https://indexagentica.com/entries/agentmemory/",
        "values": {
          "Install": "npx -y @agentmemory/agentmemory@latest (interactive setup; Node.js 20+). npm 0.9.31",
          "Storage": "Local data directory outside the repo (state_store.db); API on localhost:3111, viewer on :3113",
          "Search": "BM25 keyword search with no API key (keyless mode); local or remote embeddings add semantic search; graph matches fused in smart search",
          "How memories get in": "Lifecycle hooks and native plugins capture sessions automatically (12 hooks in Claude Code, 6 in Codex), with secret scrubbing; 54 MCP tools plus REST",
          "Hosted option": "None; local server, or self-host it remotely behind a secret",
          "License": "Apache-2.0"
        }
      },
      {
        "entry": "basic-memory",
        "name": "Basic Memory",
        "url": "https://indexagentica.com/entries/basic-memory/",
        "values": {
          "Install": "uv tool install basic-memory --prerelease=allow (Python 3.12+; needs a FastMCP 4 pre-release). PyPI 0.24.1",
          "Storage": "Plain Markdown files on disk with a local SQLite index; Postgres (optionally with Milvus vectors) for larger deployments",
          "Search": "Hybrid full-text plus vector (FastEmbed) with optional cross-encoder reranking; wikilinks and observations form a knowledge graph",
          "How memories get in": "The AI writes and edits notes through MCP tools, and humans edit the same Markdown (for example in Obsidian); a Claude Code plugin adds hooks and skills",
          "Hosted option": "Basic Memory Cloud: $15/month (7-day trial), cross-device sync, Teams workspaces",
          "License": "AGPL-3.0"
        }
      },
      {
        "entry": "mcp-memory-service",
        "name": "MCP Memory Service",
        "url": "https://indexagentica.com/entries/mcp-memory-service/",
        "values": {
          "Install": "pip install mcp-memory-service, then memory server (stdio) or memory server --http. PyPI 12.4.0, Python 3.10+",
          "Storage": "SQLite locally, Cloudflare for multi-device sync, or Hybrid (local reads with background sync to Cloudflare or another instance); Milvus option",
          "Search": "Semantic search with local ONNX embeddings, tag search and a typed knowledge graph (causes, fixes, contradicts); scheduled consolidation",
          "How memories get in": "MCP tools, a REST API (POST /api/memories) with X-Agent-ID tagging, and optional hooks for Claude Code and Codex that retrieve and store context",
          "Hosted option": "None official; self-host, including remote MCP over HTTPS with OAuth 2.0 for claude.ai and ChatGPT",
          "License": "Apache-2.0"
        }
      }
    ],
    "verdict": "Want a memory you can read and edit yourself? Basic Memory keeps everything as Markdown, but note the AGPL license and the pre-release install flag. Want capture with no effort in Claude Code or Codex? agentmemory's hooks record sessions automatically and work without an API key. Want one store for several agents and machines, with version history and a small startup tool footprint? m3 Memory with SQLite or PostgreSQL. Building a multi-agent pipeline (LangGraph, CrewAI) that needs plain REST plus MCP and OAuth? MCP Memory Service."
  },
  "entries_detail": [
    {
      "id": "m3-memory",
      "name": "m3 Memory",
      "summary": "Local-first, MCP-native memory layer for coding agents (Claude Code, Codex, Gemini CLI, Antigravity, OpenCode, OpenClaw) with hybrid search and chat capture.",
      "url": "https://indexagentica.com/entries/m3-memory/",
      "json": "https://indexagentica.com/api/entries/m3-memory.json"
    },
    {
      "id": "agentmemory",
      "name": "agentmemory",
      "summary": "Persistent memory server for coding agents (Claude Code, Copilot CLI, Cursor, Gemini CLI, Codex CLI, OpenCode and any MCP client) with hybrid search.",
      "url": "https://indexagentica.com/entries/agentmemory/",
      "json": "https://indexagentica.com/api/entries/agentmemory.json"
    },
    {
      "id": "basic-memory",
      "name": "Basic Memory",
      "summary": "Local-first MCP server that gives AI assistants persistent memory stored as Markdown files in a knowledge base you own.",
      "url": "https://indexagentica.com/entries/basic-memory/",
      "json": "https://indexagentica.com/api/entries/basic-memory.json"
    },
    {
      "id": "mcp-memory-service",
      "name": "MCP Memory Service",
      "summary": "Open-source persistent memory for AI agent pipelines and Claude, with a REST API, knowledge graph and autonomous consolidation.",
      "url": "https://indexagentica.com/entries/mcp-memory-service/",
      "json": "https://indexagentica.com/api/entries/mcp-memory-service.json"
    },
    {
      "id": "claude-code",
      "name": "Claude Code",
      "summary": "Anthropic's agentic coding tool that reads your codebase, edits files, runs commands and integrates with dev tools; available in terminal, IDE, desktop and browser.",
      "url": "https://indexagentica.com/entries/claude-code/",
      "json": "https://indexagentica.com/api/entries/claude-code.json"
    },
    {
      "id": "codex-cli",
      "name": "OpenAI Codex CLI",
      "summary": "OpenAI's lightweight open-source coding agent that runs in your terminal.",
      "url": "https://indexagentica.com/entries/codex-cli/",
      "json": "https://indexagentica.com/api/entries/codex-cli.json"
    },
    {
      "id": "cursor",
      "name": "Cursor",
      "summary": "AI code editor and coding agent with Agent mode, Rules, Skills, MCP servers and a CLI.",
      "url": "https://indexagentica.com/entries/cursor/",
      "json": "https://indexagentica.com/api/entries/cursor.json"
    },
    {
      "id": "gemini-cli",
      "name": "Gemini CLI",
      "summary": "Open-source AI agent from Google that brings Gemini models directly into your terminal.",
      "url": "https://indexagentica.com/entries/gemini-cli/",
      "json": "https://indexagentica.com/api/entries/gemini-cli.json"
    },
    {
      "id": "mem0",
      "name": "Mem0",
      "summary": "Memory layer for AI agents and apps: drop-in persistent memory that lets agents learn from past interactions.",
      "url": "https://indexagentica.com/entries/mem0/",
      "json": "https://indexagentica.com/api/entries/mem0.json"
    },
    {
      "id": "letta",
      "name": "Letta",
      "summary": "Platform for stateful agents with memory, identity and the ability to learn over time (formerly MemGPT); terminal UI, App Server, desktop app and Agent SDK.",
      "url": "https://indexagentica.com/entries/letta/",
      "json": "https://indexagentica.com/api/entries/letta.json"
    },
    {
      "id": "graphiti",
      "name": "Graphiti",
      "summary": "Zep's open-source framework for building real-time knowledge graphs for AI agents.",
      "url": "https://indexagentica.com/entries/graphiti/",
      "json": "https://indexagentica.com/api/entries/graphiti.json"
    },
    {
      "id": "omnimemeval",
      "name": "OmniMemEval",
      "summary": "MemTensor's evaluation framework for memory backends (LoCoMo, LongMemEval, BEAM, PersonaMem v2, HaluMem) and memory-equipped agents on AgentBench domains.",
      "url": "https://indexagentica.com/entries/omnimemeval/",
      "json": "https://indexagentica.com/api/entries/omnimemeval.json"
    }
  ],
  "related": [
    {
      "type": "comparison",
      "id": "agent-memory-layers",
      "title": "Memory layers for AI agents",
      "url": "https://indexagentica.com/compare/agent-memory-layers/",
      "json": "https://indexagentica.com/api/longform/compare/agent-memory-layers.json"
    },
    {
      "type": "guide",
      "id": "give-an-agent-long-term-memory",
      "title": "Give an agent long-term memory",
      "url": "https://indexagentica.com/guides/give-an-agent-long-term-memory/",
      "json": "https://indexagentica.com/api/longform/guides/give-an-agent-long-term-memory.json"
    },
    {
      "type": "comparison",
      "id": "coding-agent-harnesses",
      "title": "Terminal coding agents compared",
      "url": "https://indexagentica.com/compare/coding-agent-harnesses/",
      "json": "https://indexagentica.com/api/longform/compare/coding-agent-harnesses.json"
    },
    {
      "type": "guide",
      "id": "add-mcp-servers-to-claude-code",
      "title": "Add MCP servers to Claude Code",
      "url": "https://indexagentica.com/guides/add-mcp-servers-to-claude-code/",
      "json": "https://indexagentica.com/api/longform/guides/add-mcp-servers-to-claude-code.json"
    },
    {
      "type": "skill",
      "id": "pick-an-mcp-server",
      "title": "Pick an MCP server",
      "url": "https://indexagentica.com/skills/pick-an-mcp-server/",
      "json": "https://indexagentica.com/api/longform/skills/pick-an-mcp-server.json"
    }
  ],
  "sources": [
    {
      "title": "m3 Memory README",
      "url": "https://github.com/skynetcmd/m3-memory",
      "accessed": "2026-10-27"
    },
    {
      "title": "PyPI: m3-memory",
      "url": "https://pypi.org/project/m3-memory/",
      "accessed": "2026-10-27"
    },
    {
      "title": "agentmemory README",
      "url": "https://github.com/rohitg00/agentmemory",
      "accessed": "2026-10-27"
    },
    {
      "title": "npm: @agentmemory/agentmemory",
      "url": "https://www.npmjs.com/package/@agentmemory/agentmemory",
      "accessed": "2026-10-27"
    },
    {
      "title": "Basic Memory README",
      "url": "https://github.com/basicmachines-co/basic-memory",
      "accessed": "2026-10-27"
    },
    {
      "title": "PyPI: basic-memory",
      "url": "https://pypi.org/project/basic-memory/",
      "accessed": "2026-10-27"
    },
    {
      "title": "MCP Memory Service README",
      "url": "https://github.com/doobidoo/mcp-memory-service",
      "accessed": "2026-10-27"
    },
    {
      "title": "PyPI: mcp-memory-service",
      "url": "https://pypi.org/project/mcp-memory-service/",
      "accessed": "2026-10-27"
    }
  ],
  "front_matter": {
    "id": "coding-agent-memory-servers",
    "type": "comparison",
    "title": "Memory servers for coding agents compared: m3 Memory vs agentmemory vs Basic Memory vs MCP Memory Service",
    "summary": "Four self-hosted memory servers that give Claude Code, Codex, Cursor and other MCP clients one shared memory across sessions and tools. Covers install, storage, search, how memories get captured, hosted options and license.",
    "description": "A primary-source comparison of four local-first memory servers for coding agents, checked on 2026-10-27 against each project's GitHub README and package registry (PyPI and npm). All four are open source and reach agents over MCP. Benchmark and performance figures are the projects' own claims and were not reproduced here.",
    "author": "Agentica Author",
    "tags": [
      "memory",
      "mcp",
      "coding-agents",
      "self-hosted",
      "local-first",
      "claude-code",
      "codex"
    ],
    "entries": [
      "m3-memory",
      "agentmemory",
      "basic-memory",
      "mcp-memory-service",
      "claude-code",
      "codex-cli",
      "cursor",
      "gemini-cli",
      "mem0",
      "letta",
      "graphiti",
      "omnimemeval"
    ],
    "related": [
      "agent-memory-layers",
      "give-an-agent-long-term-memory",
      "coding-agent-harnesses",
      "add-mcp-servers-to-claude-code",
      "pick-an-mcp-server"
    ],
    "subjects": [
      "m3-memory",
      "agentmemory",
      "basic-memory",
      "mcp-memory-service"
    ],
    "criteria": [
      "Install",
      "Storage",
      "Search",
      "How memories get in",
      "Hosted option",
      "License"
    ],
    "rows": {
      "m3-memory": {
        "Install": "pipx install m3-memory, then m3 setup (detects agents and wires them up) and m3 doctor. PyPI 2026.10.25.0, Python 3.12+",
        "Storage": "One SQLite file by default; PostgreSQL 16-18 as an alternative (pgvector optional), shared directly or synced hourly hub-and-spoke",
        "Search": "Hybrid keyword plus vector; knowledge-graph links up to 3 hops; supersession keeps earlier versions when a decision changes",
        "How memories get in": "Agents call MCP tools (only 6 of 100+ load at startup); chat-log capture saves turns before compaction for Claude Code, Codex, Gemini CLI, Antigravity, OpenCode, OpenClaw and Aider",
        "Hosted option": "None; runs on your machine, works offline",
        "License": "Apache-2.0"
      },
      "agentmemory": {
        "Install": "npx -y @agentmemory/agentmemory@latest (interactive setup; Node.js 20+). npm 0.9.31",
        "Storage": "Local data directory outside the repo (state_store.db); API on localhost:3111, viewer on :3113",
        "Search": "BM25 keyword search with no API key (keyless mode); local or remote embeddings add semantic search; graph matches fused in smart search",
        "How memories get in": "Lifecycle hooks and native plugins capture sessions automatically (12 hooks in Claude Code, 6 in Codex), with secret scrubbing; 54 MCP tools plus REST",
        "Hosted option": "None; local server, or self-host it remotely behind a secret",
        "License": "Apache-2.0"
      },
      "basic-memory": {
        "Install": "uv tool install basic-memory --prerelease=allow (Python 3.12+; needs a FastMCP 4 pre-release). PyPI 0.24.1",
        "Storage": "Plain Markdown files on disk with a local SQLite index; Postgres (optionally with Milvus vectors) for larger deployments",
        "Search": "Hybrid full-text plus vector (FastEmbed) with optional cross-encoder reranking; wikilinks and observations form a knowledge graph",
        "How memories get in": "The AI writes and edits notes through MCP tools, and humans edit the same Markdown (for example in Obsidian); a Claude Code plugin adds hooks and skills",
        "Hosted option": "Basic Memory Cloud: $15/month (7-day trial), cross-device sync, Teams workspaces",
        "License": "AGPL-3.0"
      },
      "mcp-memory-service": {
        "Install": "pip install mcp-memory-service, then memory server (stdio) or memory server --http. PyPI 12.4.0, Python 3.10+",
        "Storage": "SQLite locally, Cloudflare for multi-device sync, or Hybrid (local reads with background sync to Cloudflare or another instance); Milvus option",
        "Search": "Semantic search with local ONNX embeddings, tag search and a typed knowledge graph (causes, fixes, contradicts); scheduled consolidation",
        "How memories get in": "MCP tools, a REST API (POST /api/memories) with X-Agent-ID tagging, and optional hooks for Claude Code and Codex that retrieve and store context",
        "Hosted option": "None official; self-host, including remote MCP over HTTPS with OAuth 2.0 for claude.ai and ChatGPT",
        "License": "Apache-2.0"
      }
    },
    "verdict": "Want a memory you can read and edit yourself? Basic Memory keeps everything as Markdown, but note the AGPL license and the pre-release install flag. Want capture with no effort in Claude Code or Codex? agentmemory's hooks record sessions automatically and work without an API key. Want one store for several agents and machines, with version history and a small startup tool footprint? m3 Memory with SQLite or PostgreSQL. Building a multi-agent pipeline (LangGraph, CrewAI) that needs plain REST plus MCP and OAuth? MCP Memory Service.",
    "sources": [
      {
        "title": "m3 Memory README",
        "url": "https://github.com/skynetcmd/m3-memory",
        "accessed": "2026-10-27"
      },
      {
        "title": "PyPI: m3-memory",
        "url": "https://pypi.org/project/m3-memory/",
        "accessed": "2026-10-27"
      },
      {
        "title": "agentmemory README",
        "url": "https://github.com/rohitg00/agentmemory",
        "accessed": "2026-10-27"
      },
      {
        "title": "npm: @agentmemory/agentmemory",
        "url": "https://www.npmjs.com/package/@agentmemory/agentmemory",
        "accessed": "2026-10-27"
      },
      {
        "title": "Basic Memory README",
        "url": "https://github.com/basicmachines-co/basic-memory",
        "accessed": "2026-10-27"
      },
      {
        "title": "PyPI: basic-memory",
        "url": "https://pypi.org/project/basic-memory/",
        "accessed": "2026-10-27"
      },
      {
        "title": "MCP Memory Service README",
        "url": "https://github.com/doobidoo/mcp-memory-service",
        "accessed": "2026-10-27"
      },
      {
        "title": "PyPI: mcp-memory-service",
        "url": "https://pypi.org/project/mcp-memory-service/",
        "accessed": "2026-10-27"
      }
    ],
    "last_verified": "2026-10-27",
    "published": "2026-10-27"
  },
  "markdown": "\nCoding agents forget everything between sessions. These four servers fix that in the same basic way: a local process stores memories, and every agent you use reaches it over MCP, so a decision you made in [Claude Code](https://indexagentica.com/entries/claude-code/) on Monday is there when you open [Codex](https://indexagentica.com/entries/codex-cli/) or [Cursor](https://indexagentica.com/entries/cursor/) on Friday. They differ in how memories get captured, what the store looks like, and how far they scale beyond one laptop.\n\nThese are not the same thing as the memory SDKs in [Agent memory layers compared](https://indexagentica.com/compare/agent-memory-layers/) ([Mem0](https://indexagentica.com/entries/mem0/), [Letta](https://indexagentica.com/entries/letta/), [Graphiti](https://indexagentica.com/entries/graphiti/) and others). Those are libraries you build into your own agent. The servers here are for agents you already use and can't change.\n\n## Capture: tools, hooks or files\n\nThis is the biggest practical difference.\n\n- **Explicit tool calls.** By default the agent decides when to save or search, through MCP tools. Every option here supports this. It costs nothing to set up, but the agent can forget to remember.\n- **Hooks.** [agentmemory](https://indexagentica.com/entries/agentmemory/) is built around lifecycle hooks (`SessionStart`, `PostToolUse`, `PreCompact`, `Stop` and others) that record sessions without the agent asking. [MCP Memory Service](https://indexagentica.com/entries/mcp-memory-service/) has optional hooks for Claude Code and Codex. [m3 Memory](https://indexagentica.com/entries/m3-memory/) captures chat turns before an agent compacts its context, for seven agents. Hooks run code on every event, so review what they send and where.\n- **Files you can edit.** [Basic Memory](https://indexagentica.com/entries/basic-memory/) stores each memory as a Markdown note. You can open, fix or delete it in any editor, and the index re-syncs. That's the easiest store to audit by hand.\n\n## Context cost\n\nA memory server with dozens of tools can use a lot of the context window before the agent does anything. m3 Memory says it registers only 6 of its 100+ tools at startup (about 3,200 tokens by its own count) and loads the rest on demand. agentmemory exposes 54 MCP tools and ships skills that tell the agent when to use them. If your client supports per-server tool filtering, use it. If you're on Claude Code, [Add MCP servers to Claude Code](https://indexagentica.com/guides/add-mcp-servers-to-claude-code/) covers the config.\n\n## One laptop or a team\n\nAll four run locally with SQLite or local files. To share memory across machines:\n\n- m3 Memory can point every machine at one PostgreSQL database, or keep SQLite on each and sync hourly through a PostgreSQL hub.\n- MCP Memory Service's Hybrid backend reads locally and syncs in the background to Cloudflare or another instance. It can also run as a remote MCP server with OAuth, which claude.ai and ChatGPT can connect to.\n- Basic Memory Cloud is the only paid hosted option here ($15/month, with Teams workspaces). Self-hosted users sync the Markdown with Git or Syncthing.\n- agentmemory can run as a remote, secret-protected server (`AGENTMEMORY_URL` plus `AGENTMEMORY_SECRET`), and it has team-memory tools (namespaced shared and private memories) and a `memory_mesh_sync` tool for peer-to-peer sync between instances.\n\n## Claims to treat with care\n\nEach README reports its own benchmark results (for example m3 Memory's \"right session first for 91.8% of questions\" and agentmemory's LongMemEval numbers). They were not reproduced here, and they use different setups. To compare memory systems on your own terms, [OmniMemEval](https://indexagentica.com/entries/omnimemeval/) is an open evaluation framework for memory backends (LoCoMo, LongMemEval and others), and [Give an agent long-term memory](https://indexagentica.com/guides/give-an-agent-long-term-memory/) covers the design trade-offs.\n\n## Before you install\n\n- **Licenses.** Three are Apache-2.0. Basic Memory is AGPL-3.0, which matters if you modify it and offer it as a network service.\n- **Secrets.** Hooks capture whatever passes through a session. agentmemory scrubs secrets on capture. For the others, keep API keys out of prompts or check what gets stored.\n- **Ports.** agentmemory and MCP Memory Service run local HTTP servers (3111/3113 and 8000). agentmemory binds to loopback by default. MCP Memory Service's `MCP_ALLOW_ANONYMOUS_ACCESS=true` quick start should never be exposed beyond localhost.\n",
  "raw": "---\nid: coding-agent-memory-servers\ntype: comparison\ntitle: \"Memory servers for coding agents compared: m3 Memory vs agentmemory vs Basic Memory vs MCP Memory Service\"\nsummary: \"Four self-hosted memory servers that give Claude Code, Codex, Cursor and other MCP clients one shared memory across sessions and tools. Covers install, storage, search, how memories get captured, hosted options and license.\"\ndescription: \"A primary-source comparison of four local-first memory servers for coding agents, checked on 2026-10-27 against each project's GitHub README and package registry (PyPI and npm). All four are open source and reach agents over MCP. Benchmark and performance figures are the projects' own claims and were not reproduced here.\"\nauthor: Agentica Author\ntags: [memory, mcp, coding-agents, self-hosted, local-first, claude-code, codex]\nentries: [m3-memory, agentmemory, basic-memory, mcp-memory-service, claude-code, codex-cli, cursor, gemini-cli, mem0, letta, graphiti, omnimemeval]\nrelated: [agent-memory-layers, give-an-agent-long-term-memory, coding-agent-harnesses, add-mcp-servers-to-claude-code, pick-an-mcp-server]\nsubjects: [m3-memory, agentmemory, basic-memory, mcp-memory-service]\ncriteria:\n  - Install\n  - Storage\n  - Search\n  - How memories get in\n  - Hosted option\n  - License\nrows:\n  m3-memory:\n    Install: \"pipx install m3-memory, then m3 setup (detects agents and wires them up) and m3 doctor. PyPI 2026.10.25.0, Python 3.12+\"\n    Storage: \"One SQLite file by default; PostgreSQL 16-18 as an alternative (pgvector optional), shared directly or synced hourly hub-and-spoke\"\n    Search: \"Hybrid keyword plus vector; knowledge-graph links up to 3 hops; supersession keeps earlier versions when a decision changes\"\n    How memories get in: \"Agents call MCP tools (only 6 of 100+ load at startup); chat-log capture saves turns before compaction for Claude Code, Codex, Gemini CLI, Antigravity, OpenCode, OpenClaw and Aider\"\n    Hosted option: \"None; runs on your machine, works offline\"\n    License: \"Apache-2.0\"\n  agentmemory:\n    Install: \"npx -y @agentmemory/agentmemory@latest (interactive setup; Node.js 20+). npm 0.9.31\"\n    Storage: \"Local data directory outside the repo (state_store.db); API on localhost:3111, viewer on :3113\"\n    Search: \"BM25 keyword search with no API key (keyless mode); local or remote embeddings add semantic search; graph matches fused in smart search\"\n    How memories get in: \"Lifecycle hooks and native plugins capture sessions automatically (12 hooks in Claude Code, 6 in Codex), with secret scrubbing; 54 MCP tools plus REST\"\n    Hosted option: \"None; local server, or self-host it remotely behind a secret\"\n    License: \"Apache-2.0\"\n  basic-memory:\n    Install: \"uv tool install basic-memory --prerelease=allow (Python 3.12+; needs a FastMCP 4 pre-release). PyPI 0.24.1\"\n    Storage: \"Plain Markdown files on disk with a local SQLite index; Postgres (optionally with Milvus vectors) for larger deployments\"\n    Search: \"Hybrid full-text plus vector (FastEmbed) with optional cross-encoder reranking; wikilinks and observations form a knowledge graph\"\n    How memories get in: \"The AI writes and edits notes through MCP tools, and humans edit the same Markdown (for example in Obsidian); a Claude Code plugin adds hooks and skills\"\n    Hosted option: \"Basic Memory Cloud: $15/month (7-day trial), cross-device sync, Teams workspaces\"\n    License: \"AGPL-3.0\"\n  mcp-memory-service:\n    Install: \"pip install mcp-memory-service, then memory server (stdio) or memory server --http. PyPI 12.4.0, Python 3.10+\"\n    Storage: \"SQLite locally, Cloudflare for multi-device sync, or Hybrid (local reads with background sync to Cloudflare or another instance); Milvus option\"\n    Search: \"Semantic search with local ONNX embeddings, tag search and a typed knowledge graph (causes, fixes, contradicts); scheduled consolidation\"\n    How memories get in: \"MCP tools, a REST API (POST /api/memories) with X-Agent-ID tagging, and optional hooks for Claude Code and Codex that retrieve and store context\"\n    Hosted option: \"None official; self-host, including remote MCP over HTTPS with OAuth 2.0 for claude.ai and ChatGPT\"\n    License: \"Apache-2.0\"\nverdict: \"Want a memory you can read and edit yourself? Basic Memory keeps everything as Markdown, but note the AGPL license and the pre-release install flag. Want capture with no effort in Claude Code or Codex? agentmemory's hooks record sessions automatically and work without an API key. Want one store for several agents and machines, with version history and a small startup tool footprint? m3 Memory with SQLite or PostgreSQL. Building a multi-agent pipeline (LangGraph, CrewAI) that needs plain REST plus MCP and OAuth? MCP Memory Service.\"\nsources:\n  - {title: \"m3 Memory README\", url: \"https://github.com/skynetcmd/m3-memory\", accessed: 2026-10-27}\n  - {title: \"PyPI: m3-memory\", url: \"https://pypi.org/project/m3-memory/\", accessed: 2026-10-27}\n  - {title: \"agentmemory README\", url: \"https://github.com/rohitg00/agentmemory\", accessed: 2026-10-27}\n  - {title: \"npm: @agentmemory/agentmemory\", url: \"https://www.npmjs.com/package/@agentmemory/agentmemory\", accessed: 2026-10-27}\n  - {title: \"Basic Memory README\", url: \"https://github.com/basicmachines-co/basic-memory\", accessed: 2026-10-27}\n  - {title: \"PyPI: basic-memory\", url: \"https://pypi.org/project/basic-memory/\", accessed: 2026-10-27}\n  - {title: \"MCP Memory Service README\", url: \"https://github.com/doobidoo/mcp-memory-service\", accessed: 2026-10-27}\n  - {title: \"PyPI: mcp-memory-service\", url: \"https://pypi.org/project/mcp-memory-service/\", accessed: 2026-10-27}\nlast_verified: 2026-10-27\npublished: 2026-10-27\n---\n\nCoding agents forget everything between sessions. These four servers fix that in the same basic way: a local process stores memories, and every agent you use reaches it over MCP, so a decision you made in [Claude Code](https://indexagentica.com/entries/claude-code/) on Monday is there when you open [Codex](https://indexagentica.com/entries/codex-cli/) or [Cursor](https://indexagentica.com/entries/cursor/) on Friday. They differ in how memories get captured, what the store looks like, and how far they scale beyond one laptop.\n\nThese are not the same thing as the memory SDKs in [Agent memory layers compared](https://indexagentica.com/compare/agent-memory-layers/) ([Mem0](https://indexagentica.com/entries/mem0/), [Letta](https://indexagentica.com/entries/letta/), [Graphiti](https://indexagentica.com/entries/graphiti/) and others). Those are libraries you build into your own agent. The servers here are for agents you already use and can't change.\n\n## Capture: tools, hooks or files\n\nThis is the biggest practical difference.\n\n- **Explicit tool calls.** By default the agent decides when to save or search, through MCP tools. Every option here supports this. It costs nothing to set up, but the agent can forget to remember.\n- **Hooks.** [agentmemory](https://indexagentica.com/entries/agentmemory/) is built around lifecycle hooks (`SessionStart`, `PostToolUse`, `PreCompact`, `Stop` and others) that record sessions without the agent asking. [MCP Memory Service](https://indexagentica.com/entries/mcp-memory-service/) has optional hooks for Claude Code and Codex. [m3 Memory](https://indexagentica.com/entries/m3-memory/) captures chat turns before an agent compacts its context, for seven agents. Hooks run code on every event, so review what they send and where.\n- **Files you can edit.** [Basic Memory](https://indexagentica.com/entries/basic-memory/) stores each memory as a Markdown note. You can open, fix or delete it in any editor, and the index re-syncs. That's the easiest store to audit by hand.\n\n## Context cost\n\nA memory server with dozens of tools can use a lot of the context window before the agent does anything. m3 Memory says it registers only 6 of its 100+ tools at startup (about 3,200 tokens by its own count) and loads the rest on demand. agentmemory exposes 54 MCP tools and ships skills that tell the agent when to use them. If your client supports per-server tool filtering, use it. If you're on Claude Code, [Add MCP servers to Claude Code](https://indexagentica.com/guides/add-mcp-servers-to-claude-code/) covers the config.\n\n## One laptop or a team\n\nAll four run locally with SQLite or local files. To share memory across machines:\n\n- m3 Memory can point every machine at one PostgreSQL database, or keep SQLite on each and sync hourly through a PostgreSQL hub.\n- MCP Memory Service's Hybrid backend reads locally and syncs in the background to Cloudflare or another instance. It can also run as a remote MCP server with OAuth, which claude.ai and ChatGPT can connect to.\n- Basic Memory Cloud is the only paid hosted option here ($15/month, with Teams workspaces). Self-hosted users sync the Markdown with Git or Syncthing.\n- agentmemory can run as a remote, secret-protected server (`AGENTMEMORY_URL` plus `AGENTMEMORY_SECRET`), and it has team-memory tools (namespaced shared and private memories) and a `memory_mesh_sync` tool for peer-to-peer sync between instances.\n\n## Claims to treat with care\n\nEach README reports its own benchmark results (for example m3 Memory's \"right session first for 91.8% of questions\" and agentmemory's LongMemEval numbers). They were not reproduced here, and they use different setups. To compare memory systems on your own terms, [OmniMemEval](https://indexagentica.com/entries/omnimemeval/) is an open evaluation framework for memory backends (LoCoMo, LongMemEval and others), and [Give an agent long-term memory](https://indexagentica.com/guides/give-an-agent-long-term-memory/) covers the design trade-offs.\n\n## Before you install\n\n- **Licenses.** Three are Apache-2.0. Basic Memory is AGPL-3.0, which matters if you modify it and offer it as a network service.\n- **Secrets.** Hooks capture whatever passes through a session. agentmemory scrubs secrets on capture. For the others, keep API keys out of prompts or check what gets stored.\n- **Ports.** agentmemory and MCP Memory Service run local HTTP servers (3111/3113 and 8000). agentmemory binds to loopback by default. MCP Memory Service's `MCP_ALLOW_ANONYMOUS_ACCESS=true` quick start should never be exposed beyond localhost.\n",
  "html": "<p>Coding agents forget everything between sessions. These four servers fix that in the same basic way: a local process stores memories, and every agent you use reaches it over MCP, so a decision you made in <a href=\"/entries/claude-code/\">Claude Code</a> on Monday is there when you open <a href=\"/entries/codex-cli/\">Codex</a> or <a href=\"/entries/cursor/\">Cursor</a> on Friday. They differ in how memories get captured, what the store looks like, and how far they scale beyond one laptop.</p>\n<p>These are not the same thing as the memory SDKs in <a href=\"/compare/agent-memory-layers/\">Agent memory layers compared</a> (<a href=\"/entries/mem0/\">Mem0</a>, <a href=\"/entries/letta/\">Letta</a>, <a href=\"/entries/graphiti/\">Graphiti</a> and others). Those are libraries you build into your own agent. The servers here are for agents you already use and can&#39;t change.</p>\n<h2>Capture: tools, hooks or files</h2>\n<p>This is the biggest practical difference.</p>\n<ul><li><strong>Explicit tool calls.</strong> By default the agent decides when to save or search, through MCP tools. Every option here supports this. It costs nothing to set up, but the agent can forget to remember.</li><li><strong>Hooks.</strong> <a href=\"/entries/agentmemory/\">agentmemory</a> is built around lifecycle hooks (<code>SessionStart</code>, <code>PostToolUse</code>, <code>PreCompact</code>, <code>Stop</code> and others) that record sessions without the agent asking. <a href=\"/entries/mcp-memory-service/\">MCP Memory Service</a> has optional hooks for Claude Code and Codex. <a href=\"/entries/m3-memory/\">m3 Memory</a> captures chat turns before an agent compacts its context, for seven agents. Hooks run code on every event, so review what they send and where.</li><li><strong>Files you can edit.</strong> <a href=\"/entries/basic-memory/\">Basic Memory</a> stores each memory as a Markdown note. You can open, fix or delete it in any editor, and the index re-syncs. That&#39;s the easiest store to audit by hand.</li></ul>\n<h2>Context cost</h2>\n<p>A memory server with dozens of tools can use a lot of the context window before the agent does anything. m3 Memory says it registers only 6 of its 100+ tools at startup (about 3,200 tokens by its own count) and loads the rest on demand. agentmemory exposes 54 MCP tools and ships skills that tell the agent when to use them. If your client supports per-server tool filtering, use it. If you&#39;re on Claude Code, <a href=\"/guides/add-mcp-servers-to-claude-code/\">Add MCP servers to Claude Code</a> covers the config.</p>\n<h2>One laptop or a team</h2>\n<p>All four run locally with SQLite or local files. To share memory across machines:</p>\n<ul><li>m3 Memory can point every machine at one PostgreSQL database, or keep SQLite on each and sync hourly through a PostgreSQL hub.</li><li>MCP Memory Service&#39;s Hybrid backend reads locally and syncs in the background to Cloudflare or another instance. It can also run as a remote MCP server with OAuth, which claude.ai and ChatGPT can connect to.</li><li>Basic Memory Cloud is the only paid hosted option here ($15/month, with Teams workspaces). Self-hosted users sync the Markdown with Git or Syncthing.</li><li>agentmemory can run as a remote, secret-protected server (<code>AGENTMEMORY_URL</code> plus <code>AGENTMEMORY_SECRET</code>), and it has team-memory tools (namespaced shared and private memories) and a <code>memory_mesh_sync</code> tool for peer-to-peer sync between instances.</li></ul>\n<h2>Claims to treat with care</h2>\n<p>Each README reports its own benchmark results (for example m3 Memory&#39;s &quot;right session first for 91.8% of questions&quot; and agentmemory&#39;s LongMemEval numbers). They were not reproduced here, and they use different setups. To compare memory systems on your own terms, <a href=\"/entries/omnimemeval/\">OmniMemEval</a> is an open evaluation framework for memory backends (LoCoMo, LongMemEval and others), and <a href=\"/guides/give-an-agent-long-term-memory/\">Give an agent long-term memory</a> covers the design trade-offs.</p>\n<h2>Before you install</h2>\n<ul><li><strong>Licenses.</strong> Three are Apache-2.0. Basic Memory is AGPL-3.0, which matters if you modify it and offer it as a network service.</li><li><strong>Secrets.</strong> Hooks capture whatever passes through a session. agentmemory scrubs secrets on capture. For the others, keep API keys out of prompts or check what gets stored.</li><li><strong>Ports.</strong> agentmemory and MCP Memory Service run local HTTP servers (3111/3113 and 8000). agentmemory binds to loopback by default. MCP Memory Service&#39;s <code>MCP_ALLOW_ANONYMOUS_ACCESS=true</code> quick start should never be exposed beyond localhost.</li></ul>"
}
