Skip to content

agent-mem

agent-mem records what your coding agents do, writes short facts from it in the background, and reminds every agent of what matters at the right moment. Nothing leaves your computer. Everything sits in one SQLite file, and you can browse it at http://localhost:37778.

  1. Install the command (macOS, Linux, Windows):

    Terminal window
    uv tool install "agent-mem[semantic,observer] @ git+https://github.com/Abuarchiv/agent-mem"
  2. Connect every agent installed on this machine:

    Terminal window
    agent-mem setup all --write
  3. Check that it works:

    Terminal window
    agent-mem doctor
  4. Start a session in any repository and send one request. The next session begins with what the first one learned.

A briefing at every start

Facts, decisions, failed attempts, preferences and the last session’s open steps, ranked by what has proven useful, within a token budget.

The right memory at the right moment

Matching memories for a prompt, only when the match is strong. The history of a file before it is read or edited. How an error was fixed last time.

Corrections that stick

Say “use pnpm instead of npm” twice and every agent is told before it runs npm. Switch the rule on and the command is blocked.

One memory for every agent

What Claude Code learned is there for Codex, Copilot and OpenCode, and the other way round.

Facts without an API key

The CLI you already pay for writes the facts in the background: Claude Haiku for Claude Code, GPT-6-Luna for Codex and Copilot, the free Big Pickle for OpenCode. A request never leaves its vendor.

Local and private

No telemetry, no cloud, no server. Secrets are removed before storage; <private> text is never stored.

Agents call agent-mem's hook, which records into memory.db and returns context; background processes write facts with the agents' CLIs; MCP tools, the viewer and the CLI read the memory.
Open in Excalidraw
MomentWhat happens
Session startA briefing for the agent, a panel for you: project memory, which model writes facts, recent work, what needs your attention
You send a requestMatching memories, only when the match is strong; the terminal stays quiet
Before a command or editA note if it matches something you corrected, the file’s history, or a block for a rule you switched on
A command failsIf this error was fixed before, the agent sees how
The agent finishesThe request is saved; a background process writes facts, a title, the session summary and lessons
Once a dayDuplicates and replaced facts are retired; your own notes are never touched
CompactionSession goal, decisions and open problems are given back to the agent
Session endWhat was saved: requests, files, errors

Read Architecture Overview for the full picture.

AgentsClaude Code 2.x, Codex CLI 0.x, GitHub Copilot CLI 1.0.103, the Copilot app 1.1.29 (macOS), Copilot Chat in VS Code 1.142, OpenCode 1.19 and 2.2
Python3.11 to 3.14
OSmacOS (arm64; Intel without search by meaning), Linux, Windows
Install sizeabout 10 MB, plus 220 MB for search by meaning, plus about 400 MB for background facts