CLI-first persistent memory for AI coding sessions with direct Obsidian note writing and local fallback storage.
Project description
agent-mem
Automatic context compression and persistent memory for AI coding agents.
agent-mem helps you keep long coding sessions coherent by capturing decisions, session context, and code signals in structured memory notes. It also generates Obsidian-friendly project graph docs so you can navigate architecture, decisions, blockers, and recent context quickly.
Why Use agent-mem
- Preserve critical context between chats and sessions
- Reduce token waste from repeating project history
- Keep technical decisions and blockers traceable
- Generate a searchable Obsidian-native knowledge graph from code + memory
Core Features
- Smart
watchmode with file + git + idle detection - One-paste handoff prompts (Groq-powered, optional)
- Obsidian-first storage with wiki-links and YAML frontmatter
- Local fallback mode (
.agent-memory/) when Obsidian is not configured graphcommand to build project knowledge docs from code, memory, and chat context
Installation
pip install easy-agent-mem
Quick Start
agent-mem init
agent-mem configure-groq # optional for enrich/watch handoff generation
agent-mem watch # start automatic handoff mode
After initialization, use agent-mem status to verify storage mode, graph output readiness, and Groq configuration status.
Knowledge Graph (agent-mem graph)
Generate Obsidian-native docs into agent-mem-output/:
agent-mem graph build
Use optional flags:
agent-mem graph build --compact
agent-mem graph build --enrich
agent-mem graph build --compact --enrich
agent-mem graph build --exclude-file-pattern "tests/*" --exclude-file-pattern "**/migrations/*.py"
Graph Flags
| Flag | Description |
|---|---|
--compact |
Trims long concept/function lists and writes full lists to agent-mem-output/Full/ |
--enrich |
Adds inferred concepts/relationships via Groq when available |
--exclude-file-pattern |
Excludes files by glob pattern; repeatable |
Generated Files
Index.md: dashboard and navigation entrypointCode/*: files, classes, functions, and importsDecisions/*: extracted decision and blocker signalsSessions/recent-chats.md: active and recent context snippetsConcepts.md: concept inventory withEXTRACTED/INFERREDlabelsGraph-Report.md: plain-language summary of graph generation
Open agent-mem-output/Index.md in Obsidian for full navigation and backlinks.
Daily Workflow
agent-mem watch
agent-mem checkpoint --stdin
agent-mem prepare-next
agent-mem recall "current goal"
agent-mem graph build --compact
Use this flow to maintain continuity during active implementation and produce graph notes when you need a wider project snapshot.
Commands Overview
| Command | Description |
|---|---|
agent-mem init |
Configure storage mode and IDE instructions |
agent-mem configure-groq |
Set Groq API key and model configuration |
agent-mem watch |
Run automatic handoff watcher |
agent-mem graph build |
Build knowledge graph notes |
agent-mem summarize |
Save manual structured summary |
agent-mem checkpoint |
Update compact active handoff context |
agent-mem prepare-next |
Print starter block for a fresh chat |
agent-mem recall <query> |
Search saved memory |
agent-mem status |
Show storage, graph, and Groq configuration |
Storage Modes
Obsidian Mode
If Obsidian is configured, notes are written under:
Memory/Agent-Mem/for session and active context notesagent-mem-output/for graph notes
Local Fallback Mode
If Obsidian is unavailable, memory is written to:
.agent-memory/active.md.agent-memory/memory.md
Troubleshooting
- If
--enrichdoes not apply inferred content, runagent-mem statusand verify Groq key/model configuration. - If graph output is too large, use
--compact. - For large repos, exclude low-value paths with repeatable
--exclude-file-patternoptions.
Project Links
- PyPI: easy-agent-mem
- GitHub: atharvavdeo/agent-mem
License
MIT
Project details
Release history Release notifications | RSS feed
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 easy_agent_mem-0.6.0.tar.gz.
File metadata
- Download URL: easy_agent_mem-0.6.0.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cd20a687f60abe6b912dc1326bf830af89cbc7a1917648a9a85d586dd52ab83
|
|
| MD5 |
8300e3b3a4f491b1d31e70799562eef5
|
|
| BLAKE2b-256 |
f94f6193c8c8de210c36e6d04005ac2b9ed99ecad211f2ae3ec1df06224e6786
|
File details
Details for the file easy_agent_mem-0.6.0-py3-none-any.whl.
File metadata
- Download URL: easy_agent_mem-0.6.0-py3-none-any.whl
- Upload date:
- Size: 38.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9947951d88640d8a51023922dc8774e43be21d7c95120df1637124db803afa52
|
|
| MD5 |
b8ce52ac95e693ca826a0039694cca04
|
|
| BLAKE2b-256 |
31e6b71eff9047c8cf2f1bc8f1ad9d2ff213a8a69d2bd3a001e3ddd118fcc766
|