## The problem: Cursor forgets everything

You open Cursor, explain your project architecture, your coding conventions, your deployment setup. Cursor does great work. Then you close the tab.

Next session — Cursor has no idea who you are. You explain everything again. And again. And again.

This is the fundamental limitation of all AI coding assistants: **the context window resets between sessions**. Cursor's context window is large, but it's temporary storage — not memory.

## The fix: persistent memory via MCP

Cursor supports **MCP (Model Context Protocol)** — a standard for connecting external tools to AI assistants. By connecting a memory MCP server, Cursor can:

- **Remember** your codebase architecture, tech stack, and conventions
- **Recall** past debugging sessions and what worked
- **Learn** your coding style and preferences over time
- **Build** a knowledge graph of your projects, people, and decisions

Everything persists across sessions, across devices, forever.

## Setup: 3 minutes

### Step 1: Get an API key

Sign up at [mengram.io](/#signup) (plans from $5/mo). Copy your API key from the dashboard.

### Step 2: Install the MCP server

```
pip install mengram-ai
```

Or if you prefer npm:

```
npx mengram-mcp
```

### Step 3: Configure Cursor

Open Cursor Settings → MCP Servers → Add new server.

For the pip install method, add this configuration:

```
{
  "mcpServers": {
    "mengram": {
      "command": "mengram",
      "args": ["server", "--cloud"],
      "env": {
        "MENGRAM_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

For the npx method:

```
{
  "mcpServers": {
    "mengram": {
      "command": "npx",
      "args": ["-y", "mengram-mcp"],
      "env": {
        "MENGRAM_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

Restart Cursor. You should see "mengram" in the MCP tools list.

### Step 4: Start using it

That's it. Cursor now has 12 memory tools available:

- `memory_add` — store a conversation or fact
- `memory_search` — find relevant past context
- `memory_profile` — get a full cognitive profile (system prompt from all memories)
- `memory_list` — browse all stored entities
- `memory_graph` — explore the knowledge graph
- `memory_stats` — see usage stats
- ...and 6 more for triggers, reflection, import/export, and dedup

## What Cursor remembers

Once connected, Mengram automatically extracts and organizes three types of memory from your conversations:

### Semantic memory (facts)

Facts about you, your projects, and your preferences:

- "Uses Next.js 14 with App Router and TypeScript"
- "Deploys to Vercel, database on Supabase"
- "Prefers functional components over class components"
- "Team uses ESLint with Airbnb config"

### Episodic memory (events)

What happened in past sessions:

- "Debugged a CORS error on March 15 — fixed by adding middleware"
- "Migrated from Prisma to Drizzle ORM last week"
- "Had a production outage caused by missing env variable"

### Procedural memory (workflows)

Learned step-by-step processes:

- "To deploy: run tests → build → push to staging → verify → promote to prod"
- "When fixing TypeScript errors: check tsconfig first, then look at imported types"

Procedural memory **evolves automatically** — when a procedure fails, Mengram updates it with what actually worked. [Learn more about the three memory types](/content/blog/semantic-episodic-procedural-memory/index.html).

## Real example: before and after

### Without memory (every session)

```
You: "Add a new API endpoint for user preferences"
Cursor: "What framework are you using? What's your project structure?
         Where do you put your routes? Do you use TypeScript?"
```

### With memory (after first session)

```
You: "Add a new API endpoint for user preferences"
Cursor: [recalls: Next.js App Router, TypeScript, Supabase, existing route patterns]
        "I'll create app/api/preferences/route.ts following your existing
         pattern with Supabase client and Zod validation..."
```

No re-explaining. Cursor already knows your stack, your patterns, your preferences.

## Tips for best results

### 1. Tell Cursor to save important context

After explaining something important, say: _"Remember this for future sessions."_ Cursor will use `memory_add` to store it permanently.

### 2. Ask Cursor to recall before starting work

At the start of a session, say: _"Search your memory for what you know about this project."_ Cursor will use `memory_search` to load relevant context.

### 3. Use Cognitive Profile for instant context

Say: _"Load my cognitive profile."_ This generates a complete system prompt from all your stored memories — architecture, preferences, past decisions — in one call.

### 4. Let memory build naturally

You don't need to manually save everything. Over time, the memory builds automatically from your conversations. The more you use Cursor, the smarter it gets.

## Cursor vs Claude Code memory

Both Cursor and Claude Code support MCP, so the setup is similar. The key difference:

- **Cursor**: MCP tools are available but you manually invoke them (or ask Cursor to use them)
- **Claude Code**: supports hooks that [auto-save and auto-recall](/content/blog/claude-code-memory-hooks/index.html) on every message — fully automatic

Both work with the same Mengram backend, so your memories sync across tools.

## Pricing

Plans start at $5/mo:

- **Starter** ($5/mo) — 100 adds, 500 searches
- **Pro** ($19/mo) — 1,000 adds, 10,000 searches, smart triggers
- **Growth** ($59/mo) — 3,000 adds, 20,000 searches, unlimited agents
- **Business** ($99/mo) — 8,000 adds, 30,000 searches, unlimited teams

See [full pricing](/#pricing) or [get started](/#signup).

## Get started

```
pip install mengram-ai
```

Get your API key at [mengram.io](/#signup), add the MCP config to Cursor, and your AI assistant starts building permanent memory from the first conversation.

Questions? [Open an issue](https://github.com/alibaizhanov/mengram/issues) or reply at [the.baizhanov@gmail.com](mailto:the.baizhanov@gmail.com).
