Run This Ai
EN DE

Getting Started with AgentMemory: Install Memory for Claude Code, Codex CLI, and More

Step-by-step tutorial to install and configure AgentMemory for your AI coding agents. Connect Claude Code, Codex CLI, Cursor, Gemini CLI, and any MCP-compatible agent in 5 minutes.

AgentMemory Logo

Make Your Coding Agent Remember Everything β€” in 5 Minutes

I'll be straight with you: I wasted two hours trying to get persistent memory working with my coding agents before I found AgentMemory. I tried LangChain's memory module (too complex), tried hooking up a vector DB (way overkill), tried session prompting (lol). Nothing stuck.

Then I ran one npm command and everything changed. Here's exactly how to do it.

πŸš€ Want to deploy AgentMemory?

Docker Compose configs, system requirements, and installation guides β€” all on one page.

View AgentMemory Tool Page β†’

Step 1: Install AgentMemory

Open a terminal. Run one command:

npm install -g @agentmemory/agentmemory

That's it. If you hit an EACCES permission error on macOS/Linux (common with system Node), add sudo:

sudo npm install -g @agentmemory/agentmemory

Prefer not to install? Use npx (no install, runs on demand):

npx @agentmemory/agentmemory
⚠️ Heads up: If you're already running a different iii engine version, AgentMemory pins its own engine (v0.11.2). Stop the other engine first β€” AgentMemory runs independently in ~/.agentmemory/bin and won't touch your existing setup.

Step 2: Start the Memory Server

agentmemory

This starts the memory server on port 3111. You'll see output like:

✦ agentmemory v0.9.16
   iii engine v0.11.2
   Memory server running on http://localhost:3111
   MCP endpoint: http://localhost:3111/mcp

If you see this β€” congratulations. Your agent now has a place to store memories. Keep this terminal open (or run it as a background service).

Step 3: Run the Demo (Prove It Works)

Before wiring your actual agent, run the demo to make sure everything works:

agentmemory demo

This seeds sample sessions, proves recall works, and shows you the output. Or run it as a one-shot server + demo + teardown in a single command:

agentmemory demo --serve
AgentMemory Demo

Step 4: Wire It to Your Coding Agent

This is where the magic happens. AgentMemory connects to every major coding agent. Here are the most common setups:

AgentCommand
Claude Codeagentmemory connect claude-code
Codex CLIagentmemory connect codex
Copilot CLIagentmemory connect copilot-cli
Cursoragentmemory connect cursor (MCP)
Gemini CLIagentmemory connect gemini-cli (MCP)
Hermesagentmemory connect hermes
AiderREST API β€” http://localhost:3111

For any MCP-compatible client (Cline, Goose, Kilo Code, OpenCode): just point it to http://localhost:3111/mcp.

Bonus: Install the AgentMemory native skills for agents that support them:

npx skills add rohitg00/agentmemory -y

This adds 15 skills (8 invocable + 7 reference) so your agent knows when to use memory tools automatically.

What I Wish I Knew Before

  • Memory is automatic. Claude Code's 12 hooks capture context without you asking. Codex CLI has 6 hooks. Your agent stores memories as it works β€” you don't need to manually save.
  • Check the viewer. Open http://localhost:3111 in your browser to see what memories your agent has stored. It's addictive.
  • If something breaks: agentmemory --reset clears all data and restarts fresh. I've used this twice when testing different agent configs.
  • The memory server uses ~50MB RAM idle. Negligible for any modern dev machine.

That's It

Five minutes from zero to persistent memory. Your agents will stop asking "what's the project structure" and start shipping. Give it a try β€” I promise it's the quality-of-life upgrade you didn't know you needed.

πŸš€ Explore AgentMemory on Run This Ai

Docker Compose configs, system requirements, installation guides, and more β€” all in one place.

View AgentMemory Tool Page β†’
#tutorial #persistent-memory #coding-agents #claude-code #installation