Skip to content

Memory

Every conversation with an agent starts fresh. The agent has its system prompt, its tools, and whatever you tell it in that session — but it does not remember what happened yesterday. Memory is what changes that.

Unlike the other concepts in this guide, memory is not something you write or design directly. It is a capability you give the agent — and then the agent manages it on its own.

The most fundamental form of agent memory is something you have already seen: file access.

An agent with file tools can write things down. It can create a file, save notes to it, and read those notes in a future conversation. This is simple, obvious — and surprisingly powerful.

Imagine a sleep coach agent that analyzes your Oura data each morning. After its analysis, it writes a summary to a file — sleep-log.md. The next day, it reads that file before analyzing the new data. Now it can spot trends. “Your deep sleep has been declining for three nights in a row.” Without that file, every morning would be day one.

This works because the agent already has the tools. If it can read and write files, it can remember. You do not need any special memory system — just a clear instruction in the system prompt:

Keep a running log of your analyses in sleep-log.md. Before each new analysis, read the log to understand the history.

That is it. The agent writes, reads, and builds on its own notes over time. Files are durable, inspectable, and easy to understand. You can open them yourself and see exactly what the agent remembers.

File-based memory works well for structured logs and specific projects. But some things do not belong in a specific file — they are general knowledge that the agent should always have at hand. Things like:

  • The user prefers Slack over email for notifications.
  • The weekly team meeting moved from Tuesday to Thursday.
  • Last month’s project was wrapped up — stop following up on it.

For this, there is a more structured approach: the memory index.

A memory index is a small block of text that the agent can edit, and that is included in the agent’s system prompt at the start of every conversation. The agent reads it automatically — no tool call needed, no file to look up. It is just there, like a sticky note on the agent’s desk.

When the agent learns something worth remembering, it updates the index. When something becomes outdated, it removes it. The agent curates its own memory.

The memory index is appended to the agent’s system prompt. At the start of every conversation, the agent sees its instructions and its memory — together, as one context.

The agent has a tool to update the index. When it decides something is worth remembering, it writes it to the index. The next conversation, that information is there from the start.

A memory index might look like this:

Memory

  • User timezone: Europe/Helsinki
  • Preferred notification channel: Slack #personal
  • Current focus project: Q2 product launch
  • Sleep analysis log: see sleep-log.md
  • User prefers concise morning briefings, detailed evening reviews

Notice the fourth item — a reference to a file. This is where the memory index and file-based memory work together. The index holds quick-reference facts and pointers. The files hold the detail. The agent uses both.

A memory index only works if it stays concise. If the agent adds everything it learns, the index becomes noise — and the agent’s system prompt becomes bloated.

Good memory management means the agent must also forget. When a project wraps up, the agent should remove it from the index. When a preference changes, the old one should be replaced, not appended.

This is something to address in the agent’s instructions. Tell the agent how to manage its memory:

Keep your memory index concise and current. Remove entries that are no longer relevant. Use file references for detailed information — the index should contain only quick-reference facts and pointers.

There are more advanced approaches to agent memory — knowledge graphs, vector databases, retrieval-augmented generation, and others. Those have their place, but they are beyond the scope of this guide.

What matters here is recognizing why memory matters and seeing how far you can get with simple tools. File access and a memory index are not workarounds — they are elegant solutions built from capabilities the agent already has. No additional infrastructure, no complex systems. The agent writes, reads, and curates its own knowledge using the same tools it uses for everything else.

You do not always need both layers. An agent with a narrow, well-defined task might only need a file. An agent that works across many topics and learns your preferences over time will benefit from a memory index with file references for deeper detail.

Either way, memory is what transforms an agent from something that resets every conversation into something that genuinely learns and adapts to how you work.

Next: Proactive Agents →