Blogs
May 2026AI in product4 min read

Give Your Coding Agent Memory in 5 Minutes

agentmemory is an open-source tool that lets Claude Code, Cursor, Copilot, and other agents remember your project across sessions. Here's how to run it.

Every new session, you re-explain the same things. Your architecture. The bug you already fixed. Why you picked one library over another. The agent forgets everything the moment you close it.

agentmemory fixes that. It's an open-source tool (Apache-2.0, 19k+ stars) that runs a small memory server on your machine. It quietly records what your agent does, turns it into searchable memory, and feeds the right context back at the start of the next session. One server works across Claude Code, Cursor, Copilot, Codex, Gemini CLI, and any MCP client.

Repo: github.com/rohitg00/agentmemory. Below is the shortest path to running it yourself.

Before you start

You need Node.js 18+ installed. That's it — no database, no Docker, no API keys. Check your version:

node --version
Step 1 — Try it with no install

The fastest way to see it work is npx. This downloads and starts the memory server on port 3111:

npx @agentmemory/agentmemory
Step 2 — Seed sample data and watch recall

Open a second terminal and run the demo. It loads three realistic sessions (JWT auth, an N+1 query fix, rate limiting) and runs searches against them:

npx @agentmemory/agentmemory demo
Search "database performance" and it finds the "N+1 query fix" — keyword matching can't do that.
Step 3 — Watch the memory build live

Open the real-time viewer in your browser. You'll see memories form as the agent works:

http://localhost:3113
Step 4 — Install it for real

npx caches per version and can serve a stale build. Once you're sold, install it globally so the bare agentmemory command works everywhere:

npm install -g @agentmemory/agentmemory
# if you hit EACCES on macOS/Linux, retry with sudo
agentmemory          # start the server
agentmemory stop     # tear it down
Step 5 — Wire it into your agent

Connect the server to whichever agent you use. For Claude Code:

agentmemory connect claude-code
# also: copilot-cli, codex, cursor, gemini-cli, ...
Step 6 — Confirm it's running

Check the health endpoint. A 200 response means the server is up and your agent now has persistent memory:

curl http://localhost:3111/agentmemory/health
Why this matters

Built-in memory like CLAUDE.md or .cursorrules caps out fast and goes stale — you maintain it by hand. agentmemory captures context automatically and retrieves it semantically, so the agent recalls *why* you made a decision, not just *what* the file says.

That's the difference between an agent that needs onboarding every morning and one that already knows your codebase. Five minutes to set up, and you stop repeating yourself.

N
Nirmit Meher

Product leader shipping across enterprise SaaS, AI in production, and 0→1. Writing about what actually ships — not what sounds good in a deck.