How your agent's memory works

What your agent remembers between chats, where that memory lives, and how to correct it.

In this tutorial

Your agent remembers things in two ways: what's in the current chat, and what it has written down in files. The chat fades; the files last. If you want your agent to remember something for good, it has to be written to a file. Once you know that, "my agent forgot" becomes easy to fix.

Two kinds of memory

Chat memory
  • Everything said in the current chat
  • Fades as a chat gets very long
  • Doesn't carry over to a new chat
  • Like a phone call: gone when it ends
File memory
  • Notes your agent writes to its own computer
  • Read again at the start of new chats
  • Lasts until someone changes it
  • Like a notebook you can reread

Every AI model can only see so much text at once. In a very long chat, the oldest messages get summarised or drop out of view, so details agreed early on get fuzzy. That's normal, not a fault. The fix is to save what matters to a file. More on this in long chats, context limits and starting fresh.

The files that make up its memory

Your agent keeps a handful of plain-text files that shape how it works. On OpenClaw agents they live in the .openclaw/workspace folder in its home folder.

File What it holds
SOUL.md Who your agent is: personality, tone, how it talks
AGENTS.md How it works: rules, habits and boundaries
USER.md Who you are: your name, time zone, preferences
MEMORY.md Long-term facts and decisions worth keeping
memory/ folder Day-by-day notes
HEARTBEAT.md Things to check on a schedule (see scheduled tasks)

Hermes agents keep their memory differently. Ask your agent "Where do you keep your long-term memory?" and it will tell you.

Make your agent remember something

Just ask it to write it down. Be explicit about where.

Good things to save:

  • Your name, role, time zone and working hours
  • Decisions you've made ("we're pricing at $19/month")
  • Project details it needs every time (product name, audience, links)
  • How you like work delivered (format, length, where to save files)

At the end of a long working session, ask it to save a summary: "Write the key decisions and next steps from today into memory."

See what your agent knows about you

You can always ask.

You can also look at the files yourself. Open Files, click Show hidden files (the folder starts with a dot), and open the workspace folder to preview them. Files shows previews but doesn't let you edit text in place, so for changes, either ask your agent or download the file, edit it and Upload it back.

Correct a wrong memory

If your agent keeps getting something wrong, the wrong fact is probably saved somewhere. Ask it to find and fix it:

I changed a file, but my agent still uses the old version

Your agent reads its memory files at the start of a chat. An ongoing chat keeps working from what it read earlier.

  1. Start a New chat after changing a memory file.
  2. If it still acts on old information, ask it to re-read the file: "Read USER.md again and tell me what it says now."
  3. Check for a second copy. Agents sometimes save the same fact in two places, and the old one wins. Ask it to search its memory files for the old fact.
  4. If nothing changes after a restart, use Restart agent from the agents list, then try again.

Frequently asked questions

Why did my agent forget what I told it?

It was only in the chat, not saved to a file, or the chat got so long that early messages faded. Ask it to save important things to its memory files.

Does my agent remember things between chats?

Yes, if they're written in its memory files. Anything only said in one chat won't carry over.

Can I edit my agent's memory directly?

Yes. Ask the agent to change it, or download the file from Files, edit it and upload it back. Advanced users can use the Terminal.

Is my memory shared with other agents?

No. Each agent has its own computer and its own memory files.

Will updating my agent wipe its memory?

No. Updating keeps memory, files and chats.

Still stuck?

Open a ticket and a person will help. Tell us what you tried and what you saw.

Contact support