Blog·Learning

Building Cursor Memory via MCP & Supermemory (May 2026)

By Shardul Mane·9 min read

Cursor has a context window, not a cursor memory system, and that gap is easy to underestimate until a project runs long enough to feel it. You end up re-explaining your stack, your conventions, your constraints, over and over across sessions. Pairing a file-based memory bank with cursor mcp memory changes that: context gets stored, retrieved semantically, and scoped so token costs stay manageable. Here's how the pattern fits together.

TLDR:

  • Cursor has a context window, not a memory system. Each session starts cold by default.
  • A memory-bank/ directory with 4 structured Markdown files gives Cursor persistent, version-controlled context across sessions.
  • Rules files are static conventions; memory banks are living records that update as your project evolves.
  • Wire in a memory MCP server via .cursor/mcp.json to persist context across multiple repos and sessions.
  • Supermemory's Profiles, Connectors, and SuperRAG (Retrieval) primitives scope, sync, and fetch memory without redesigning your setup.

Why Cursor Loses Context Between Sessions

Cursor has a context window, not a memory system.

Each new chat session starts with whatever you explicitly hand it: open files, written rules, typed instructions in the prompt. Close the tab and the session is gone. The LLM underneath is stateless by design. Each API call is independent, and Cursor doesn't persist conversation history across sessions by default.

On short tasks, that's manageable. On longer projects, the cost compounds quietly. Architectural decisions, module conventions, the reasoning behind a tricky refactor: none of it gets written down automatically. If it only lived in the conversation, it's gone. The next session starts cold, and you spend the first few minutes re-explaining context that should already be there.

The Memory Bank Pattern

The pattern traces back to the Cline community, where developers started capturing project state in plain files that the agent could read at the start of each new session. The cursor-memory-bank project gave this a repeatable structure, and from there it spread into the Cursor ecosystem. Writing on cursor rules and memory banks tracks how that adoption developed across both tools.

The mechanic is straightforward. A memory-bank/ directory sits inside the project repository, holding structured Markdown files covering active context, architectural decisions, work in progress, and system conventions. Cursor reads these files before each task. Because the context lives in the repo, it's version-controlled alongside the code it informs. The agent reads the files, gets up to speed, and picks up where the last session left off. No special runtime, no plugin required at this stage.

Core Memory Bank Files and What Goes in Them

Four files form the memory layer's foundation. Here's what belongs in each:

  • projectbrief.md holds the project's purpose, scope, and non-negotiable constraints. Every other file defers to this one.
  • activecontext.md tracks what's being worked on right now: the current task, recent decisions, and any open blockers.
  • progress.md logs what's done, what's pending, and what's been abandoned with a reason.
  • techstack.md documents the actual tools, versions, and architectural choices in use.

Cursor reads these files at the start of each session, so keeping them current is what separates a useful memory bank from one that silently drifts out of sync.

Cursor Rules vs. Memory Banks

Cursor Rules files and memory banks solve adjacent problems, but they are not the same thing.

Rules files are static. You write them once, commit them to the repo, and Cursor injects them into every prompt. They are great for coding conventions, architectural decisions, and team standards that rarely change.

Memory banks are living records. They update as your project evolves, capturing decisions made mid-session, user preferences learned over time, and context that would otherwise vanish when the conversation window closes. Building LLMs with long-term memory follows a similar pattern.

The distinction matters in practice: Rules files tell Cursor how to behave. Memory gives Cursor something to remember.

Dimension Cursor Rules Files Memory Banks
Nature Static: written once, rarely changed Living: updated as the project evolves
Best for Coding conventions, team standards, architectural guidelines Decisions made mid-session, current task state, evolving context
Persistence Committed to the repo; injected into every prompt unchanged Version-controlled in memory-bank/; read at session start
Update cadence Infrequent; only when standards change Continuous; updated whenever the project state changes
What Cursor gets How to behave Something to remember

The Plan/Act Workflow

Cursor operates in two modes that shape how memory fits into your workflow. In Plan mode, the agent reasons about what to do. In Act mode, it executes. Memory reads happen in Plan, writes happen in Act.

When Cursor enters Plan mode, it calls the MCP recall tool to pull relevant context from Supermemory before generating a response. When Act mode completes a task, it calls store to save what was learned. This is what makes stateful coding agents possible. The cycle repeats across sessions.

This separation keeps retrieval purposeful. You're not flooding every prompt with stored context; you're fetching only what the current reasoning step needs.

How MCP Connects External Memory to Cursor

MCP is an open standard that gives Cursor a uniform interface for reaching external tools and data sources. Configuration happens through a single file at .cursor/mcp.json, where you register the servers Cursor is allowed to call.

Wire in a memory MCP server and the behavior changes meaningfully. Cursor gains callable tools mid-conversation: saving a fact, searching prior context, pulling project knowledge that lives completely outside the repository. The agent treats these tools the same way it treats file reads or terminal commands. No special prompt engineering required.

The ecosystem behind this has grown fast. Over 5,000 community MCP servers had been published by March 2026, with memory-focused servers among the most actively developed categories.

