OpenClaw Field Guide

Section 9: Memory and Context - How Your AI Remembers

If you are new to self-hosting, this part explains why your assistant sometimes feels "sharp" in one moment and "forgetful" in another.

There are two kinds of memory at work:

  • Short-term context: the active conversation window (what the model can currently "see" in-session)
  • Long-term memory: stored notes/files that persist across sessions

When a session resets or context is compacted, the assistant may appear to forget details unless they were written to persistent memory.

::: beginner Think of short-term context like a whiteboard in a meeting room. Useful in the moment, but wiped between meetings unless someone writes down the key points. :::

OpenClaw memory layers (in order):

  • SOUL.md
  • USER.md
  • MEMORY.md
  • memory/YYYY-MM-DD.md
  • STATE.md

Each layer adds continuity:

  • Identity and tone
  • User preferences
  • Durable long-term facts
  • Daily running notes
  • Current task state/handoff

LCM (Lossless Context Management) is best understood as a filing cabinet:

  • Recent talk stays on your desk (active context)
  • Older material gets filed into organized drawers (summaries/messages)
  • You can pull specific folders back when needed

::: tip If something matters later, store it explicitly. Don't rely on the model "just remembering." :::

Optional advanced memory:

  • Some setups enable vector memory (for example, LanceDB) to improve retrieval of relevant past facts using semantic search.

::: power-user Vector memory helps with recall quality, but it does not replace clean notes, clear state files, or good safety boundaries. :::

Watch for warning signs:

  • Confident "I already finished that" claims without proof
  • Vague references to prior actions with no logs/outputs
  • Contradictions between claimed completion and actual system state

How to verify with receipts:

  • Ask for concrete evidence (command output, file diff, timestamp, message ID)
  • Check the artifact directly (file exists, config changed, service status updated)
  • Require a short "what changed + where" summary after critical tasks

::: action Adopt a receipts-first habit: trust claims that include verifiable artifacts, not confidence alone. :::