agentmemory

Built from lessons across 1,000+ coding-agent sessions

Memory that survives the agent.

AgentMemory is a local, user-owned state layer for coding agents. Keep scratch work, daily evidence, topic notes, and durable decisions as plain Markdown, then retrieve what matters with optional qmd search.

npm version npm downloads GitHub stars MIT license
Claude Code OpenAI Codex Cursor Agent CLI

The systems argument behind AgentMemory

A transcript is not memory.

More than 1,000 sessions across Claude Code, Codex, Cursor, Pi, and OpenCode led to one conclusion: continuity requires judgment, not merely more stored activity.

A session records what the agent did. Memory is a judgment about what the next agent should know.
Read the full field report →
Evidence

Sessions, feedback, source material, and observed facts

Judgment

Extract, qualify, or discard what might matter later

Memory destinations
Scratch Daily Topic Durable
Use and maintain

Retrieve, supersede, invalidate, or forget

These are destinations for different needs, not a mandatory ladder. Evidence can also be discarded.

Why AgentMemory?

Coding-agent sessions preserve activity. AgentMemory gives the state worth carrying forward explicit lifetimes and a user-controlled home.

🧭 Different lifetimes and scopes

Route short-lived follow-ups, chronological evidence, continuing topics, and durable decisions to the right destination.

🧠 Curated continuity

Retain judgments that should affect future work instead of warehousing every transcript and abandoned path.

📁 Plain Markdown, local-first

Read, edit, diff, back up, or delete every memory. No database, cloud service, or vendor lock-in.

🔍 Explicit, optional retrieval

Skills load base context at session start and search related memory when a task needs it; qmd remains optional.

🤝 One memory, every agent

The same store works across Claude Code, Codex, Cursor, and Agent even as models and harnesses change.

🛠️ Inspectable and correctable

Provenance, temporal status, secret screening, supersession, and forgetting help keep memory aligned with reality.

Mutable state needs a different home.

Project instruction files are right for stable policy. AgentMemory carries the changing facts, decisions, and follow-ups that should shape future work.

  AgentMemory Hosted memory service Project instructions
Purpose Mutable accumulated state Managed application memory Stable project policy
Source of truth Local Markdown files Vendor-managed storage Repository file
Lifetimes and scopes Scratch · daily · topic · durable Product-specific One policy scope
Context delivery Session start + explicit search Product-specific Host-loaded policy
Portability Claude Code · Codex · Cursor · Agent Integration-dependent Repository-scoped
Account required No Typically No

See it in action

Memory is just markdown. Here's what your agent reads back at the start of every session.

# ~/.agent-memory/MEMORY.md

## Stack
Postgres for all backend services. #decision [[database-choice]]
URL-prefix API versioning (/v1/) to avoid CDN cache issues. #lesson

## Preferences
Neovim + LazyVim. Conventional commits. Run tests before every push.

# Recall it later, in any agent:
$ agent-memory search --query "how do we version the API" --mode semantic
→ URL-prefix API versioning (/v1/) to avoid CDN cache issues.

Install in under a minute

Grab the CLI, create your memory store, and wire it into every agent you use.

Install from npm

Use this when you want the latest CLI quickly on any platform.

npm install -g myagentmemory

Install from Homebrew

Fast install path for macOS users.

brew install jayzeng/agentmemory/agent-memory

Initialize memory

Create the memory directory and wire optional qmd integration.

agent-memory init

Install skill files

Wire memory workflows into Claude Code, Codex, Cursor, and Agent CLI in one command.

agent-memory install-skills

Setup in three steps

  1. Install `agent-memory` from npm or Homebrew.
  2. Run `agent-memory init` to create local memory storage.
  3. Run `agent-memory install-skills` to enable shared memory workflows across agents.