DEV Community

sun young
sun young

Posted on

agent-memory: Give Your AI a Long-Term Memory That Doesn't Forget

Anyone who's used an AI agent knows the pain: close the session, and it forgets everything it learned. Next time you start fresh, you re-explain the context, it re-steps the same traps. That's why agents feel like they get dumber the more you use them — they're not dumb, they just have no memory.

agent-memory (1317 stars, MIT, Python) exists to fix that. Its one-liner: the long-term memory runtime for AI agents.

How it fixes "amnesia"

The approach is plain but solid:

Markdown files are the single source of truth. Every memory lives as an ordinary Markdown file — something you can eyeball, edit in any editor, and version with git. The SQLite index beside it is just a cache you can delete anytime, because the truth lives in the Markdown.

That buys concrete wins:

  • Claude Code and Codex CLI share one store. What you accumulate in Claude survives a switch to Codex. Anything that can run a shell command can use it.
  • Retrieval is local and ranked, and it answers with paths rather than pasted text — the agent opens each hit only as deep as the task needs, so tokens aren't wasted.
  • Writes don't wait for the agent to remember. They fire automatically at conversation boundaries, then a "sleep-time" pass consolidates and forgets by value.
  • Zero API keys. The whole thing is local; no third-party service needed.

Three signals it's worth watching

  • It targets the most under-served part of Agent deployment. Everyone builds models, frameworks, and tools; few build the memory substrate underneath. Memory is exactly the leap that turns an agent from a toy into a production tool.
  • "Markdown as source of truth" is a smart design. Vector databases turn memory into a black box; Markdown means transparent, auditable, portable — which matters doubly for enterprise users (the data stays in your hands).
  • Local-first, zero API keys. Memory is sensitive; staying on-device is a requirement, and it satisfies that outright.

The honest caveat

It's early: 1317 stars, 84 forks, version 0.1.0 — moving fast, not a mature memory layer yet. It's a developer tool for people assembling their own agent workflows, not a plug-and-play consumer product.

I've localized the README and core docs to Chinese: https://github.com/yangshun2005/agent-memory-cn

If you find this project useful, a star on the original repo supports the author's ongoing maintenance.

Top comments (0)