OpenClaw Agent Dreaming: Automatic Memory Consolidation Without Memory Mess

OpenClaw Agent Dreaming: Automatic Memory Consolidation Without Memory Mess

OpenClaw agent dreaming is the background memory system that decides which short-term signals deserve a place in durable memory. That sounds poetic because the feature is called dreaming, but the machinery is practical: collect recent traces, sort the useful bits, reflect on repeated themes, and promote only the candidates that pass scoring, provenance, and rewrite checks.

The important part is what it does not do. Dreaming is not a license for an agent to rewrite its whole personality overnight. It is not a hidden diary that teaches itself from every random tool result. It is not a substitute for deliberate memory hygiene. In OpenClaw, the durable target is still MEMORY.md, and the docs are careful about the path from short-term signal to long-term note.

That restraint is why the feature is worth understanding. AI agents become much more useful when they remember stable preferences, recurring tasks, and decisions. They also become worse when they remember junk. OpenClaw’s dreaming system tries to solve that tension with a phased process, a human-readable Dream Diary, and hard gates before anything reaches long-term memory.

OpenClaw agent dreaming memory consolidation with light REM and deep phases
OpenClaw agent dreaming turns short-term signals into reviewable memory candidates before anything reaches durable memory.

What OpenClaw agent dreaming actually does

OpenClaw’s docs define dreaming as the background memory consolidation system in memory-core. Its job is to move strong short-term signals into durable memory while keeping the process explainable and reviewable. In plain English: the agent sees many things during normal work, but only a few of those things should survive as stable memory. Dreaming is the maintenance pass that sorts that out.

The feature is enabled by default. Operators can turn it off by setting plugins.entries.memory-core.config.dreaming.enabled: false, but for most personal-agent setups the better first move is to understand its boundaries. A daily memory sweep is useful when the agent has many interactions, recurring user preferences, or multi-day work. It is less useful when the workspace should stay intentionally stateless.

The wider idea has roots in agent research, but OpenClaw’s version is more operator-facing than academic. The Generative Agents paper described agents that store experiences, synthesize those memories into higher-level reflections, and retrieve them later for planning. The 2025 sleep-time compute paper explored the idea of models doing offline work about a context before future queries arrive. OpenClaw borrows the useful shape: do some background thinking when the user is not waiting, then make future behavior cheaper and more consistent.

But the implementation detail matters. OpenClaw does not treat every reflection as durable truth. It keeps a clear line between staged material, diary material, and promoted memory.

What dreaming writes, and what it refuses to write

The dreaming docs split output into three buckets. First, machine state lives in SQLite-backed plugin state. That includes recall data, phase signals, ingestion checkpoints, and locks. Second, rewrite preimages also live in SQLite-backed plugin state before an accepted MEMORY.md rewrite. Third, human-readable output goes to DREAMS.md or an existing dreams.md, with optional phase reports under memory/dreaming/<phase>/YYYY-MM-DD.md.

Long-term promotion still writes only to MEMORY.md. That sentence is the anchor for the whole feature. A dream report can be interesting. A REM reflection can be useful for review. A phase file can help you debug what happened. None of those are the durable memory source of truth.

Promoted entries also carry bounded recall metadata. The docs describe trailing concept tags such as <!-- trigger: phrase one, phrase two --> and a bounded importance value from 1 to 10. Existing annotated entries are preserved byte-for-byte unless consolidation explicitly merges or supersedes them. That makes the file less fragile. A memory system that rewrites old notes casually is a liability; OpenClaw is trying to keep prior memory stable unless there is a reason to change it.

Light, REM, and deep phases in plain English

Dreaming runs three cooperative phases in order: light, REM, and deep. They are implementation phases, not three modes the user flips between.

The light phase is the sorting desk. It reads recent short-term recall state, daily memory files, and redacted session transcripts when available. It deduplicates signals and stages candidate lines. It can write a managed light-sleep block when storage includes inline output, and it records reinforcement signals for later ranking. It never writes to MEMORY.md.

