Give Your Agent Long-Term Memory in Plain Markdown

... PLUS: Transcribe Short Audio in One API Call

In today’s newsletter:

  • Give Your Agent Long-Term Memory in Plain Markdown

  • Transcribe Short Audio in One API Call

Reading time: 5 minutes.

Speech-to-text APIs usually give you two modes. Batch transcription has you upload a file and poll until the transcript is ready. Streaming holds a connection open and manages a session the whole time.

A short clip doesn't need either. A voice message, a 30-second call snippet, or one finished turn from a voice agent just needs to go in and come back as text.

AssemblyAI's Sync API does that in a single call:

warm() connects to AssemblyAI before you have any audio. When the clip is ready, the request goes straight out instead of waiting for a new connection to be set up, which saves time on every call.

What it supports:

  • Clips from 80 milliseconds to 2 minutes

  • 32 languages

  • Word timestamps, if you set timestamps=True

  • Universal-3.5 Pro, AssemblyAI's main speech model

It fits voice agents well. When your agent detects that the user has finished speaking, send that one clip and get the text back. There's no live stream to keep open.

Two limits:

  • It takes audio files or bytes, not URLs, so download remote audio first.

  • Clips over 2 minutes need AssemblyAI's pre-recorded API instead.

Your coding agent forgets everything when the session ends. Most memory tools fix that with a database: facts go into a store, and the agent calls a save tool whenever it decides something is worth keeping.

That leaves two problems. The memory sits in a format you can't easily open, read, or fix by hand. And what gets remembered depends on the agent remembering to save it.

agent-memory makes the opposite choices. Memories are plain markdown files. The database beside them is a cache you can delete. Saving happens at fixed points in the conversation, not when the agent feels like it, and a separate pass runs later to decide what to keep.

The Files Are the Memory

Everything lives in one directory:

$AGENT_MEMORY_STORE/
├── MEMORY.md        one line per memory, injected at session start
├── user/ project/ reference/ experience/
├── archive/         retired entries and full session copies, append-only
├── dream-reports/   one report per sleep pass
└── .index/          SQLite search index, fully rebuildable

Each memory is its own markdown file. The frontmatter holds a name, a one-sentence summary, status, timestamps, links, and where the memory came from. The body is free text.

The .index/ folder is a SQLite full-text index, and it is only a cache. You can delete it and rebuild it from the files without losing anything:

rm -rf $AGENT_MEMORY_STORE/.index && uv run mem rebuild

That guarantee is enforced by a test in the repo. It means your agent's memory is something you can grep, diff, commit to git, and move to another machine.

Memories Are Written at the Boundaries

agent-memory hooks into the agent rather than relying on it. One command wires it into Claude Code or Codex:

uv run mem setup --host claude-code   # or: --host codex

From then on, session start injects MEMORY.md into context, the end of a turn or session distils what was learned into memory files, and the hook before compaction moves old material out before it's lost.

The library has no LLM client of its own and needs no API keys. When it needs judgment, like deciding what a conversation was worth, it borrows it from the host agent's own CLI. So every write shows up in your transcript, and there's no second bill.

Updates don't overwrite either. A new memory supersedes the old one and keeps the chain, so recall --as-of can answer what the agent knew on a given date.

A Separate Pass Decides What to Keep

Writing memory and managing it are different jobs, and agent-memory runs them on different clocks.

The sleep pass runs on its own schedule. It consolidates related memories, ages ones that haven't been useful, and clusters them into topic folders. Then it writes a dream report covering what moved and why.

uv run mem sleep --reason host   # consolidate
uv run mem proposals             # see what's waiting on you
uv run mem decide <id> --accept

It has limits on what it can do alone. An unattended pass can add and update memories, but it can never delete. Deletions arrive as proposals you accept or reject, and anything retired goes to archive/ rather than disappearing.

One Store for Every Agent

Because the store is just files and the interface is a shell command, different agents can share it. The repo tested all nine writer and reader pairings across Claude Code, Codex CLI, and Hermes. What one agent wrote, the others found with the specifics intact.

On a bounded LongMemEval-S setup, with Haiku 4.5 as the agent:

  • agent-memory: 52.9%

  • MemCore: 35.8%

  • No memory: 5.8%

The repo is careful about what these mean. The haystack is limited to 12 sessions per episode, so the scores aren't comparable to published LongMemEval results, and the MemCore comparison differs in both how memories are written and how they're read.

Try It

You need Python 3.12 or higher and uv:

uv sync --all-packages
export AGENT_MEMORY_STORE=~/agent-memory-store
uv run mem init
uv run mem record --domain project --type decision \
  --abstract "Markdown files are the single source of truth"
uv run mem --json recall "source of truth"

Then wire it into your agent with mem setup and let it run for a few sessions before trying the first sleep pass.

That’s all for today. Thank you for reading today’s edition. See you in the next issue with more AI Engineering insights.

PS: We curate this AI Engineering content for free, and your support means everything. If you find value in what you read, consider sharing it with a friend or two.

Your feedback is valuable: If there’s a topic you’re stuck on or curious about, reply to this email. We’re building this for you, and your feedback helps shape what we send.

WORK WITH US

Looking to promote your company, product, or service to 200K+ AI developers? Get in touch today by replying to this email.