๐Ÿค– For Cursor AI

Give Cursor Persistent Memory

Stop re-explaining your codebase every session. agent-memory adds persistent memory to Cursor via MCP โ€” remember project conventions, API shapes, architectural decisions, and user preferences across sessions.

Last updated: March 2026 ยท View on GitHub โ†’

The Problem: Cursor Forgets Everything

Cursor AI is great at understanding your current codebase. But when you start a new session, it has no memory of:

๐Ÿ—๏ธ Architectural Decisions

Why did we choose PostgreSQL over MySQL? Why use async here? Cursor doesn't remember โ€” you explain again.

๐Ÿ“ก API Shapes

The UserService.get_by_id() returns User | None. You told Cursor this last week. It's forgotten.

๐ŸŽจ Design Conventions

Button styles go in ui/buttons.css. Modal components in ui/modals/. Cursor doesn't know.

๐Ÿ‘ค User Preferences

User X prefers dark mode. This context is lost every session.

The Solution: agent-memory for Cursor

agent-memory exposes persistent memory tools to Cursor via the Model Context Protocol (MCP). Cursor can now remember what you've taught it โ€” across sessions, automatically.

Quick Start

# Install agent-memory
pip install agent-memory

# Start the MCP server
python -m agent_memory.mcp_server

# In Cursor, the memory tools are now available.
# Cursor will remember your codebase forever.

What Cursor Remembers

Project Conventions

# Tell Cursor once:
memory_project_add(
  "Our REST API conventions: GET=list, POST=create, PUT=update. "
  "Base URL: /api/v2. Auth: Bearer token in Authorization header. "
  "Pagination: cursor-based with ?after=cursor param."
)

# Cursor remembers this forever.
# Every new session: "Use our API conventions"

API Shapes

memory_code_fact(
  "UserService.get_by_id(uid: str) -> User | None. "
  "User has fields: id, email, role, created_at. "
  "Cache: Redis with 5min TTL.",
  entity="UserService"
)

memory_code_fact(
  "ProductModel: id, name, price_cents, category_id. "
  "Prices stored as cents to avoid float issues.",
  entity="ProductModel"
)

Architectural Decisions

memory_decision(
  "Use PostgreSQL + Redis instead of MongoDB. "
  "Reason: better JSON support in PG 16, "
  "ACID compliance needed for transactions.",
  decision_type="database",
  status="accepted"
)

Comparison: Cursor Memory Options

Solution
agent-memory
Cursor Tab
MCP Protocol
โœ“ v3.2
โœ—
Persistent across sessions
โœ“ Forever
Context only
Semantic search
โœ“ Built-in
โœ—
TTL expiration
โœ“ Auto-cleanup
โœ—
Encryption
โœ“ AES
โœ—
No cloud required
โœ“ 100% local
โœ—
Open source
โœ“ MIT
โœ—

Try It

โ˜… Star on GitHub ๐Ÿš€ Demo