The REM phase is the reflection pass. It builds theme summaries from recent short-term traces and can write a managed REM-sleep block. It records reinforcement signals that deep ranking can use later. It also never writes to MEMORY.md.

The deep phase is where durable memory can change. It ranks candidates with weighted scoring and threshold gates. According to the docs, the deep phase considers relevance, frequency, query diversity, recency, consolidation, and conceptual richness, with light and REM hits adding a small recency-decayed boost. Candidates still have to pass gates such as minimum score, recall count, and unique query count.

This order is the right mental model: light stages, REM summarizes, deep decides. If a memory appears in MEMORY.md, it should have survived the last step, not slipped in because a diary paragraph sounded persuasive.

Why the Dream Diary is not the same as MEMORY.md

The Dream Diary lives in DREAMS.md. It is a human-facing narrative of what the dreaming phases noticed. The docs are explicit that the diary is for the Dreams UI and for review, not a promotion source. Diary and report artifacts are excluded from short-term promotion.

That boundary matters more than it first seems. If a diary could become evidence for future memory, the system could accidentally teach itself from its own summaries. A small misunderstanding could get repeated, polished, and promoted without a grounded source. OpenClaw avoids that by treating diary output as review material.

The diary still has value. It gives an operator a quick way to see what changed, what themes surfaced, and whether the agent is noticing the right kind of material. Failed or empty diary generation writes a local fallback entry, so even a degraded run leaves a visible trace. That is better than silent memory maintenance, especially for a self-hosted system where the owner is also the operator.

The safety model: provenance, gates, and rewrite checks

The best part of OpenClaw agent dreaming is the part that sounds least glamorous: admission and provenance checks. Dreaming can ingest redacted interactive session transcripts, but cron, heartbeat, subagent, and unknown sessions stay out of durable candidate ingestion. Runtime-recalled context is also removed so recalled snippets cannot be learned again as new memory.

Before consolidation, memory-core removes candidates whose indexed provenance is untrusted or system. The docs call this a structural taint gate, not a score penalty. That is the correct call. A high score should not rescue an untrusted source. Tool output, web content, and system-level text can be useful context in the moment, but they should not quietly become the user’s long-term memory.

The rewrite path has more checks. An accepted rewrite must preserve prior entries within the configured prior-entry loss fraction, include source references for every promoted candidate, stay within the bootstrap-safe file budget, and parse as the expected structured response. Before the file changes, the previous MEMORY.md is stored in SQLite-backed plugin state. DREAMS.md then gets added, merged, and superseded counts plus short diff-style highlights.

This is the difference between memory automation and memory roulette. The model can help decide operations, but the writer applies bounded, sourced changes to the existing file.

When to use dreaming, and when to turn it off

Leave dreaming on when the agent has a real ongoing relationship with its user. A writing agent should remember house style. A support agent should remember recurring account constraints. An ops agent should remember durable infrastructure decisions. A personal assistant should remember stable preferences, not just the last instruction buried in chat history.

Turn it off, or at least tighten admission policy, when the workspace processes sensitive material that should not enter memory automatically. The memory provenance docs make a useful distinction here: admission policy excludes matching sessions from future dreaming ingestion and backfill, while memory forget removes identifiable artifacts from selected sessions and records them as forgotten. Admission is prevention. Forget is cleanup.

That distinction prevents a common false sense of security. Excluding Gmail hook sessions from future ingestion does not erase old candidates. Forgetting a session does not delete every original transcript or every external copy. Operators still need to understand the deletion boundary.

In multi-agent fleets, also check ownership. The dreaming docs note that an explicit multi-agent fleet needs an ambient system owner for this job. If logs say Agent-less cron job has no resolvable owner, configure an existing agent as the system owner. That selects the execution owner; it does not rewrite every agent’s workspace.

Operator workflow: check status, preview, explain, backfill

For day-to-day use, start with status. The memory CLI docs describe openclaw memory status, with --deep for vector-store, embedding-provider, and semantic-search readiness checks. Use it when dreaming appears off, promotion looks stale, or search results seem incomplete.

