OpenClaw Setup Guide
Foundation

Memory System

Give your agent continuity across sessions with daily logs and curated long-term memory

Your agent wakes up fresh each session with zero memory of previous conversations. The memory system fixes this with two layers:

  • Daily logs (memory/YYYY-MM-DD.md) -- Raw notes of what happened each day. Created automatically.
  • Long-term memory (MEMORY.md) -- Curated, distilled knowledge. Think of it as the difference between a journal and a mental model.

The agent reads recent daily logs and MEMORY.md at session start to rebuild context. Without this, you're re-explaining everything every session. With it, your agent knows your projects, preferences, decisions, and past mistakes. It compounds over time -- genuinely one of the most important things to set up.

Setup Prompt

Set up a memory system for yourself. Create a `memory/` directory in
the workspace. Start a daily log at `memory/YYYY-MM-DD.md` for today.

Create a `MEMORY.md` file with sections for:
- Key Facts (about me)
- Important Decisions
- Lessons Learned
- Systems (things we've set up)
- Projects (what we're working on)
- Accounts and Credentials (references, not secrets)

During heartbeats, periodically review daily files and promote
important things to MEMORY.md. Think of daily files as your journal
and MEMORY.md as your long-term mental model.

Rules:
- Write it down -- "mental notes" don't survive restarts
- When someone says "remember this" -> update the memory file
- When you learn a lesson -> document it
- When you make a mistake -> write it down so you don't repeat it

Memory Maintenance

I also have my agent periodically review its own memory:

Every few days, review recent memory/YYYY-MM-DD.md files. Identify
significant events, lessons, or insights worth keeping long-term.
Update MEMORY.md with distilled learnings. Remove outdated info
that's no longer relevant.

It's like a human reviewing their journal and updating their mental model. The daily files are raw notes; MEMORY.md is curated wisdom.

Keep in Mind: Storage vs. Working Memory

A common assumption is that once your agent has a memory system, it just knows everything from past sessions. It doesn't. Each new session starts with a clean slate -- the agent loads recent daily logs and MEMORY.md at startup, but that's a summary, not a full replay of everything you've ever done together.

Think of it like the difference between long-term memory and working memory. The files are long-term storage. But if you want something specific in the agent's working memory -- meaning actively in the context of the current session -- you need to ask it to go fetch that context.

I do this all the time. If I've been working on a project across multiple days and multiple sessions, I'll start a new session by asking my agent to look back at the vault, previous session logs, and stored memories to bring back up what we were working on and where we left off. Something like:

I want to pick back up on the discovery platform project. Look through
your memory files, our recent session logs, and the project docs to
refresh yourself on where we are and what's left to do.

This is useful for you too because the agent will output a summary of the current state -- but it's mostly useful for the agent. It pulls all that context back into its working memory so it can pick up right where you left off instead of starting from scratch.

The memory system gives your agent the ability to remember. But you still need to prompt it to actually recall specific things when a new session starts. Once you get in the habit, it's seamless.

On this page