Skip to main content

Persistent memory for AI agents via MCP

Project description

DevMemory

PyPI version License: MIT Python 3.11+ MCP

Persistent memory for AI agents. Every session starts where the last one ended.

What is DevMemory?

DevMemory is a long-term memory layer for AI coding agents, delivered via MCP. It lets Claude Code, Cursor, Windsurf, Codex, and any MCP-compatible agent remember decisions, lessons, and context across sessions — so they never start from zero.

Your AI agent stores memories as it works. Next session — same agent or a different one — it recalls what matters. No copy-pasting, no re-explaining.

The Killer Scenario

Session 1 — Claude Code, Monday afternoon:

You: "Let's use Qdrant for vector storage in this project."

Agent calls memory_store:
  content: "Architecture decision: using Qdrant for vector storage.
            Reason: cloud migration path + strong Python SDK."
  memory_type: "decision"

Session 2 — Cursor, Tuesday morning:

You: "What vector DB are we using?"

Agent calls memory_recall:
  query: "vector database choice"

→ Returns: "[DECISION] Architecture decision: using Qdrant for vector storage.
   Reason: cloud migration path + strong Python SDK.
   Project: my-app | Date: 2026-04-02"

Cross-agent, cross-session, zero friction.

Quick Start

# Install
pip install devmemory

# Initialize
devmemory init

# Set up your API key (for embeddings)
export PORTKEY_API_KEY=pk-...

# Auto-configure Claude Code (one command)
devmemory setup claude-code --write

# Done. Your agent now has persistent memory.

For other tools:

devmemory setup cursor --write
devmemory setup windsurf --write
devmemory setup codex --write

MCP Tools Reference

DevMemory exposes 6 tools via MCP that AI agents call automatically:

Agent Memory (Tier 1)

Tool Description
memory_store Store a memory — decisions, lessons, preferences, TODOs, notes. Accepts content, memory_type, tags, importance.
memory_recall Recall relevant memories via semantic search. Filter by project, memory_type, date range.
memory_forget Find and archive outdated memories. Preview first, then confirm to remove.

Project Context (Tier 2)

Tool Description
context_get Get a structured summary of everything DevMemory knows about the current project. Call at session start.
context_handoff Create a handoff note before ending a session — what was done, what's left, warnings for next session.

Knowledge Base (Tier 3)

Tool Description
knowledge_search Search ingested documents and code. Returns raw entries with source paths and relevance scores.

CLI Reference

Command Description
devmemory init Initialize config and data directory
devmemory memory store <content> Store a memory from the command line
devmemory memory list List stored memories
devmemory memory recall <query> Recall memories matching a query
devmemory memory forget <query> Find and remove outdated memories
devmemory context show Show project context summary
devmemory context handoff <summary> Create a session handoff note
devmemory setup claude-code Generate MCP config for Claude Code
devmemory setup cursor Generate MCP config for Cursor
devmemory setup windsurf Generate MCP config for Windsurf
devmemory setup codex Generate MCP config for Codex CLI
devmemory ingest <path> Ingest files into the knowledge base
devmemory ask <query> Ask a question (AI-synthesized answer)
devmemory search <query> Search the knowledge base
devmemory serve Start the MCP server

How It Works

┌─────────────────────────────────────────────────────────┐
│                   AI Agent Layer                        │
│                                                         │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌────────┐ │
│  │ Claude   │  │ Cursor   │  │ Windsurf │  │ Codex  │ │
│  │ Code     │  │          │  │          │  │        │ │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └───┬────┘ │
│       └──────────────┴──────────────┴──────────────┘    │
│                          │ MCP                          │
├──────────────────────────┴──────────────────────────────┤
│                  DevMemory MCP Server                   │
│                                                         │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────┐ │
│  │  Memory     │  │  Context    │  │  Knowledge      │ │
│  │  store      │  │  get        │  │  search         │ │
│  │  recall     │  │  handoff    │  │  ingest         │ │
│  │  forget     │  │             │  │                 │ │
│  └──────┬──────┘  └──────┬──────┘  └────────┬────────┘ │
│         └────────────────┴──────────────────┘           │
│                          │                              │
├──────────────────────────┴──────────────────────────────┤
│                    Storage Layer                        │
│                                                         │
│  ┌─────────────┐  ┌──────────────┐  ┌───────────────┐  │
│  │  Qdrant     │  │  SQLite      │  │  Git-aware    │  │
│  │  (semantic  │  │  (metadata,  │  │  project      │  │
│  │   vectors)  │  │   temporal)  │  │  scoping      │  │
│  └─────────────┘  └──────────────┘  └───────────────┘  │
└─────────────────────────────────────────────────────────┘

All data is stored locally in ~/.devmemory/. Memories are embedded for semantic search (Qdrant) and indexed temporally (SQLite). Projects are auto-detected from git.

Why DevMemory?

Without DevMemory With DevMemory
Every AI session starts from scratch Sessions resume where they left off
You re-explain decisions every time Agent recalls past decisions automatically
Context lost when switching tools Claude Code and Cursor share the same memory
No continuity between sessions Handoff notes ensure nothing is forgotten
Manual CLAUDE.md / .cursorrules maintenance Agent writes its own memories as it works

Pricing

Tier Price Includes
Free $0 3 projects, 1,000 memories, local storage
Pro $12/mo Unlimited projects & memories, cloud sync, cross-device
Team $29/mo/seat Shared team memory, permissions, onboarding

Documentation

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devmemory_mcp-0.2.0.tar.gz (263.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devmemory_mcp-0.2.0-py3-none-any.whl (74.6 kB view details)

Uploaded Python 3

File details

Details for the file devmemory_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: devmemory_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 263.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for devmemory_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a78114c70102543b8ea1be8770894fd3077a23564458d85d703e8723acb1e2b5
MD5 aef179bafa9c97c7c3a74611679905e8
BLAKE2b-256 0a9a451a27647a005335c8bae75e9aa6559c9e1b7787ecc71b649267040fc6be

See more details on using hashes here.

File details

Details for the file devmemory_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: devmemory_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 74.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for devmemory_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5994ef4b95ff120d0caad7e5a4f9f9518ea2de37ee8511c6d9c54925c2a33875
MD5 724255f3d6fbea8fba713abb4b43a086
BLAKE2b-256 c9967fa856d480746f995fe681784b7271cce4dac170d9705bda2e38c6a46e60

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page