Skip to main content
TheBestSI

How OpenClaw Memory Works: Files, Daily Notes, Search and Dreaming

OpenClaw stores memory as plain Markdown files in the agent workspace. What each file is for, what loads at session start, how memory search works, and the switches for flush and dreaming.

Self-Hosted AI Agents5 min readBy Technology Desk

Because OpenClaw memory is ordinary Markdown on your disk, you can read, edit and delete it. That is useful and also means memory hygiene is your job. This page summarizes how the documented system fits together. For the research view of agent memory more broadly, see long-horizon memory and persistent world modeling.

What are the memory files?

Memory files (OpenClaw docs).
FilePurposeLoaded when
USER.md (optional)Stable preferences, communication style, relationships and active-project context, written as directivesSession start, with its own small budget
MEMORY.mdLong-term durable facts and decisions that are not profile dataSession start
memory/YYYY-MM-DD.md (or with a slug)Daily notes with running context and observationsToday's and yesterday's load on a bare /new or /reset; others are searchable, not injected every turn
DREAMS.md (optional)Dream Diary and dreaming summaries for human reviewNot described as auto-loaded

Memory files (OpenClaw docs).

How does the agent read and write memory?

  • You can ask the agent to remember something, and it writes the note to the appropriate file.
  • Pre-compaction flush: before compaction, a silent prompt asks the agent to save important context. Its writes go only to the daily note, and it is on by default.
  • Dreaming: a background process promotes qualified short-term items into MEMORY.md and writes summaries to DREAMS.md.
  • Tools: memory_search finds relevant notes, memory_get reads a file or line range, and intent manages event-conditioned standing intents. Time-based reminders use scheduled tasks instead.

When an embedding provider is configured, search is hybrid, combining vector similarity with keyword matching. The docs say OpenClaw defaults to OpenAI embeddings, which means that text may be sent to that provider; set memory.search.provider to choose another. The default backend is SQLite, with PostgreSQL also supported. CLI commands: openclaw memory status, openclaw memory search "query" and openclaw memory index --force.

How should I keep memory useful?

These suggestions are editorial, not from the docs: keep durable facts in MEMORY.md and stable preferences in USER.md; review and prune outdated entries periodically; avoid pasting whole chat histories into memory; test retrieval with openclaw memory search so you know what is actually findable; and remember that memory files may contain sensitive data, so protect the workspace like any credential store. See the security checklist.

Based on vendor documentation; not hands-on tested. Defaults and file behaviour may change between releases.

Frequently asked questions

Where does OpenClaw store memory?+

As plain Markdown files in the agent's workspace, by default ~/.openclaw/workspace. The docs say there is no hidden state: the model keeps nothing beyond what is saved to disk.

What loads at the start of a session?+

USER.md (optional) and MEMORY.md. Today's and yesterday's daily notes load automatically on a bare /new or /reset. Other daily notes are searchable but not injected into every turn.

What if MEMORY.md gets too large?+

The file on disk stays intact, but the copy injected into the session is truncated once it exceeds the bootstrap budget. Check sizes with /context list, /context detail or openclaw doctor.

How do I turn off the automatic memory writes?+

The pre-compaction flush is controlled by agents.defaults.compaction.memoryFlush.enabled and dreaming by plugins.entries.memory-core.config.dreaming.enabled, per the docs, which say the flush is on by default. Check the docs for dreaming's default on your version.

Sources

  1. Memory — OpenClaw docs (accessed November 3, 2026). Files, loading behaviour, flush, dreaming, tools, search and CLI commands.

Who writes this?

This piece carries the Technology Desk byline. The site was co-founded by Liyam Flexer, Co-Founder & Investor. Content is managed by Adam Green, Content Manager, with Tal Slavin joining as Writer & Editor. A byline identifies who is responsible for the editorial content; it does not claim the author tested a product. Articles carry an editorial-review status, and those awaiting review say so. Questions or corrections: contact.

The Index: every page on TheBestSI

I want to
Explore rankings

Always here for any question