← All Posts

OpenClaw Dreaming: How Background Memory Consolidation Makes Your AI Smarter

By OpenClaw Launch

What Is OpenClaw Dreaming?

Every night, your brain replays the day's events, strips away noise, and files away what matters. OpenClaw Dreaming does the same for your AI bot.

OpenClaw Dreaming is a background memory consolidation process that runs while your bot is idle — typically scheduled during off-hours via cron. It scans recent conversation history, scores memories by importance, and promotes the most valuable context into long-term memory (MEMORY.md). The result: a bot that genuinely gets smarter the more it's used, without manual curation.

The process is modeled on human sleep cycles:

  • Light Sleep — Deduplication pass. Removes redundant or near-duplicate memories from the short-term buffer.
  • REM Sleep — Pattern extraction. The consolidator identifies recurring themes, frequently referenced entities, and actionable insights across conversations.
  • Deep Sleep — Promotion to long-term memory. High-scoring memories are written to MEMORY.md, the persistent knowledge file your bot reads on every session start.

Why It Matters

Without dreaming, bots live in perpetual short-term memory. They might remember what you said five messages ago, but after a session ends that context is gone. The next conversation starts from scratch.

Dreaming solves this by automatically deciding what's worth keeping. It uses a weighted scoring system across six dimensions:

  • Relevance — 0.30 weight. How closely does this memory relate to the bot's core purpose?
  • Frequency — 0.24 weight. Has this topic come up repeatedly across sessions?
  • Query diversity — 0.15 weight. Did different users or contexts surface this information?
  • Recency — 0.15 weight. How recently was this information accessed or confirmed?
  • Consolidation — 0.10 weight. Has this already been partially merged into existing memory?
  • Conceptual richness — 0.06 weight. Does this memory carry dense, reusable information?

A memory with a combined score above the promotion threshold gets written to long-term storage. Everything below gets discarded or retained in the short-term buffer for reconsideration next cycle.

How to Enable Dreaming

Add the following to your OpenClaw config:

dreaming:
  enabled: true
  schedule: "0 3 * * *"   # 3 AM daily (cron syntax)
  minScore: 0.6            # promotion threshold
  maxMemories: 200         # cap on long-term entries

The schedule field accepts standard cron syntax. The default is 0 3 * * * (3 AM local time), but you can adjust based on your bot's usage patterns. A bot that's active around the clock might benefit from a more frequent cycle, such as 0 */6 * * * (every 6 hours).

Once enabled, you can manage dreaming from within a conversation using these CLI commands:

  • /dreaming status — Shows when the last cycle ran, how many memories were promoted, and current long-term memory size.
  • /dreaming on — Enables dreaming if it was disabled.
  • /dreaming off — Pauses dreaming without removing existing memories.
  • /dreaming run — Triggers an immediate consolidation cycle (useful for testing).

Using Dreaming on OpenClaw Launch

If you're using OpenClaw Launch managed hosting, you don't need to manage the schedule yourself. Dreaming support is being rolled out as part of our managed infrastructure — when it's available for your instance, it will appear in your instance settings panel.

In the meantime, you can configure dreaming manually in your bot's config file. Check our memory guide for a complete walkthrough of how OpenClaw memory works end-to-end — from session memory to long-term consolidation.

Dreaming is available on all paid plans (Lite and Pro). Free instances can run manual cycles with /dreaming run but cannot schedule automatic background consolidation.

The DREAMS.md Diary

After each dreaming cycle, OpenClaw writes a human-readable log to DREAMS.md in your bot's config directory. This diary shows exactly what the consolidator decided to remember — and what it discarded.

A typical entry looks like this:

## Dream Cycle — 2026-04-09 03:00 UTC

### Promoted to Long-Term Memory
- User prefers concise bullet-point answers over paragraphs (score: 0.87)
- Project uses PostgreSQL 16 on Docker with Drizzle ORM (score: 0.81)
- Deployment happens via PM2 reload, never stop+start (score: 0.79)

### Discarded (below threshold)
- User asked about the weather in passing (score: 0.12)
- One-off question about a specific date (score: 0.09)

### Stats
Cycles run: 14 | Promoted: 3 | Discarded: 22 | Total long-term: 47

Reviewing DREAMS.md occasionally is a good way to audit what your bot has learned. If you see something that shouldn't be in long-term memory, you can edit MEMORY.md directly to remove it.

Tips for Getting the Most from Dreaming

  • Schedule during true idle time. Dreaming reads recent conversation logs and runs inference — on a busy bot, a 3 AM cycle avoids competing with live traffic.
  • Start with the default threshold. A minScore of 0.6 is conservative. Lower it to 0.5 if you want more memories retained; raise it to 0.75 if you find too much noise getting promoted.
  • Don't run cycles too frequently. Dreaming is designed for daily runs. Running it hourly won't hurt, but the marginal benefit drops quickly — most new insight accumulates over full-day windows.
  • Review DREAMS.md after the first few cycles. Early cycles on a new bot often promote setup context that becomes stale quickly. A quick review lets you manually prune before it compounds.
  • Privacy consideration: Long-term memory is stored in plain text in MEMORY.md. If your bot handles sensitive user data, review what gets promoted and consider setting a tighter maxMemories cap or disabling dreaming for compliance-sensitive deployments.

Third-Party Extensions

The OpenClaw community has built several plugins that extend or customize the dreaming pipeline:

  • OpenClawDreams — A community plugin that adds custom scoring rules, letting you boost or suppress specific memory categories. Useful if your bot has a narrow domain and you want to heavily favor domain-specific memories.
  • openclaw-auto-dream — Adds a trigger-based dreaming mode: instead of a fixed schedule, it fires a consolidation cycle automatically when the short-term buffer exceeds a configurable size. Good for bots with unpredictable usage patterns.

Both plugins are configured via the standard plugins.entries block in your config. Check the memory guide for plugin setup instructions.

Frequently Asked Questions

Does dreaming affect live bot performance?
No. Dreaming runs as a background process and does not block or slow down live conversations. If a dreaming cycle happens to overlap with a conversation, the cycle yields resources to the live session.

Will dreaming delete my existing MEMORY.md?
No. Dreaming appends to and refines existing long-term memory — it never deletes it wholesale. Individual entries may be deduplicated or merged if they become redundant, but the file itself is always additive.

Can I run dreaming on a bot that doesn't have session memory enabled?
Dreaming requires session memory to be active, since it consolidates from the session buffer. If your bot has session memory disabled, dreaming will enable a minimal buffer automatically when the first cycle runs. See the memory guide for how to configure session memory.

What model does dreaming use for pattern extraction?
By default, dreaming uses the same primary model configured for your bot. You can override this with dreaming.model in your config to use a faster or cheaper model for consolidation (e.g., a smaller model for REM sleep and your full model only for the final promotion decision).

Build with OpenClaw

Deploy your own AI agent in under 10 seconds — no servers, no CLI.

Deploy Now