# How I Gave My AI Coding Agent Persistent Memory in 2 Minutes

> Source: <https://dev.to/debragail/how-i-gave-my-ai-coding-agent-persistent-memory-in-2-minutes-581l>
> Published: 2026-07-07 22:38:10+00:00

Every AI coding session starts the same way: you explain your project, your conventions, your preferences, and the context from last week's debugging session. Then you do it all again tomorrow.

I built [Engram](https://getengram.app) to fix this. It gives ChatGPT, Claude Code, Cursor, and Windsurf a persistent memory that survives across sessions — so your AI actually remembers what you discussed yesterday.

AI assistants are stateless. Each session starts from zero. There are workarounds:

None of these capture the *full arc* of a conversation — the trade-offs you evaluated, the bugs you investigated, the reasoning behind decisions.

Engram stores your conversations verbatim and makes them searchable by meaning. When your AI starts a new session, it can search your history and pull in relevant context from days or weeks ago.

It works through [MCP](https://modelcontextprotocol.io) (Model Context Protocol), so any compatible client can use it. Your AI gets three core tools:

`search`

— "what did we decide about the auth flow?" finds the relevant conversation even if you never used those exact words`create_conversation`

/ `append_messages`

— stores new conversations automatically`vault_set`

/ `vault_get`

— key-value store for structured factsUnder the hood, conversations are chunked and embedded using vector embeddings. Search is semantic — it matches by meaning, not keywords.

`https://mcp.getengram.app/mcp`

That's it. No CLI, no API keys, no install. ChatGPT can now search your history and store new conversations.

Try asking: *"What did we discuss about [topic] last week?"*

Add to your MCP config (`~/.claude/settings.json`

):

```
{
  "mcpServers": {
    "engram": {
      "type": "http",
      "url": "https://mcp.getengram.app/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

Then add a few lines to your `CLAUDE.md`

telling Claude to search on session start:

```
## Memory

On session start, search Engram for context relevant to the current task:
- search query: "<summary of what the user is asking about>"

When important decisions or context are established, store them in Engram.
```

For zero-friction capture, install the CLI:

```
npm i -g @getengram/cli
engram daemon start
```

The daemon runs in the background and auto-captures every Claude Code session. You don't have to prompt Claude to remember things — it just happens.

Same as Claude — add the MCP server URL + API key to your MCP config. Both support MCP natively.

After a few weeks of use, here's the kind of context Engram surfaces for me:

The key difference from CLAUDE.md: I don't maintain any of this manually. Conversations are stored as they happen, and the right context surfaces when it's relevant.

The backend runs entirely on Cloudflare:

When you store a conversation, Engram:

When you search, it:

The whole thing is globally distributed with sub-100ms cold starts.

The source is on GitHub under BSL-1.1 (converts to Apache 2.0 after the change date). You can self-host the whole thing on Cloudflare's free tier with `wrangler deploy`

.

**GitHub:** [github.com/get-engram/engram](https://github.com/get-engram/engram)

I'm working on:

If you're tired of re-explaining yourself to your AI every session:

`https://mcp.getengram.app/mcp`

`@getengram/cli`

for auto-captureThe free tier is enough to see if it's useful for your workflow. I'd love to hear what context you find yourself repeating the most.

[Engram](https://getengram.app) is built by [Get Engram Inc](https://github.com/get-engram). Questions? [hello@getengram.app](mailto:hello@getengram.app)
