# Give your AI agent long-term memory

> How do I give Claude, Cursor or my own agent memory that lasts between sessions?

Most agents forget everything when a session ends. A memory layer stores what the agent learns and brings the relevant parts back later. The options range from a library you build into your own agent to plain files your coding assistant can read.

A hand-picked shortlist from the Agent Search Engine index. Every pick is a real listing; the adoption, pricing, and activity figures are the index's live numbers. Browse on the web: https://agentsearchengine.app/use/give-agent-long-term-memory

## Recommended picks

### For your own agents: mem0
- Open source · Infrastructure · 66k★ · Python · Apache-2.0 · active today
- **Setup:** Developer — library or service
- **Why:** The most-starred memory layer in the index, used to add persistent memory across sessions and users to agents you are building.
- [listing](https://agentsearchengine.app/agents/mem0) · [official](https://mem0.ai)

### Memory you can read: Basic Memory
- Open source · MCP server · 4.0k★ · Python · AGPL-3.0 · active today
- **Setup:** Config entry — uvx
- **Why:** Stores what the assistant learns as local Markdown notes linked into a knowledge graph, which you can open and edit yourself, and works with Claude, Codex, Cursor and ChatGPT.
- [listing](https://agentsearchengine.app/agents/basic-memory) · [official](https://basicmemory.com)

### For coding agents: Engram
- Open source · MCP server · 6.8k★ · Go · MIT · active today
- **Setup:** Install — Homebrew binary
- **Why:** Project memory for coding agents in a single Go binary with SQLite full-text search, exposed over MCP, with no Node.js, Python or Docker to install.
- [listing](https://agentsearchengine.app/agents/engram) · [official](https://engram.gentlemanprogramming.com/)

## What to watch for
Memory is where agents quietly go wrong: a mistaken fact saved once gets retrieved and repeated for months. Prefer stores you can inspect and correct, keep personal or client data out unless you control where it is kept, and prune what the agent has saved from time to time.

---
Source: [Agent Search Engine](https://agentsearchengine.app) — more task-first guides: https://agentsearchengine.app/use