When Per-Project Memory Is Not Enough

Cursor's per-project memory works well inside a single repository. The moment you start working across multiple codebases, that mental context evaporates. Decisions made in one repo don't carry over. Preferences you've repeated a dozen times get forgotten the next session.

This is where cursor memory gaps become a real productivity drain. You end up re-explaining your stack, your conventions, your constraints, over and over.

MCP changes what's possible here. With a cursor mcp memory setup, you can route context through an external memory layer that persists across every project and every session.

Token Cost as a Design Constraint

Every MCP tool call consumes tokens. That matters more than most teams realize when they're designing memory patterns for Cursor.

A naive approach fetches everything: full documents, entire conversation logs, all stored context. Each retrieval bloats the context window and raises per-request costs. At scale, that compounds fast, and memory retrieval latency becomes a real bottleneck.

The pattern we use at Supermemory keeps retrieval scoped. SuperRAG (Retrieval) pulls only what's relevant to the current query. Profiles surface a concise user or project summary, not raw history. The result is a smaller, denser context that costs less and performs better.

Token budget is a first-class design decision, not an afterthought.

Practical Considerations When Implementing Cursor Memory

Keep sensitive files out of version control from the start. Add .gitignore entries for memory files containing credentials, API keys, or session content before the first commit, and store secrets in environment variables. Building LLM memory in-house carries costs that go beyond initial setup.

Treat AI-generated memory writes the way you'd treat a pull request. A stale architectural summary that sounds authoritative will mislead future sessions more than a blank slate. As the project grows, reviewing the memory bank periodically is part of keeping the agent accurate, not optional cleanup.

Adding Supermemory Primitives to the Pattern

