Skip to main content

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.

  1. Install with uv tool install agent-memory-cli or python -m pip install agent-memory-cli. The distribution and the command differ: installing agent-memory-cli gives you agent-memory. Put it on your agent's PATH.

  2. Bind, from your repository root:

    agent-memory init --home "$HOME/agent-memory" --project my-app --repo .
    

    Git-ignore .agent-memory.json. Stay here; unset AGENT_MEMORY_HOME/OACP_HOME or point them at this home: they precede the binding.

  3. Set up the runtime you use, then enable the hook there if required:

    agent-memory setup claude
    # Or:
    agent-memory setup codex
    
  4. 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 claude if appropriate; recall also works now for inspection.

  5. Optionally sync. Use an empty private remote. enable --remote pushes 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

Four project memory files with sample Markdown

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.
event write Publish an org-memory event.

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

Metadata

Release files for agent-memory-cli 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-memory-cli 0.1.2
File Size Uploaded Provenance
agent_memory_cli-0.1.2.tar.gz 165.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-memory-cli 0.1.2
File Interpreter ABI Platform
agent_memory_cli-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 265.1 kB

Release files / agent_memory_cli-0.1.2.tar.gz

Download URL agent_memory_cli-0.1.2.tar.gz
Size 165.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c9606b3b80f9aee3d7446e04f1276df23edfb8d1b735f4183ddb2f968a6b710d
BLAKE2b-256 checksum
How to use checksums
54ca948a5457aa452b85181df777a0cd5ec39f7cc0c36f858c0cd542d803b573
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / agent_memory_cli-0.1.2-py3-none-any.whl

Download URL agent_memory_cli-0.1.2-py3-none-any.whl
Size 99.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
067b7def42b62c52b77bb8dde7236c15e8dd8527ea9dd4fc03e50937e470e04b
BLAKE2b-256 checksum
How to use checksums
64d8d94e294d5f193458148bf6ce30570db8c0b4e085f40bb0a2e68ffdbdd6ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Security for agent-memory-cli 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_memory_cli-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page