A session, with memory
Every session of a coding agent starts from zero: the project's conventions,
your preferences, the lesson that cost an hour yesterday, all gone. With agmem
installed, a session opens like this instead:
# Memory context (spaces: atlas + user)
## Instructions
- Never force-push to main `01M14XWWAXJG…`
## Profile
- The user prefers Go over Python for command-line tools `01M14XY6T7RX…`
## Relevant
- atlas deploys with bin/ship.sh; the old `make deploy` target is gone `01M16TXAAD2K…`
- Branch feat/retry-queue: the channel version replaced the mutex one after it
deadlocked under the retry path; next is the backoff test `01M1QP2RV8NA…`
## Lessons
- The build breaks on a cold cargo cache `01M14Y0PB3WD…`
That block is put in front of the model before its first token, aimed at the
branch you are on. While the agent works it recalls in words before it
assumes something, and at a seam — a decision made, a push, a question you
answered — it remembers one claim at a time. When the context gets long,
a hook says so, and /agmem:checkpoint writes the session's durable state
back to the store:
Stored 4 claims (3 fact, 1 lesson), 1 superseded; left out the diff, git has it.
You can /clear now — the next session starts with this in front of it.
Then /clear, and the next session picks up where this one left off, with no
compaction and no re-explaining. That is the whole loop.
What makes it different from a hosted memory layer:
- Local and offline. SurrealDB embedded in the process, an embedding model
on llama.cpp fetched on first run. Nothing leaves the machine.
- The agent is the author. agmem never rewrites a claim. It stores what it
is given, reports duplicates and neighbours, and lets the agent decide.
- Corrections, not contradictions. A wrong claim is superseded, never
overwritten. The old one stays readable and dated; one claim is live.
- Every answer explains itself. Recall hits carry the signals behind their
rank. Pages say what they cut. Deletions confirm their scope first.
- One store, many sessions. A shared daemon serves every window, worktree
and project on the machine, and a
ws:// URL shares it across machines.
Quick start
Three commands on macOS (Apple silicon) or Linux (arm64, x86_64, glibc 2.38+).
brew install AlfoldiMate/tap/agmem # 1. the binary
agmem --doctor # 2. self-check; downloads the model once (~314 MB)
claude plugin marketplace add AlfoldiMate/agmem \
&& claude plugin install agmem@agmem # 3. the Claude Code plugin
Open Claude Code in any project. The first session starts with an empty
briefing and a nudge or two; run /agmem:checkpoint before you close it, and
the second session opens with what the first one learned.
What --doctor prints, and where the data lives
$ agmem --doctor
ok data dir writable ~/Library/Application Support/dev.agmem.agmem
ok tool descriptions agmem's own wording
ok shared daemon not running; the next session starts one
ok single-writer lock held by this process
ok database open surrealkv://…/agmem.db
ok schema v9
ok write/read roundtrip scratch record created and removed
ok embedder embeddinggemma-300m-q8 (768d)
ok embedder vs store same model and width
ok vector coverage every row carries a vector
doctor: all checks passed
The report goes to stderr and the exit status is 0 only when every line
passed, so it doubles as a setup gate. --model bge-small-en-v1.5 picks the
36 MB light option if the download or the machine is the constraint. On Apple
silicon the model runs on Metal; elsewhere on the CPU.
| Platform | Data directory |
|---|
| macOS | ~/Library/Application Support/dev.agmem.agmem |
| Linux | ~/.local/share/agmem |
| Windows | %APPDATA%\agmem\agmem\data |