For promotion review, use the promotion commands before assuming the background job is wrong. openclaw memory promote previews candidates, and openclaw memory promote --apply applies promotion. openclaw memory promote-explain "topic" explains why a specific candidate would or would not promote. That last command is especially useful when a human is sure something should have been remembered but the gates disagree.

For historical material, OpenClaw has grounded backfill lanes. The docs list memory rem-backfill and memory session-backfill modes for previewing, staging, applying, and rolling back historical replay. Use those tools carefully. Backfill is powerful because it can bring old retained sessions into the same short-term evidence store the normal deep phase uses. It is also exactly the kind of thing you want to preview before writing anything durable.

One more operational detail: background completions, including dreaming, share OpenClaw’s background work budget. The queue docs list a budget of three concurrent runs for plugin background completions. If a box is busy with other background work, a dream sweep may wait instead of fighting foreground chat replies.

Common mistakes with OpenClaw agent dreaming

Mistake 1: treating the Dream Diary as truth

The diary is useful because it is readable. That does not make it durable memory. Use it to review what the system noticed. Do not scrape it back into MEMORY.md manually unless you have checked the grounded source behind the claim.

Mistake 2: assuming every chat can become memory

Dreaming excludes cron, heartbeat, subagent, and unknown sessions from durable candidate ingestion. That is intentional. Background jobs and delegated runs often contain operational noise, tool output, or secondhand summaries. Durable user memory should come from trusted, eligible sources.

Mistake 3: using forget as a magic eraser

memory forget removes identifiable memory artifacts derived from selected sessions and records those sessions as forgotten. It does not delete every original transcript, every freeform edit, or every external copy. Run a dry-run report first, then review what remains inside the documented deletion boundary.

Mistake 4: disabling dreaming when tuning would solve the problem

If the agent remembers too much noise, the answer may be admission policy, thresholds, or better source hygiene. Disabling the whole sweep is reasonable for stateless agents, but it is a blunt fix for a personal agent that actually needs continuity.

Mistake 5: ignoring system ownership in multi-agent setups

If you run more than one agent, make sure ambient background work has a resolvable owner. Otherwise the job can fail before memory logic even gets a chance to run. The fix is configuration, not a rewrite of the dreaming model.

FAQ about OpenClaw agent dreaming

What is OpenClaw agent dreaming?

OpenClaw agent dreaming is the background memory consolidation system in memory-core. It stages, reflects on, scores, and promotes trusted short-term signals into durable memory when they pass the required gates.

Does dreaming write directly to MEMORY.md?

Only the deep phase can promote durable candidates to MEMORY.md. Light and REM can stage or summarize material, but they do not write long-term memory.

What is DREAMS.md for?

DREAMS.md is the Dream Diary: a human-readable review log for dreaming phases. It is not a promotion source, and diary artifacts are excluded from short-term promotion.

Can I disable dreaming?

Yes. Set plugins.entries.memory-core.config.dreaming.enabled: false. For many agents, though, tuning admission policy and promotion behavior is better than turning off memory consolidation completely.

How often does dreaming run?

The docs list the default dreaming frequency as 0 3 * * *. Operators can set a custom cadence under plugins.entries.memory-core.config.dreaming.frequency.

How do I check why something did not promote?

Use openclaw memory promote-explain "your topic". It explains why a candidate would or would not pass the promotion path.

Final take

OpenClaw agent dreaming is useful because it is boring in the right places. It does not ask you to trust a mysterious agent subconscious. It gives you staged signals, phase reports, a Dream Diary, provenance gates, source references, rewrite checks, and a single durable destination for long-term memory.

That is exactly what agent memory needs. Let the machine notice patterns in the background, but keep durable memory grounded, reviewable, and hard to pollute. If you are running OpenClaw as a personal or team agent platform, dreaming is worth leaving on once you understand the boundaries.

Start with the official OpenClaw Dreaming docs, then check the memory CLI reference before tuning promotion or backfill. The feature is strongest when you treat it as maintenance, not magic.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *