Tiny file-based session memory for coding agents: remember, recall, list, summarise. No server, no API key, no GPU.
Tiny file-based session memory for coding agents: remember, recall, list, summarise. No server, no API key, no GPU, no embeddings.
Built by Xylos Labs as an open-source, reproducible project. The store is one JSONL file, one record per line, so you can read it, grep it, and back it up like any other file.
Install from PyPI:
pip install agent-memory-mini
Or install from source for development:
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Create the store (optional: `remember` creates it on first use)
python -m agent_memory init
# Keep the store in a git repo and sync it to a remote (see Git-backed sync)
python -m agent_memory init --git --remote /path/to/remote.git
python -m agent_memory sync
# Clear all notes: preview first, then confirm (plain `init` never deletes notes)
python -m agent_memory init --force
python -m agent_memory init --force --yes
# Save a note
python -m agent_memory remember "fixed login bug" --tags bug,auth
# {"id": "a1b2c3d4", "timestamp": "...", "session": "default",
# "text": "fixed login bug", "tags": ["auth", "bug"]}
# Read one note back by id (full record as JSON), or just its text
python -m agent_memory show a1b2c3d4
python -m agent_memory show a1b2c3d4 --format text
# fixed login bug
# Read a note from standard input or assign a UTC date
printf '%s\n' "login review notes" | python -m agent_memory remember --stdin --tags auth --session auth
python -m agent_memory remember "login rollout" --date 2026-11-25 --tags auth --session auth
# Find it later by keyword (text + tags, best match first)
python -m agent_memory recall "login bug"
# A keyword of 3 or more letters also matches words it starts,
# so "log" finds login, logout and logs; "lo" matches nothing
python -m agent_memory recall "log"
# Match a phrase in note text, ignoring case (newest match first)
python -m agent_memory recall --exact "login bug"
# Tolerate a typo, or match a pattern in note text (ignoring case)
python -m agent_memory recall --fuzzy "logni bug"
python -m agent_memory recall --regex "bug #[0-9]+"
# Newest notes, or filtered
python -m agent_memory list --limit 10
python -m agent_memory list --tag bug
python -m agent_memory list --days 7
python -m agent_memory list --after 2026-11-01 --before 2026-11-30
python -m agent_memory list --reverse # oldest first
# List sessions and their note counts
python -m agent_memory sessions
python -m agent_memory sessions --sort count # most notes first, ties by name
python -m agent_memory sessions --sort name # alphabetical
# Count notes, or only recent ones in one session or tag
python -m agent_memory count
python -m agent_memory count --days 7
python -m agent_memory count --session auth --tag bug
# Recall within one session or tag only
python -m agent_memory recall "login" --session auth
python -m agent_memory recall "login" --tag bug
python -m agent_memory recall "login" --days 7
# Sort recall by recency or filter by an inclusive UTC date range
python -m agent_memory recall "login" --sort recency
python -m agent_memory recall "login" --after 2026-11-01 --before 2026-11-30
# Count tags across all sessions or in one session
python -m agent_memory tags
python -m agent_memory tags --session auth
# Export everything as CSV (or one session)
python -m agent_memory export --out notes.csv
python -m agent_memory export --session auth --out auth-notes.csv
# Export only notes from the last 30 days
python -m agent_memory export --days 30 --out recent-notes.csv
# Export only notes from one month, using an inclusive UTC date range
python -m agent_memory export --after 2026-11-01 --before 2026-11-30 --out november.csv
# Preserve record fields, including the tags array, as JSON Lines
python -m agent_memory export --format jsonl --out notes.jsonl
# Import notes back from a JSONL file (ids are regenerated, invalid lines are skipped)
python -m agent_memory import notes.jsonl
# Export a JSON array, or filter exported notes by tag
python -m agent_memory export --format json --out notes.json
python -m agent_memory export --tag auth --out auth-tagged.csv
# Export a markdown handoff brief for the next agent session
python -m agent_memory export --format handoff --out HANDOFF.md
# Covers the last 7 days by default; use --days 30 for a longer window
python -m agent_memory export --format handoff --days 30 --out HANDOFF.md
# Export only some CSV columns, in the order given
python -m agent_memory export --columns text,tags --out slim-notes.csv
# Export only notes having every listed tag
python -m agent_memory export --tags bug,auth --out bug-auth.csv
# Counts only, no invented content
python -m agent_memory summary --days 7
python -m agent_memory summary --session auth
# Print the result on one line for scripts (also available on recall and list)
python -m agent_memory summary --json
# Print the same counts as Markdown headings and bullet lists, for pasting
# into a README, issue, or daily note
python -m agent_memory summary --format markdown
# Show only the top three tags
python -m agent_memory summary --top 3
# Preview a date-based deletion without changing the store
python -m agent_memory forget --before 2026-11-30 --dry-run
Add sessions prune - delete empty and stale sessions
https://github.com/Xylos-Labs/agent-memory-mini/issues/158
Labels: enhancement, help wanted
Add doctor --fix to auto-fix the store problems doctor reports
https://github.com/Xylos-Labs/agent-memory-mini/issues/159
Labels: enhancement, help wanted
Thanks for helping improve this project. It is a small, CPU-only, offline project, so contributions that keep it simple and honest are the most welcome.
Use Python 3.10 or newer for the development environment. Check python --version before creating the virtual environment below.
git clone https://github.com/Xylos-Labs/agent-memory-mini.git
cd agent-memory-mini
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
No server, API key, or GPU is needed.
Fork the repo and create a branch from main (for example fix/short-description).
Make one focused change per pull request.
For every user-facing change, add an entry under Unreleased in CHANGELOG.md.
Run the checks before opening the PR:
python -m pytest -q --cov=agent_memory --cov-report=term-missing
python -m ruff check src tests
python -m ruff format src tests
python -m mypy src
Coverage must stay at or above 90% (fail_under = 90 in pyproject.toml).
The coverage run measures the CLI subprocesses too, via tests/conftest.py.
Open the PR against main. Describe what changed, why, and the measured results.
Be kind and direct.