Executable programs and extensions
Last updated
agent-memory: making a coding agent remember across sessions
It keeps what used to vanish when a session closed
agent-memory is a runtime1 that keeps a coding agent's memory in Markdown files. The files are the source of truth and the SQLite index is a cache you can delete and rebuild. Recall answers with paths and summaries rather than pasted text, so the agent opens only as much as the task needs.
It keeps what used to vanish when a session closed
An agent forgets what it learned when it closes a session. Which file it changed and why, which attempt failed: none of that is there next time. agent-memory is a runtime that closes that gap.
Memory tools have split into two lines. One is a retrieval engine built on embeddings and a knowledge graph; the other is a filesystem the agent reads directly. The first finds well but is hard to inspect, the second is legible but does not scale as a search surface.
This tool puts both in one store. The files stay as they are and an index sits on top, so the index searches and the files answer.
A memory is not a pasted block of transcript. It records what was done and why in one file, and links related files together.

Markdown is the source of truth and the index is a cache
Each memory is a Markdown file. Links inside a file carry relations, and files in the same folder are neighbours, so relations survive without a graph database underneath.
| Path | What happens |
|---|---|
| Injection at session start | Reads MEMORY.md as is |
| Index search | Searches FTS5, optionally fused with vectors |
| Plain directory walk | Finds with ls and grep |
The index can be deleted at any time. Removing it and rebuilding loses no knowledge, and that is enforced by a test rather than promised in a document.
rm -rf .index/ && mem rebuildInstall it and create a store
It is not on PyPI yet, so you install from a checkout. It needs Python 3.12 or later, and installing builds the mem command, the MCP2 server and the hook binaries.
uv sync --all-packagesAfter creating the store you attach it to the agent you use. Each host keeps its settings in a different place, so the command takes the host name.
Recall answers with paths and the files do the reading
A search returns a one-line abstract, the file path and a score, not the text itself. The agent looks at that list and opens only the files it needs, at the depth it needs.
| Stage | What comes back |
|---|---|
| List | One-line abstract, path, score |
| Outline | Headings only |
| Abstract | The file's abstract |
| Full text | The whole file |
| Raw trace | The cited raw messages |
Pasting text fills the context quickly and makes it hard to see what was read. Answering with paths leaves a record in the transcript of which files were opened and which were not.

Writes happen at conversation boundaries
It does not wait for the agent to decide to write something down. Distillation starts at the point where a conversation breaks, and it does not hold up the work in progress.
What is worth keeping usually surfaces when a task ends. The choice that was made and what failed get captured then.
The raw trace is copied before distillation. Something the distiller misses is therefore never lost by the system.
There is no model client inside the library. Judgment is borrowed from the host agent's CLI3, and it stays visible in the transcript.
It consolidates and forgets while the agent sleeps
A consolidation pass runs when there is no conversation. It merges what came in and forgets what has low value. It runs on its own cycle instead of waiting for a request.
What the unattended pass may and may not do is separated. It adds and updates on its own, but deletion only arrives as a proposal you confirm.
Forgetting is a feature. The same fact scattered across files duplicates search results, and an old decision can hide the current one.
Updating does not erase the earlier record. Asking as of a date answers with the memory as it stood then, so you can trace what changed when.

It compared memory against no memory
The developer measured a reduced LongMemEval-S with 120 episodes. The haystack was bounded to 12 sessions, the host was Claude Haiku 4.5 and a Sonnet 5 judge scored the answers.
| Approach | Correct |
|---|---|
| agent-memory | 52.9% (127/240) |
| MemCore | 35.8% (86/240) |
| No memory | 5.8% (7/120) |
These numbers do not measure writing quality or reasoning. They look only at how accurately facts from earlier sessions come back.
Three hosts share one store
A memory written by Claude Code is found by Codex CLI and picked up again by Hermes. All nine ordered writer/reader pairs across the three hosts passed, with specifics intact.
Memory carries across hosts because the store is files. A store trapped inside one app's database cannot be read by another app.
Compared with starting without memory, correct answers rose from 2 of 36 to 13 of 36. Memory carries over even when the host changes.
It is an early version, so check these points
The version is 0.1.0 and it is not on PyPI yet. Command names and settings can change, so follow the documentation that matches the version you installed.
The measurement bounded the haystack to 12 sessions. That makes it a study of write strategy rather than a comparison at corpus scale.
Switching agents means installing the hooks and settings again. The memory stays as Markdown, but which host writes and when depends on the settings.
Terminology notes
Runtime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.
Back to the textMCP — A protocol for connecting clients to tools and data sources a model may use. Connectivity and permission to execute a particular tool must still be configured separately.
Back to the textCLI — Short for Command-Line Interface: operating a program by entering commands in a terminal.
Back to the text
Frequently asked questions
- What should you check first in this article?
- agent-memory is a runtime that keeps a coding agent's memory in Markdown files. The files are the source of truth and the SQLite index is a cache you can delete and rebuild. Recall answers with paths and summaries rather than pasted text, so the agent opens only as much as the task needs.
Read next
Executable programs and extensions
Running several coding agents at once on a Mac with Locals
Executable programs and extensions
Local AI Agent Security: Check Permissions, Network Paths, and Secrets
Executable programs and extensions
Laya-MLX: a decision model that answers in 13 ms on a Mac
Executable programs and extensions
Find slow steps in a local agent with Langfuse
