Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Workspace Files and Health Checks  ›  Lesson

MEMORY.md and the Daily Logs

MEMORY.md 12 minMEMORY.md holds lasting facts the agent has learned, while memory/YYYY-MM-DD.md files keep a dated diary written by the session-memory hook, and both can be searched and backed up from the CLI.

MEMORY.md and the Daily Logs

In March you tell your agent that your passport expires in November and you want a reminder in October. Whether that survives until October depends on where the fact ends up. OpenClaw has two kinds of memory file, and they do different jobs.

The rule

MEMORY.md keeps lasting facts; the dated files keep the diary.

MEMORY.md is a persistent file in the workspace where the agent writes down important things it has learned over time, and keeps them up to date. It is how the agent recalls a fact months later. USER.md is what you tell it about yourself up front; MEMORY.md is what it picks up along the way. Both are plain markdown, so you can read and correct them.

memory/YYYY-MM-DD.md files are dated logs, one per day, such as memory/2026-09-26.md. Each records what happened that day, giving the agent a history it can look back through in order. You do not write these yourself: the session-memory hook creates them, and it runs when you use /new or /reset, saving the session before the reset.

A few commands let you look inside and protect all this:

openclaw memory search "passport"   # search what the agent has stored
openclaw memory index --all         # rebuild the search index for every memory file
openclaw backup create              # snapshot of your configuration and memory files

If a search misses something you know is in the files, rebuilding the index is the first fix. Before a risky change, such as a big config edit or an upgrade, make a backup.

The shortcut

Ask one question: "Will this still be true next month?" Yes: MEMORY.md. If it is just what happened today, it belongs in the day's dated log.

Where does each thing go?Step 1 of 4
  1. "My passport expires in November 2027."

    Still true next month, so MEMORY.md.

The trap is assuming the agent remembers everything it was ever told. A fact is reliably remembered only once it is written to a file. When something matters, ask the agent to note it in MEMORY.md, then confirm with a quick search.

Drills

Answer fast — trust the rule.

quick drill

What is the daily log for 5 March 2027 called?

quick drill

What creates the dated memory files?

quick drill

Which chat commands trigger the session-memory hook?

quick drill

During a chat the agent learns that your car insurance renews every April. Where does a lasting fact like that belong?

quick drill

Search keeps missing memories you know are in the files. Which command rebuilds the index?

Remember

  • MEMORY.md keeps lasting facts; the dated files keep the diary.
  • Ask "will this still be true next month?" Yes means MEMORY.md.
  • /new and /reset trigger the session-memory hook; search, re-index and back up from the CLI.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainFact or diary?

Explain the difference between MEMORY.md and the memory/YYYY-MM-DD.md files, how the dated files get created, and which commands you would use to search the memory and protect it before a risky change.