The pattern we've built so far handles routing and retrieval, but Supermemory's primitives (and I'll be transparent, this is our product) let you go further without redesigning the whole system.

Start with Profiles. Each Cursor workspace or user gets its own Profile, so memory stays scoped and never bleeds across projects. Choosing the right memory APIs for stateful agents shapes how well this scales. Pair that with Connectors to pull in context from wherever your team already works: GitHub issues, Notion docs, Slack threads. The memory Cursor draws from stays current without manual syncing.

SuperRAG (Retrieval) handles the actual fetch. It runs the semantic search against stored memories and returns ranked, relevant context in time for the next prompt.

That's three primitives doing distinct jobs, composably.

Final Thoughts on Keeping Cursor Informed Across Every Session

A well-maintained memory bank keeps Cursor informed without asking you to re-explain your stack at the start of every session. MCP memory servers extend that to cross-project context, so your conventions and decisions follow you wherever your work goes. The main thing to get right is keeping your memory files current, since stale context is quietly worse than no context. Start at console.supermemory.ai to connect an external memory layer to your Cursor setup.

FAQ

What's the difference between Cursor Rules files and a memory bank?

Cursor Rules files are static: written once, committed to the repo, injected into every prompt unchanged. A memory bank is a living record, updating as the project evolves to capture decisions made mid-session and context that would otherwise disappear when the conversation closes. Rules files tell Cursor how to behave; a memory bank gives Cursor something to remember.

Should I use per-project memory banks or route through an external MCP memory layer?

Per-project memory banks work well inside a single repository, but the moment you work across multiple codebases, that context evaporates between sessions. A cursor mcp memory setup routes context through an external memory layer that persists across every project and every session, so preferences and architectural decisions you've built up in one repo are available in the next.

How do I keep token costs from spiraling when adding cursor memory via MCP?

Scope your retrieval to what the current reasoning step actually needs. A naive approach fetches full documents and entire conversation logs, which bloats the context window and raises per-request costs fast. Supermemory's SuperRAG (Retrieval) primitive pulls only semantically relevant context, while Profiles surface a concise project summary instead of raw history; the result is a smaller, denser context that costs less and performs better.

Cursor memory bank vs cursor plugin memory: which pattern fits a growing codebase?

A memory bank alone handles single-repo context well but has no mechanism for cross-session or cross-project persistence. Cursor plugin memory through an MCP-connected layer adds that persistence without replacing the memory bank structure; the two patterns compose and complement each other. For a growing codebase where architectural decisions compound over weeks, combining both gives you version-controlled local context and a durable external memory layer.

How do I prevent stale memory bank files from misleading future Cursor sessions?

Treat AI-generated memory writes the way you'd treat a pull request: review them before they become the authoritative record. A stale architectural summary that sounds confident will mislead future sessions more than an empty file. Reviewing the memory bank periodically as the project grows is part of keeping the agent accurate, not optional cleanup.

  1. An update to supermemoryWe've discontinued the supermemory company brain and Nova. Everyone who was charged has been refunded, our MCP and plugins continue to run, and we're going all in on the memory engine.
  2. SMFS: making agentic retrieval 55% cheaper AND more accurateWe launched SMFS.ai (Supermemory Filesystem) a few weeks ago, with a simple bet: We can redesign the filesystem specifically for agents, with special files, structures, and commands that it can use for it's tasks. Today, SMFS is used by hundreds of companies to power their agents.
  3. Introducing Dynamic Dreaming: supermemory now connects the dots, for you.Dreaming is magical. TLDR: We're launching Dynamic Dreaming in supermemory today, which automatically works if you're using supermemory in any way - API, OpenClaw, Hermes agent, etc.
  4. Dear reader, we just made supermemory insanely cheap... the Context CloudWhen I first started building supermemory, I had one goal: To build the best memory system for AI. I would talk to customers, and find out that memory was not the only thing they needed - They were all setting up 7-8 different vendors at the same time.
  5. Introducing @supermemory/tools v2.0.0Today we're releasing v2.0.0. This release unifies the API across all agents sdk integrations from AI SDK to Mastra, makes conversation identity a first-class concept, and ships with memory saving on by default.
  6. supermemory will make your Hermes-agent crazy powerfulToday, we are launching supermemory support to your Hermes agent TLDR: you can use supermemory now in your Hermes agent, it totally free to get started - https://supermemory.ai/docs/integrations/hermes In case you missed it: Hermes Agent is a self-improving AI agent from Nous Research.
  7. Solving the Precision-Recall Tradeoff: Search Result AggregationWhen you're building memory for AI, search is your foundational layer. The way search generally works is straightforward: the user defines a query, and then sets a limit (top-K) on how many search results they want returned. Usually, this is set to 10 or 20.
  8. Infinitely running stateful coding agentsWe built a plugin for Claude Code and OpenCode that gives your coding agent persistent memory. It remembers your preferences, learns your codebase, and never loses context mid-conversation. The result is an agent you can run for months without starting over.
  9. Why everyone is complaining about OpenClaw's memory (it sucks) - and why supermemory fixes it.TLDR: Today, we are releasing a new version of our openclaw plugin - https://github.com/supermemoryai/openclaw-supermemory. This post is going to be a bit technical, so bear with me (or bookmark for later!) In this post, I will talk about what we do about OpenClaw memory, and how we fix it.
  10. We added supermemory to Claude Code. It's INSANELY powerful now...Today, we are launching the Supermemory plugin for Claude Code! TLDR: You can use supermemory in claude code now. - https://github.com/supermemoryai/claude-supermemory Claude code has genuinely changed how I work. But there's this one thing that drives me crazy...
  11. Clawd / Molt bot's memory SUCKS. We gave it supermemory.I'm the founder of supermemory. Clawd/Molt bot is blowing up right now, with many, many use cases. I set it up, too, and have been using it through telegram. TLDR: just go to https://supermemory.ai/docs/integrations/clawdbot to set up supermemory for your clawd bot.
  12. Catch up with our UNFORGETTABLE Launch WeekOver the last year, one belief has guided almost everything we’ve built at Supermemory AI becomes meaningfully useful only when it remembers. Memory shouldn’t be something developers rebuild from scratch. It shouldn’t be fragile, expensive, or trapped inside a single tool.
  13. Empowering the Next Generation of Founders: Supermemory Startup ProgramIf there’s one thing we’ve learned while building Supermemory, it’s that most startups don’t fail because they didn't build features; they fail when infrastructure slows them down, or they built too slow.
  14. Building code-chunk: AST Aware Code ChunkingAt Supermemory, we're building context engineering infrastructure for AI. A huge part of that is dealing with code: ingesting repos, understanding structure, and making it searchable. The problem is that most code chunking solutions are terrible. We built code-chunk to fix this.
  15. Supermemory raises $3 million with the best memory engine for LLMsToday, I am excited to announce our first funding round to accelerate our mission of building an interoperable, scalable and reliable memory for LLMs and agents. Memory is one of the hardest challenges in AI right now.
  16. Unified Memory That Works Where You Work: Your Second Brain With SupermemoryHi everyone, I’m Dhravya, the founder of Supermemory. I want to start with a little story behind why this product means so much to me. You can also skip straight to what it is and how it works below.
  17. Supermemory just got faster on PlanetScaleWhat is Supermemory? Supermemory completes the missing part of the LLM puzzle: memory. Just as memory is crucial for human intelligence, it's essential for truly intelligent AI systems.
  18. Faster, smarter, reliable infinite chat: Supermemory IS context engineering.People are obsessed with prompts and prompt engineering. Sure, what you say is important, but what the model knows when you say it is the difference between a stateless text generator and an intelligent AI system. In short, context is the most crucial component.
  19. We solved AI API interoperabilityOne API to rule them all, One spec to find them, One library to bring them all and in the TypeScript, bind them. When we were building the the Infinite Chat API, initially, we only supported the OpenAI format. This was fine, until a lot of our customers started asking, asking for more.
  20. The UX and technicalities of awesome MCPsLast month, we launched the Supermemory MCP, mostly to test our own infrastructure and get some initial traction. It blew up. To my absolute surprise, the initial launch itself got half a million impressions (!!!). Then, we launched and got #2 on ProductHunt too.
  21. Architecting a memory engine inspired by the human brainLanguage is at the heart of intelligence, but what truly powers meaningful interaction is memory — the ability to accumulate, recall, and contextualize information over time. Large Language Models (LLMs) have mastered language, but memory remains their Achilles’ heel.