Course 02: Going DeeperModule 7 of 9

MODULE 07 · COURSE 02: GOING DEEPER

Module 7: Memory That Actually Works

Memory is the thing most people underinvest in and then wonder why their agent feels dumb. Let's fix that.


How OpenClaw memory actually works

There are three layers:

1. In-conversation context Everything in the current conversation. The agent can see all of it. This is temporary — it goes away when the session ends. Most AI models have large context windows (100k+ tokens), so you rarely hit the limit in normal use. 2. MEMORY.md A file in your agent's workspace. Permanent facts, preferences, and ongoing context the agent should carry across every session. It reads this at the start of each conversation. 3. Daily logs Files like memory/2026-03-03.md. A running record of what happened each day. Useful for "what did we work on last week?" type questions.

Understanding these three layers is the key to making memory work well.


What should go in MEMORY.md

Think of MEMORY.md as the briefing document a new assistant would read before their first day. If you had to explain yourself to a new person in writing, what would you include?

The things that actually matter:

## Who You're Working For
  • Name: Jeremy Kirby
  • Location: Scotts Valley, CA (rotates: Barcelona, Miami, Dubai)
  • Timezone: America/Los_Angeles

Their Work

  • Runs Kirby Holdings — multiple AI-powered businesses
  • CMO @ Drizzle (crypto casino)
  • Uses AI agents daily across all businesses

Communication Preferences

  • Short, direct responses preferred
  • No bullet points unless explicitly asked
  • Plain English, no jargon

Active Projects

  • [Project name]: [brief status and context]
  • [Project name]: [brief status and context]

Important People

  • [Name]: [relationship, context]

Ongoing Rules

  • Never schedule meetings before 10am
  • Check in on [X] every Monday
  • Always confirm before taking irreversible actions

The more specific, the better. "He runs a business" is useless. "He runs 3 client website projects and is in active contract negotiation with a 4th" is useful.


Building MEMORY.md the right way

Don't try to write the perfect MEMORY.md on day one. You don't know yet what matters.

Instead, have the conversation first. Then at the end:

"Based on our conversation, update your MEMORY.md with anything important I should make sure you remember."

Your agent extracts the key points and writes them to the file. Review it. Edit what's wrong. This is faster than writing it from scratch and you'll catch things you would have forgotten.

Do this regularly — especially after any important conversation where decisions were made or context was established.


The daily log pattern

This takes about 30 seconds and pays off significantly.

At the end of each day (or have your agent ask you):

"Log today: [quick summary of what you did and decided]"

Your agent writes it to memory/YYYY-MM-DD.md. Over time, you build a searchable record of your work.

Why this matters: when you come back after a week off and ask "what was I doing with the client proposal?", your agent can actually answer.


What to do when memory gets stale

MEMORY.md will get outdated. Projects end. Preferences change. That's normal.

Every few weeks:

"Read your MEMORY.md to me. Let's update it."

Go through it together. Delete what's stale, update what's changed, add what's missing. Treat it like a living document, not a set-it-and-forget-it file.


Context compaction

When a conversation gets very long, OpenClaw compresses older parts of it to stay within model limits. This is called compaction. You can usually tell it's happened because the agent might reference earlier parts of the conversation less precisely.

You don't need to worry about this for normal use. But if you're doing a very long working session, periodically tell your agent:

"Summarize what we've worked on so far and save the key points to memory."

This gives you a checkpoint you can reference even after the session ends.


Memory and privacy

Everything in MEMORY.md and your daily logs lives on the computer where your Gateway runs — your server or laptop. It doesn't sync to any external service unless you explicitly set that up.

If you're running on a cloud server: make sure your server has disk backups enabled. Losing your MEMORY.md isn't the end of the world (you can rebuild it), but it's annoying.

# Simple daily backup of the agent workspace

Add to crontab: 0 2 * (runs at 2am)

tar -czf ~/backups/agent-workspace-$(date +%Y%m%d).tar.gz /path/to/your/workspace

Next up

Module 8: Security — Locking Down Your Setup →