CLI-first persistent memory for AI coding sessions with direct Obsidian note writing and local fallback storage.
Project description
agent-mem
CLI-first persistent memory for AI coding sessions.
agent-mem keeps coding context outside the live chat window. It saves structured summaries directly into an Obsidian vault when one is configured, or into a local fallback store inside the project when Obsidian is not available.
That gives you a simple workflow:
- save progress as memory
- reopen memory later with a focused query
- keep chat context smaller
- stop repeating the same project decisions across sessions
Why This Exists
Long coding chats drift. Important decisions get buried, context windows bloat, and new sessions start cold.
agent-mem fixes that with a local, inspectable memory layer:
- Obsidian-first when you want graph view, backlinks, and durable notes
- project-local fallback when you want zero extra setup
- CLI-first so the product works even without MCP or IDE-specific integrations
Core Features
- direct Obsidian vault connection during
init - Obsidian-friendly session notes with:
- YAML frontmatter
- wiki-links
Index.mdupdates
- local fallback in
.agent-memory/memory.md - CLI commands to:
- initialize storage
- save structured summaries
- recall relevant memory
- watch file activity and create automatic checkpoints
- optional MCP support for IDEs that expose tools reliably
- generated instruction files tailored for:
- Cursor
- Claude / VS Code
- Antigravity
- OpenCode
Installation
pip install easy-agent-mem
Optional MCP support:
pip install "easy-agent-mem[mcp]"
Quick Start
1. Initialize the project
agent-mem init
During setup you can:
- connect an Obsidian vault
- or skip it and use local fallback storage
2. Save a session summary
agent-mem summarize --summary "## Goal
Ship the release.
## Outcome
Prepared the package for publication.
## Key decisions
- Use Obsidian as primary storage.
## Files changed
- src/agent_mem/memory.py
## Open tasks or blockers
- Publish 0.4.2
## Next prioritized steps
- Verify the built wheel."
3. Recall memory later
agent-mem recall "release status"
4. Run automatic checkpointing
agent-mem watch
This monitors file activity in the current repo and writes an automated checkpoint once activity settles.
Storage Modes
Obsidian Mode
If you provide a vault path during agent-mem init, notes are written directly into:
<vault>/Memory/Agent-Mem/
Current layout:
<vault>/
Memory/
Agent-Mem/
Index.md
project-name-YYYY-MM-DD_HH-MM-session.md
Session notes are normal Markdown files, so Obsidian picks them up automatically.
They include:
- YAML frontmatter
- wiki-links like
[[project-name]] - file links like
[[File - src/agent_mem/cli.py]] - task links like
[[Task - ship release]]
Local Fallback Mode
If you skip Obsidian, memory is stored in:
.agent-memory/memory.md
This keeps the product usable even in plain local repos without extra tools.
Commands
agent-mem init
agent-mem summarize --summary "..."
agent-mem summarize --summary-file session.md
cat summary.md | agent-mem summarize --stdin
agent-mem recall "auth decisions"
agent-mem watch
agent-mem status
agent-mem setup
agent-mem setup-vscode
agent-mem print-mcp-json
agent-mem serve
IDE Integration
agent-mem works best when the IDE is instructed to treat saved memory as the source of truth.
The repo can generate instruction files automatically for:
AGENT-MEM-RULES.md.cursor/rules/agent-mem.mdc.claude/instructions.mdCLAUDE.md.antigravity/rules.md.opencode/instructions.md
Recommended IDE workflow:
- run
agent-mem init - add the generated instructions to your IDE
- use
agent-mem summarizeafter milestones - use
agent-mem recallat the start of new sessions
Optional MCP workflow:
agent-mem setup-vscode
agent-mem serve
Automated Checkpoints
agent-mem watch is a lightweight file-activity watcher.
It:
- polls the repo for file changes
- waits for a quiet period
- writes an automatic checkpoint summary after enough changes accumulate
Useful options:
agent-mem watch --interval 2 --quiet-seconds 20 --min-changes 3
agent-mem watch --once
This is not a replacement for a high-quality manual summary. It is a safety net to avoid losing context between work bursts.
Release Notes
0.4.1
- added tailored IDE-specific instruction files for Cursor, Claude, Antigravity, and OpenCode
- strengthened generated rules with explicit summarization checks and anti-hallucination guidance
- aligned the instruction-file generator with the checked-in templates
0.4.0
- introduced Obsidian-first storage with direct vault note writing
- added YAML frontmatter, wiki-links, and
Index.md - added CLI-first
summarizeandrecall - kept local fallback mode intact
Project Links
- PyPI: easy-agent-mem
- Source: github.com/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.4.2.tar.gz.
File metadata
- Download URL: easy_agent_mem-0.4.2.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdf69dc6c4520f945a0fe2f3099b660ad11b086984111ed3666b71b73e6025f8
|
|
| MD5 |
a87669d57f78645c755e840a58cbf3db
|
|
| BLAKE2b-256 |
20c302895b9ffcd196d3b5b8dab985d1abefd4d2d9f9d3624e4d6a5ab302da2c
|
File details
Details for the file easy_agent_mem-0.4.2-py3-none-any.whl.
File metadata
- Download URL: easy_agent_mem-0.4.2-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d22749f954f45f723ba29a500bea7b22e0c0764e8c7e2d1bfab6b0be3ced2b3
|
|
| MD5 |
9af3ecd9782e9c2833ef5b510b10a218
|
|
| BLAKE2b-256 |
a09e36dcca05cb3085be834aa139279542c3e4a030c717a69e5ed44f933d8871
|