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 โ
Cursor AI is great at understanding your current codebase. But when you start a new session, it has no memory of:
Why did we choose PostgreSQL over MySQL? Why use async here? Cursor doesn't remember โ you explain again.
The UserService.get_by_id() returns User | None. You told Cursor this last week. It's forgotten.
Button styles go in ui/buttons.css. Modal components in ui/modals/. Cursor doesn't know.
User X prefers dark mode. This context is lost every session.
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.
# 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.
# 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"
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"
)
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"
)