
Cursor Memory: How It Works and How to Make It Persistent
Does Cursor have memory? Partly. Cursor memory is made of Rules you write and the context of the chat you are in; it does not carry conversations from one chat to the next on its own. Cursor's automatic Memories feature existed from June to November 2025 and has since been removed. What remains is static instruction files, plus whatever memory you connect through the Model Context Protocol. This guide covers each mechanism, where it lives, and how to set up Cursor persistent memory that survives new chats and works outside the editor.
Does Cursor have memory?
Yes, but only the kind you write down. Cursor loads Rules (.cursor/rules, AGENTS.md, User Rules, Team Rules) at the start of every Agent chat, and keeps the current conversation, attached files and tool results in context until that chat ends. It does not read previous chats automatically and no longer generates Memories from them. Anything that should survive a new chat must be in a rule file or in an external memory store the agent can query.
What Cursor remembers today: Rules, Memories and AGENTS.md
Cursor's Rules documentation states the baseline plainly: "Large language models don't retain memory between completions. Rules provide persistent, reusable context at the prompt level." Everything Cursor "remembers" between chats is one of four rule types.
Project rules in .cursor/rules
Project rules are .mdc files in .cursor/rules/, version-controlled with the repository. A plain .md file in that folder is ignored because it has no frontmatter. Three frontmatter fields decide when a rule is included:
alwaysApply | description | globs | Behavior |
|---|---|---|---|
true | — | — | Included in every chat; globs and description are ignored |
false | — | provided | Auto-attached when a matching file is in context |
false | provided | omitted | Agent reads the description and pulls the rule in when relevant |
false | omitted | omitted | Included only when you @-mention the rule |
A file-scoped rule looks like this:
Save it as .cursor/rules/payments.mdc. Cursor's docs recommend keeping each rule under 500 lines, splitting large rules into composable ones, and referencing files instead of pasting their contents; a mention like @src/payments/README.md tells the agent where to look, and the file is not inlined into the prompt. Create rules with /create-rule in chat or from Customize → Rules in the sidebar.
AGENTS.md
AGENTS.md is plain markdown with no frontmatter. Cursor reads it from the project root and from subdirectories; nested files are combined with their parents, with the more specific file taking precedence. It follows the cross-tool convention documented at agents.md, so the same file is read by Codex, Claude Code and other agents. Use it for one readable instruction file shared across tools, and .cursor/rules when you need glob scoping or agent-selected rules.
User Rules and Team Rules
User Rules are global preferences set in Customize → Rules. They apply to every project and are used by Agent chat only, not by Inline Edit (Cmd/Ctrl+K) or Tab. Team Rules are managed from the Cursor dashboard on Team and Enterprise plans, and admins can enforce them. When guidance conflicts, Cursor applies Team Rules → Project Rules → User Rules, with earlier sources winning.
Memories (removed in 2.1)
Memories were Cursor's dynamic counterpart to rules. Cursor 1.0 introduced them in June 2025 as a beta: facts extracted from chats, "stored per project on an individual level," managed from Settings, according to the Cursor 1.0 changelog. Version 1.2 made them generally available and added user approval for background-generated memories. In November 2025, Cursor staff confirmed on the forum that "the Memories feature was intentionally removed starting from version 2.1.x" and advised exporting memories into Rules (forum thread). As of October 2026 the old docs URL redirects to the Rules page. If a tutorial tells you to enable Cursor Memories in Settings → Rules, it describes a version that no longer exists.
Chat context
Within one chat, Cursor keeps the conversation, attached files and tool results in context. Start a new chat and none of it carries over unless it was promoted to a rule. You can @Chats to pull a previous conversation into the current one manually, but that is a per-chat attachment, not memory.
| Mechanism | Written by | Scope | Status |
|---|---|---|---|
Project rules (.cursor/rules/*.mdc) | You | One repo | Current |
AGENTS.md | You | One repo, nested per directory | Current |
| User Rules | You | All projects | Current |
| Team Rules | Admins | Whole team | Current (Team/Enterprise) |
| Memories | Cursor | One repo, per user | Removed in 2.1 |
| Chat context | The session | One chat | Current |
How do Cursor Memories work?
Many search results still describe Memories as current, so it is worth recording how they worked and what replaced them.
According to Cursor's 2025 documentation, memories were created two ways: a sidecar model observed conversations in the background and extracted facts it judged worth keeping, and the agent could create a memory through a tool call when you asked it to remember something. From 1.2 onward, background-generated memories required your approval. They were scoped to one project and one user and listed under Settings → Rules, where you could review and delete them.
Two details mattered for teams. Memories were unavailable with Privacy Mode enabled; Cursor staff explained on the forum that both the memory contents and the index used to select them were stored on Cursor's infrastructure, not on your device. And nothing was shared: a memory one developer accumulated was invisible to a teammate opening the same repository.
When the feature was removed, the migration path was to run "Export memories" from the Command Palette, which saves them to an .mdc file you can move into Project or User Rules. Users on 2.1 and 2.2 reported that old memories still reached the agent's context without a UI to manage them; the documented workaround was to roll back to 2.0.77, delete them in Settings, and update again.
Two newer Cursor features reuse the word "memory," and neither reaches an ordinary Agent chat. Automations have Memories that "let the agent read and write persistent notes across runs for the same automation," stored as a named entry (MEMORIES.md by default) outside the agent's working filesystem. Projects, which run on Cloud Agents, keep a set of files that sync across the machines their agents use. Both are scoped to that automation or Project.
Where is Cursor memory stored?
Each piece of Cursor memory lives somewhere different, which matters when you want to audit, share or delete it.
- Project rules:
.cursor/rules/*.mdcin the repository, optionally in subfolders. They travel with git, so every teammate and CI agent that clones the repo gets them. AGENTS.md: the project root and any subdirectory. Also in git.- User Rules: Cursor's own settings, under Customize → Rules. Not in any repository.
- Team Rules: the Cursor dashboard, applied to every member's Agent chats.
- Legacy Memories: Cursor's infrastructure, per project and per user. The "Export memories" command writes any remaining ones to a local
.mdcfile. - Chat history: inside the editor. You can attach earlier chats with
@Chats, but there is no queryable store. - MCP server configuration:
.cursor/mcp.jsonfor one project or~/.cursor/mcp.jsonfor every project. The memory itself lives wherever that server keeps it.
Privacy Mode affects this picture only at the edges. Rules are files sent with your prompt, like code; with Privacy Mode on, Cursor states that your code is not used for training, and nothing about where rules are stored changes. The Memories feature was the one component that required Privacy Mode off, and it is gone.
What are the limits of Cursor's built-in memory?
- No memory of previous chats. Does Cursor remember context from last week's session? Not unless someone turned it into a rule. The investigation, the dead ends, the reasons for a choice are gone when the chat closes.
- Static. Rules do not update as the agent learns. Keeping them accurate is manual work, and stale rules are harmful because the agent trusts them.
- No search. You cannot ask Cursor what was decided about a module two weeks ago. Rules are injected, not queried.
- No connections. A rule that says "use the shared API client" is not linked to the PR that introduced it or the exception a later chat agreed to. Contradictions sit side by side until a human notices.
- Editor-bound. Claude Code, Codex, and an agent running in CI cannot read Cursor's User Rules, and Cursor cannot read a session that happened in another tool.
AGENTS.mdis the one portable piece, and it is static text. - Prompt-bound. Everything above is loaded into the prompt, so memory competes with the code you want the agent to look at. That is why Cursor's docs say to keep rules short.
These limits are structural. Memory stored in files and injected into prompts cannot grow without cost. Cursor agent memory that keeps a record of decisions, investigations and outcomes needs to live outside the prompt and be retrieved selectively.
How to give Cursor persistent memory with MCP
Cursor supports the Model Context Protocol natively over three transports: stdio for local processes, and SSE or Streamable HTTP for local or remote servers. A Cursor memory MCP server exposes tools such as "remember" and "recall"; the agent calls them during a chat, and the server stores and retrieves data outside the prompt. Because the server is independent of the editor, the same memory can be used from Claude Code, Codex or a CI job.
Configuration goes in .cursor/mcp.json (project) or ~/.cursor/mcp.json (global). A vendor-neutral example with one local and one remote server:
Replace the package name and URL with the server you choose. Cursor resolves ${env:NAME}, ${workspaceFolder} and ${userHome} in command, args, env, url and headers, so secrets stay out of the file. Project-level mcp.json is committed and shared; a global one is personal. By default Cursor asks for approval before running an MCP tool, and Enterprise admins can allowlist servers and tools. Details are in the Cursor MCP docs.
Two habits make an MCP memory server useful rather than decorative. First, tell the agent when to use it: a project rule with alwaysApply: true that says to recall relevant memory before a task and store decisions afterwards, since otherwise the agent calls the tools only when asked. Second, point every tool at the same server and use one dataset per project, so a decision made in Cursor is available in Claude Code or a CI agent.
Cursor also exposes hooks in .cursor/hooks.json, including sessionStart, beforeSubmitPrompt and stop, which some memory integrations use to run recall and storage automatically around each chat. For a comparison of servers, see MCP servers for memory in AI coding assistants and the broader MCP memory guide.
How cognee gives Cursor persistent, shared memory
cognee is an open-source (Apache 2.0) memory engine that stores what you give it as a knowledge graph plus a vector index and returns the relevant parts on request. Its MCP server exposes remember, recall and forget over stdio, SSE and Streamable HTTP, and ships as the cognee/cognee-mcp Docker image. Cursor, Claude Code, Codex, Cline and Continue can all connect to the same instance.
1. Start the server
The two volumes keep memory across container restarts; without them the container discards its data when it stops. curl http://localhost:8000/health confirms it is up.
2. Add it to Cursor
Add the HTTP endpoint to .cursor/mcp.json (or ~/.cursor/mcp.json to use it in every project):
Open Customize, refresh the MCP server, and cognee's tools appear in the list. The local stdio configuration (uv --directory /path/to/cognee-mcp run cognee-mcp) is in the Cursor integration docs.
3. Make the loop automatic
In Agent mode, prompts like "Remember this file in cognee" or "Recall the authentication logic from cognee" call the memory tools directly. To avoid asking every time, add a rule:
What changes compared with rules alone
| Need | Rules | cognee memory |
|---|---|---|
| Standing conventions | Yes, the right tool | Not needed |
| "Why did we structure this module this way?" | Only if someone wrote it down | Recalled with the decision and its context |
| Context from Claude Code or Codex sessions | Only via AGENTS.md text | Yes, same server |
| Memory that grows past the prompt budget | No | Retrieved selectively |
| Conflicting decisions over time | Both kept, side by side | Linked in the graph; temporal mode keeps superseded facts with validity windows |
| Multiple developers | Git-committed rules | Shared datasets with read/write/delete/share permissions |
Self-hosting is free; Cognee Cloud has a free tier (1M tokens, 1 workspace) and a Standard plan at $1.00 per 1M tokens processed plus $5 per additional workspace, as of October 2026. The full tool list, including dataset management and code search, is in the MCP tools reference, and the MCP overview explains how the server fits next to the SDKs and the REST API.
Codebase memory: let Cursor remember the repository, not just the chat
Rules and conversation memory cover what people decided. They do not cover what the code is: which functions call which, what breaks if a module changes, where an endpoint is handled. Cursor re-derives that on every chat by reading files, which is slow for large repositories and incomplete for anything outside the files it happened to open.
cognee's code graph fills that gap. It indexes a repository into a graph of files, symbols, calls and imports without LLM calls or embeddings, so indexing is deterministic and cheap, and exposes it through the same MCP server as the decision memory. Questions like "who calls authenticate()", "what depends on this module" and "what is the impact of changing this function" return exact answers from the graph instead of a guess from grep. The codebase memory guide covers what to index, how to keep it fresh with CI, and how it combines with the decision memory above; the Cursor Cloud integration page has the managed setup.
Cursor memory best practices
- Treat
.cursor/rulesas the stable layer. Put conventions, commands and architectural constraints there. Use globs so a rule loads only when its files are in context, and reservealwaysApply: truefor the few rules that apply everywhere. - Use
AGENTS.mdfor what every tool should know. If your team also runs Codex or Claude Code, the rootAGENTS.mdis the one instruction file all of them read. - Migrate any leftover Memories. If you used Cursor before 2.1, run "Export memories", review the
.mdcoutput, and keep only what is still true. - Review rules the way you review code. Stale rules are followed as faithfully as fresh ones. When the agent makes the same mistake twice, fix the rule; Cursor's docs suggest tagging
@cursoron a GitHub issue to have the agent update it. - Put the changing record in an MCP memory server. Decisions, investigations and failed approaches do not belong in a prompt that loads every time. Store them where they can be retrieved selectively and shared with other agents.
- Scope memory per project. One dataset or namespace per repository, so recall for one codebase does not surface decisions from another.
- Mind privacy boundaries. A local
stdioserver or a self-hosted endpoint keeps memory on infrastructure you control; Cursor's docs recommend running sensitive servers locally and passing secrets through environment variables.
Claude Code memory, Codex memory, Hermes Agent memory and OpenClaw memory cover the same ground for those tools, and all of them can share one memory server; MCP memory explains the pattern they have in common. If your agents use Skills, structuring your skills with cognee and building self-improving skills for agents show how memory turns a static skill into one that learns. For the concepts behind the setup, see agent memory and what AI memory is.
FAQ
Does Cursor have memory between chats?
Only through Rules. Project rules in .cursor/rules, AGENTS.md, User Rules and Team Rules are injected into every new Agent chat, so anything written there persists. The conversation itself does not carry over. Cursor's automatic Memories feature was removed in version 2.1 in November 2025. For memory that accumulates on its own, connect an MCP memory server.
Does Cursor remember previous chats?
No. A new Agent chat starts with your prompt, your codebase and the rules that apply to it. You can attach a specific earlier conversation with @Chats, or turn a conclusion into a rule so it loads next time, but there is no built-in search over past chats and no automatic extraction of facts from them in current versions.
Where are Cursor memories stored?
Rules live in your repository (.cursor/rules/*.mdc, AGENTS.md) or in Cursor's settings (User Rules under Customize → Rules; Team Rules in the dashboard). The legacy Memories feature stored memories per project and per user on Cursor's infrastructure, according to Cursor staff; "Export memories" writes any remaining ones to a local .mdc file. Memory added through MCP is stored wherever that server keeps it.
How do I turn off Cursor Memories?
In current versions there is nothing to turn off: the Memories feature was removed in 2.1.x, and its Settings toggle with it. If old memories still influence the agent, run "Export memories" from the Command Palette, then ask the agent to delete all memories; if that fails, Cursor staff documented rolling back to 2.0.77, deleting them in Settings, and updating again. Automations Memories are separate and can be disabled in the automation's tool configuration.
Where are Cursor rules stored?
Project rules are .mdc files in .cursor/rules/ at the repository root, optionally in subfolders, committed to git. AGENTS.md sits in the project root or any subdirectory. User Rules are stored in Cursor's own settings under Customize → Rules and apply to all projects on that machine. Team Rules are managed in the Cursor dashboard and applied to every member's Agent chats.
Can Cursor use AGENTS.md?
Yes. Cursor reads AGENTS.md from the project root and from subdirectories, combining nested files with their parents and giving the more specific file precedence. It is plain markdown with no frontmatter, so it cannot be scoped by globs or selected by description the way .cursor/rules files can. Use it when one instruction file should be shared with Codex, Claude Code and other agents.
Can Cursor remember my codebase structure?
Cursor indexes your files for semantic search, but it does not keep a structural model of the code between chats; each session re-reads files to work out callers and dependencies. A code graph, such as the one cognee builds from a repository, stores functions, calls and imports as a graph and answers "who calls this" or "what breaks if this changes" exactly, through the same MCP server Cursor already uses for memory. See the codebase memory guide.
Is the cognee MCP server open source?
Yes. It is part of the Apache 2.0 cognee repository on GitHub and ships as the cognee/cognee-mcp Docker image, exposing remember, recall and forget over stdio, SSE and Streamable HTTP. You can run it locally, in Docker, or on your own infrastructure, or use Cognee Cloud for a managed setup.
Related reading


Cognee is the fastest way to start building reliable Al agent memory.




