Skip to main content

CLI-first persistent memory for AI coding sessions with direct Obsidian note writing and local fallback storage.

Project description

easy-agent-mem header

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.md updates
  • 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.md
  • CLAUDE.md
  • .antigravity/rules.md
  • .opencode/instructions.md

Recommended IDE workflow:

  1. run agent-mem init
  2. add the generated instructions to your IDE
  3. use agent-mem summarize after milestones
  4. use agent-mem recall at 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 summarize and recall
  • kept local fallback mode intact

Project Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_agent_mem-0.4.2.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_agent_mem-0.4.2.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file easy_agent_mem-0.4.2.2.tar.gz.

File metadata

  • Download URL: easy_agent_mem-0.4.2.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for easy_agent_mem-0.4.2.2.tar.gz
Algorithm Hash digest
SHA256 18f0731c433f70b99cd602bbbb3e97006b79fbfea98d7e9bf27498e74a579660
MD5 c57faeb7ac30c092024f3154922a3901
BLAKE2b-256 17221d49b4d4ebc11f013076280f252b2437b61bacf2fe7bf464eb5bd351c76b

See more details on using hashes here.

File details

Details for the file easy_agent_mem-0.4.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_agent_mem-0.4.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 703858634f2960fbfe25fa40916c4557c894a1c8b85ed768068199fa1ae6ed2c
MD5 e89c0cab9ee687f3649a4b95f398481f
BLAKE2b-256 dbe5a98b32a6b8fa726934a7c51ecdaebce2f0ef7a6895f496b55799afd69925

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page