OpenClaw guide

OpenClaw memory: keep it reviewable, durable, and useful

OpenClaw memory is not magical “the model remembers.” It is explicit Markdown stored in the agent workspace. That is good news: you can audit it, edit it, and design it like a real system instead of a prompt trick.

TL;DR (the simple memory model)

If you only remember one thing: in OpenClaw, the files are the source of truth. The agent “remembers” what is written to disk. So the job is to decide what gets written, where, and when.

  • Durable facts and preferences go in `MEMORY.md`
  • Daily running notes go in `memory/YYYY-MM-DD.md`
  • Index/search is provided by the active memory plugin
  • Compaction happens when context is big; use memory flush to persist before summarization

How OpenClaw memory works (in practice)

OpenClaw memory is plain Markdown in the agent workspace. The model does not keep a secret long-term state. It reads selected memory files at session start, and tools can index/search the memory depending on the active plugin.

If you want to disable memory tools completely, you can disable the memory plugin slot.

  • Daily memory: `memory/YYYY-MM-DD.md` (append-only log)
  • Long-term memory: `MEMORY.md` (curated, stable, human-reviewable)
  • Workspace root is controlled by `agents.defaults.workspace`
  • Disable memory plugin with `plugins.slots.memory = "none"`

Default memory files

agents.defaults.workspace/
  MEMORY.md
  memory/
    2026-03-08.md

Disable memory plugin

{
  "plugins": { "slots": { "memory": "none" } }
}

What to store (and what to keep out)

Good memory improves future decisions. Bad memory pollutes prompts and creates contradictions. Keep long-term memory small, structured, and intentionally curated.

Good default

Promote notes into `MEMORY.md` only after they have proven useful more than once.

  • Store: durable preferences, decisions, operating rules, stable facts
  • Avoid: transient chat fragments, time-sensitive facts, raw web dumps, secrets without retention policy

Semantic memory indexing and search

Once you have weeks of daily notes, keyword search becomes painful. OpenClaw supports semantic indexing and search through the active memory plugin (default: `memory-core`).

Indexing is an operational task. Make it visible and repeatable.

  • Use `openclaw memory status --deep` to verify vector/embedding availability
  • Use `openclaw memory index` to build or refresh the index
  • Use `openclaw memory search "..."` to retrieve relevant past context
  • Scope with `--agent main` if you run multiple agents

Common memory commands

openclaw memory status --deep
openclaw memory index --verbose
openclaw memory search "release checklist"

Compaction and “memory flush” (prevent losing durable context)

Long-running sessions accumulate tool outputs and messages until the model context window gets tight. OpenClaw compacts older history into a summary entry, preserving recent messages. Before compaction, it can trigger a silent “memory flush” turn that reminds the model to write durable notes to disk.

This is the clean way to ensure the important parts of a long session become durable memory instead of getting buried in a summary.

  • Manual compaction: use `/compact` when a session feels stale
  • Auto-compaction: happens automatically near context limits
  • Memory flush: a silent reminder to write to `memory/YYYY-MM-DD.md` before compaction

Enable and customize memory flush

{
  "agents": {
    "defaults": {
      "compaction": {
        "reserveTokensFloor": 20000,
        "memoryFlush": {
          "enabled": true,
          "softThresholdTokens": 4000,
          "systemPrompt": "Session nearing compaction. Store durable memories now.",
          "prompt": "Write any lasting notes to memory/YYYY-MM-DD.md; reply with NO_REPLY if nothing to store."
        }
      }
    }
  }
}

How Clawdguy helps

When memory becomes part of production workflows, reliability depends on stable infrastructure and operational visibility. Clawdguy gives you a managed OpenClaw environment where you can run always-on workflows, inspect behavior, and evolve memory rules deliberately.

That is a faster path than stitching together local setups and hoping the context stays coherent over time.

  • Dedicated infrastructure for persistent workflows
  • Operational controls for logs, updates, and lifecycle management
  • A cleaner path from prototype memory to production memory