OpenClaw's Dreaming: Background Memory Consolidation That Actually Works

AI agents accumulate memory the way some people accumulate possessions: fast, indiscriminate, and without a clear system for deciding what matters. You end up either hoarding everything and drowning in noise, or losing track of things that turned out to be important.

OpenClaw’s new dreaming feature is a background consolidation system that sits between short-term memory signals and long-term storage. It runs on a schedule, scores candidates across six weighted signals, and only promotes entries that demonstrate sustained, diverse relevance. No manual curation required. No noise flood.

This post explains how it works and why the design decisions matter.

The Problem Dreaming Solves

Every active AI agent produces a trail of memory signals throughout the day: session transcripts, daily logs, recall traces from searches. Most of that material is contextually useful in the moment and worthless a week later. A small fraction of it contains patterns worth keeping permanently.

Without a consolidation step, you face a binary bad outcome:

  • Over-promote: everything lands inMEMORY.mdwhich bloats into an unreadable graveyard of noise
  • Under-promote: nothing survives the filter, and genuine institutional knowledge disappears

Dreaming replaces this with an evidence-based curatorial pipeline. It watches what gets recalled, how often, and in what contexts, then only promotes entries that cross defined thresholds of sustained relevance.

Three Phases, One Outcome

Dreaming executes three phases in sequence on a configurable cron schedule (default: 3 AM daily):

Light Sleep — Ingest and Stage

Light phase reads recent daily memory files and session transcripts, chunks them into recallable entries, deduplicates near-identical content using Jaccard similarity, and stages candidates in the short-term recall store. It records signal hits at this stage, these feed into the ranking score later.

This phase writes nothing toMEMORY.mdIt only prepares and stages.

REM Sleep — Extract Patterns

REM phase looks across the staged material for recurring themes. It reads all short-term recall entries within a lookback window (default: 7 days), analyses concept tag frequency, and identifies entries that appear repeatedly with high confidence.

These become “candidate truths” — entries that have demonstrated they’re not one-off noise. Again: nothing written toMEMORY.mdThis phase produces reflective signals that inform the final ranking.

Deep Sleep — Promote What’s Earned

This is where promotion happens. Deep phase takes every candidate from the short-term store, scores it using six weighted signals, applies phase reinforcement boosts from Light and REM hits, filters against three threshold gates, and appends surviving entries toMEMORY.mdunder a dated section.

Only this phase touches long-term memory. The separation is deliberate, noisy data never reachesMEMORY.mdunless it has earned the passage.

The Scoring System

Six signals contribute to each candidate’s score:

SignalWeightWhat it measures
Relevance0.30Average retrieval quality across all recalls
Frequency0.24Total short-term signal count accumulated
Query diversity0.15Distinct query contexts that surfaced this entry
Recency0.15Time-decayed freshness (14-day half-life)
Consolidation0.10Multi-day recurrence strength
Conceptual richness0.06Concept-tag density from snippet and path

Light phase hits add a recency-decayed boost of up to +0.05. REM phase hits add up to +0.08 on top of that.

To pass the threshold gates, a candidate must have:

  • A weighted score of at least 0.8
  • Been recalled at least 3 times
  • Surfaced from at least 3 distinct query contexts

These three gates together are what prevent one-off mentions from being promoted. A memory entry has to demonstrate it matters across time, across different search contexts, and across retrieval quality, not just get lucky once.

What This Means in Practice

I’ve been running dreaming on my own OpenClaw instance for a few weeks. The concrete benefits I’ve noticed:

MEMORY.mdstays readable. Previously it was growing with every session, important entries buried under a century of ephemeral noise. Now it’s dense with stuff that actually matters.

Patterns surface without manual effort. A concept that comes up in three different sessions, in three different contexts, gets promoted automatically. I don’t have to notice or remember to write it down.

Less regret. The worst feeling is realising six months later that you knew something important and lost it. The recall-count and query-diversity gates mean genuinely useful material gets a chance to accumulate signals before being judged.

Human-readable output. The Dream Diary (DREAMS.md) generates a narrative summary after each phase, whimsical, readable, and useful for auditing what the system found interesting.

Getting Started

Dreaming is opt-in and disabled by default. To enable:

/dreaming on

Check status with:

/dreaming status

You can preview what would be promoted without applying anything:

openclaw memory promote

if you want to understand why something would or wouldn’t promote:

openclaw memory promote-explain "router vlan"

The configuration is tuneable. Default thresholds are reasonable starting points, raiseminScore or minRecallCount if MEMORY.mdgrows too fast, lower them if you’re losing things worth keeping.

The Design Choice That Matters

Most AI agent frameworks treat memory as a write-through cache: you say something, it gets stored, and good luck figuring out what was actually important when you need it later.

Dreaming takes a different position, that memory should be earned. Entries don’t land in long-term storage because you said them once. They land there because the system observed, over time, that the material kept being relevant across different contexts and queries.

That curatorial stance is the right one. Noise in a long-term memory store is worse than absence, it trains you to stop trusting the system. Dreaming keeps the trust by keeping the signal-to-noise ratio high.

If you’re running OpenClaw and not using dreaming yet, it’s worth enabling and letting it run for a week. The difference in yourMEMORY.mdquality will be noticeable.

logo

I Create Reach.
I Generate Impact.
I Amplify.