agent-memory
Cross-session memory for coding agents — plain files, git-native, no server.
Why
Agents start sessions blank. Keep facts, decisions, and unfinished work in Markdown you can read and edit.
Memory travels between agents via project files, between projects via org rules, and between machines via optional git sync. Claude Code and Codex share the store. No database, daemon, server, or runtime Python dependencies.
Quick Start
First time: install and bind. Every session after: recall context, capture decisions.
With your coding agent
Paste this into Claude Code or Codex from your repository:
Set up cross-session memory with agent-memory-cli from
https://pypi.org/project/agent-memory-cli/ and its source,
https://github.com/kiloloop/agent-memory.
Install with Python 3.10+. Ask for my home and project name, initialize and
bind this repository, and git-ignore the binding. Set up my runtime's hook
and workflow; report conflicts.
Capture a decision I provide, with its reason and runtime. Show status and
doctor. Next session here, recall context and report any truncation or sync
warning. Ask for my remote before enabling optional sync; keep pushing explicit.
Manually
Python 3.10+ is required; sync needs git 2.25+, hooks use Bash, and
archive/restore are POSIX-only.
-
Install with
uv tool install agent-memory-cliorpython -m pip install agent-memory-cli. The distribution and the command differ: installingagent-memory-cligives youagent-memory. Put it on your agent's PATH. -
Bind, from your repository root:
agent-memory init --home "$HOME/agent-memory" --project my-app --repo .
Git-ignore
.agent-memory.json. Stay here; unsetAGENT_MEMORY_HOME/OACP_HOMEor point them at this home: they precede the binding. -
Set up the runtime you use, then enable the hook there if required:
agent-memory setup claude # Or: agent-memory setup codex
-
Record now; recall next session in this repository:
agent-memory capture "Use SQLite for the cache." --why "no daemon" --agent codex agent-memory recall agent-memory status agent-memory doctor
Use
--agent claudeif appropriate; recall also works now for inspection. -
Optionally sync. Use an empty private remote.
enable --remotepushes the initial commit; substitute its URL:agent-memory enable --remote git@github.com:YOUR_ORG/agent-memory-store.git agent-memory push --agent codex # After another machine pushes, with a clean local tree: agent-memory pull
Elsewhere,
agent-memory clone <remote-url> --home <local-home>, then repeat binding and setup. Bind each machine separately; push explicitly.
How It Works
Illustrative files; not a bundled application UI.
OACP defines the layout; this tool implements it. The four active files in
projects/<name>/memory/ hold notes such as these trimmed samples:
| File | Purpose and sample |
|---|---|
project_facts.md |
Stable facts: FastAPI backend; Postgres; no PII in logs. |
decision_log.md |
Choices: 2026-05-09 — retry 5xx three times, with backoff and jitter. |
open_threads.md |
Work and owners: OAuth refresh race — waiting on Codex. |
known_debt.md |
Problems: replace the hard-coded session TTL with a setting. |
Date entries; supersede decisions by adding new ones. Close or pause threads, write for humans, and distill transcripts. Edit other files directly; promote debt to a thread when work starts.
org-memory/ sits beside projects/: recent.md, decisions.md, and
rules.md carry shared context; events/ and debriefs/ hold records.
Most notes belong to a project. Use org memory only across repositories.
Home resolution: --home → AGENT_MEMORY_HOME → OACP_HOME → nearest ancestor
.agent-memory.json → workspace marker → ~/agent-memory. A workspace marker
points into a home's projects/ tree. Project selection uses --project or a
matching binding/marker. OACP is not required.
Sync makes the home a git repository with an allowlist and .oacp-memory-repo
marker. push commits selected paths; pull fast-forwards a clean tree that
is not ahead or diverged. No merges; keys and setup receipts stay local.
Network verbs time out after 30 seconds.
setup installs a SessionStart hook and memory workflow. startup lists
metadata for the four project files, then the three curated org files; it
injects no content. --pull refreshes first, warning on failure. The workflow
tells the agent to run recall for an 8,000-character bounded read. Raise
--max-chars or read remaining files directly when cut. capture records
decisions during work. At the end, update threads and debt, optionally publish
a summary with debrief write, and explicitly push; no push hook is installed.
Startup and recall exclude archive/, events/, and debriefs/. This is not
a vector database, RAG pipeline, or chat-history store: no embeddings,
similarity queries, synthesis, or indexing. Recall reads a fixed file set.
Commands
| Command | Purpose |
|---|---|
status |
Inspect home and sync. |
doctor |
Check health; repair nothing. |
init |
Scaffold and bind. |
org init |
Scaffold org memory. |
enable |
Enable git sync. |
clone |
Clone a memory remote. |
pull |
Fast-forward from upstream. |
push |
Commit selected files and push. |
disable |
Disable sync. |
archive |
Archive a supplementary file. |
restore |
Restore to an empty slot. |
setup |
Install runtime integration. |
startup |
Print the metadata manifest. |
capture |
Record a decision. |
recall |
Read bounded context. |
debrief write |
Publish a session summary. |
Examples
Scratch run in /private/tmp/am-readme-demo: init/startup/recall excerpts;
other outputs complete.
$ agent-memory init --home memory --project demo
Initialized memory home: /private/tmp/am-readme-demo/memory
$ agent-memory startup --home memory --project demo --runtime claude --max-chars 420
agent-memory startup (claude): home /private/tmp/am-readme-demo/memory (flag), project demo (flag)
Project memory, read in this order (states are readability only; no content is injected):
$ agent-memory capture 'Use SQLite for the cache.' --why 'no daemon' --agent codex --home memory --project demo
captured: /private/tmp/am-readme-demo/memory/projects/demo/memory/decision_log.md (## 2026-09-07)
- **Use SQLite for the cache.** Why: no daemon (codex, 2026-09-07T01:53:42Z)
$ agent-memory recall --home memory --project demo --max-chars 850
## 2026-09-07
- **Use SQLite for the cache.** Why: no daemon (codex, 2026-09-07T01:53:42Z)
$ agent-memory status --home memory
home: memory
source: flag
exists: yes
marker: absent
gitignore: canonical
org-memory: present
projects: 1 with a memory dir
sync: not configured
$ agent-memory doctor --home memory
[+] Org Memory
[+] org-memory/debriefs/ — present
[+] debriefs/ — empty store, nothing to validate
[-] Memory Sync
[-] .oacp-memory-repo — not configured; memory sync hooks are disabled
Run: agent-memory enable [--remote URL]
No issues found.
Project
License
Apache-2.0. See LICENSE.
Development
Activate .venv before running the two make commands.
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
make preflight # lint, test, build
make wheel-check # install the built wheel in a throwaway venv and prove it operates a home
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_memory_cli-0.1.0.tar.gz.
File metadata
- Download URL: agent_memory_cli-0.1.0.tar.gz
- Upload date:
- Size: 138.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85beb4f8c24e2a3560e176dc53d26e5b108b98d7960c3f29faf9d3dcec4ac40d
|
|
| MD5 |
01b6ead29d42f9b5e483e0aae49d2b82
|
|
| BLAKE2b-256 |
0d2614e3490ccd6fa6a0cfc5c66ce1e4e67b00693e21bb1857e9066dcea47654
|
Provenance
The following attestation bundles were made for agent_memory_cli-0.1.0.tar.gz:
Publisher:
release.yml on kiloloop/agent-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_memory_cli-0.1.0.tar.gz -
Subject digest:
85beb4f8c24e2a3560e176dc53d26e5b108b98d7960c3f29faf9d3dcec4ac40d - Sigstore transparency entry: 2747142774
- Sigstore integration time:
-
Permalink:
kiloloop/agent-memory@30aff71ff6df938064f70d80cb740c66c98c9684 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kiloloop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@30aff71ff6df938064f70d80cb740c66c98c9684 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_memory_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_memory_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 86.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18defbd030f2dc8062fb36ccd095767f74e9ad16060a9eb87255c71316704238
|
|
| MD5 |
8883abe8f26ca37f40c7a0957f6cbccf
|
|
| BLAKE2b-256 |
07e84ffd9fbebb82023af25347b13b2fdc2d70a079c54ece359412d204b3c1c0
|
Provenance
The following attestation bundles were made for agent_memory_cli-0.1.0-py3-none-any.whl:
Publisher:
release.yml on kiloloop/agent-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_memory_cli-0.1.0-py3-none-any.whl -
Subject digest:
18defbd030f2dc8062fb36ccd095767f74e9ad16060a9eb87255c71316704238 - Sigstore transparency entry: 2747142869
- Sigstore integration time:
-
Permalink:
kiloloop/agent-memory@30aff71ff6df938064f70d80cb740c66c98c9684 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kiloloop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@30aff71ff6df938064f70d80cb740c66c98c9684 -
Trigger Event:
push
-
Statement type: