From 2a5d3ad5b9931280ca3b70b5f926d502dbba6eb0 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 26 Apr 2026 04:04:02 -0700 Subject: [PATCH] docs(dreaming): rewrite with AccordionGroup for phases and backfill, Tabs for quick start and CLI workflow, ParamField for dreaming defaults --- docs/concepts/dreaming.md | 223 +++++++++++++++++++------------------- 1 file changed, 111 insertions(+), 112 deletions(-) diff --git a/docs/concepts/dreaming.md b/docs/concepts/dreaming.md index 6f107b5c947..53fd5d5f516 100644 --- a/docs/concepts/dreaming.md +++ b/docs/concepts/dreaming.md @@ -1,17 +1,18 @@ --- summary: "Background memory consolidation with light, deep, and REM phases plus a Dream Diary" title: "Dreaming" +sidebarTitle: "Dreaming" read_when: - You want memory promotion to run automatically - You want to understand what each dreaming phase does - You want to tune consolidation without polluting MEMORY.md --- -Dreaming is the background memory consolidation system in `memory-core`. -It helps OpenClaw move strong short-term signals into durable memory while -keeping the process explainable and reviewable. +Dreaming is the background memory consolidation system in `memory-core`. It helps OpenClaw move strong short-term signals into durable memory while keeping the process explainable and reviewable. + Dreaming is **opt-in** and disabled by default. + ## What dreaming writes @@ -32,69 +33,63 @@ Dreaming uses three cooperative phases: | Deep | Score and promote durable candidates | Yes (`MEMORY.md`) | | REM | Reflect on themes and recurring ideas | No | -These phases are internal implementation details, not separate user-configured -"modes." +These phases are internal implementation details, not separate user-configured "modes." -### Light phase + + + Light phase ingests recent daily memory signals and recall traces, dedupes them, and stages candidate lines. -Light phase ingests recent daily memory signals and recall traces, dedupes them, -and stages candidate lines. + - Reads from short-term recall state, recent daily memory files, and redacted session transcripts when available. + - Writes a managed `## Light Sleep` block when storage includes inline output. + - Records reinforcement signals for later deep ranking. + - Never writes to `MEMORY.md`. -- Reads from short-term recall state, recent daily memory files, and redacted session transcripts when available. -- Writes a managed `## Light Sleep` block when storage includes inline output. -- Records reinforcement signals for later deep ranking. -- Never writes to `MEMORY.md`. + + + Deep phase decides what becomes long-term memory. -### Deep phase + - Ranks candidates using weighted scoring and threshold gates. + - Requires `minScore`, `minRecallCount`, and `minUniqueQueries` to pass. + - Rehydrates snippets from live daily files before writing, so stale/deleted snippets are skipped. + - Appends promoted entries to `MEMORY.md`. + - Writes a `## Deep Sleep` summary into `DREAMS.md` and optionally writes `memory/dreaming/deep/YYYY-MM-DD.md`. -Deep phase decides what becomes long-term memory. + + + REM phase extracts patterns and reflective signals. -- Ranks candidates using weighted scoring and threshold gates. -- Requires `minScore`, `minRecallCount`, and `minUniqueQueries` to pass. -- Rehydrates snippets from live daily files before writing, so stale/deleted snippets are skipped. -- Appends promoted entries to `MEMORY.md`. -- Writes a `## Deep Sleep` summary into `DREAMS.md` and optionally writes `memory/dreaming/deep/YYYY-MM-DD.md`. + - Builds theme and reflection summaries from recent short-term traces. + - Writes a managed `## REM Sleep` block when storage includes inline output. + - Records REM reinforcement signals used by deep ranking. + - Never writes to `MEMORY.md`. -### REM phase - -REM phase extracts patterns and reflective signals. - -- Builds theme and reflection summaries from recent short-term traces. -- Writes a managed `## REM Sleep` block when storage includes inline output. -- Records REM reinforcement signals used by deep ranking. -- Never writes to `MEMORY.md`. + + ## Session transcript ingestion -Dreaming can ingest redacted session transcripts into the dreaming corpus. When -transcripts are available, they are fed into the light phase alongside daily -memory signals and recall traces. Personal and sensitive content is redacted -before ingestion. +Dreaming can ingest redacted session transcripts into the dreaming corpus. When transcripts are available, they are fed into the light phase alongside daily memory signals and recall traces. Personal and sensitive content is redacted before ingestion. ## Dream Diary -Dreaming also keeps a narrative **Dream Diary** in `DREAMS.md`. -After each phase has enough material, `memory-core` runs a best-effort background -subagent turn (using the default runtime model) and appends a short diary entry. +Dreaming also keeps a narrative **Dream Diary** in `DREAMS.md`. After each phase has enough material, `memory-core` runs a best-effort background subagent turn (using the default runtime model) and appends a short diary entry. -This diary is for human reading in the Dreams UI, not a promotion source. -Dreaming-generated diary/report artifacts are excluded from short-term -promotion. Only grounded memory snippets are eligible to promote into -`MEMORY.md`. + +This diary is for human reading in the Dreams UI, not a promotion source. Dreaming-generated diary/report artifacts are excluded from short-term promotion. Only grounded memory snippets are eligible to promote into `MEMORY.md`. + There is also a grounded historical backfill lane for review and recovery work: -- `memory rem-harness --path ... --grounded` previews grounded diary output from historical `YYYY-MM-DD.md` notes. -- `memory rem-backfill --path ...` writes reversible grounded diary entries into `DREAMS.md`. -- `memory rem-backfill --path ... --stage-short-term` stages grounded durable candidates into the same short-term evidence store the normal deep phase already uses. -- `memory rem-backfill --rollback` and `--rollback-short-term` remove those staged backfill artifacts without touching ordinary diary entries or live short-term recall. + + + - `memory rem-harness --path ... --grounded` previews grounded diary output from historical `YYYY-MM-DD.md` notes. + - `memory rem-backfill --path ...` writes reversible grounded diary entries into `DREAMS.md`. + - `memory rem-backfill --path ... --stage-short-term` stages grounded durable candidates into the same short-term evidence store the normal deep phase already uses. + - `memory rem-backfill --rollback` and `--rollback-short-term` remove those staged backfill artifacts without touching ordinary diary entries or live short-term recall. + + -The Control UI exposes the same diary backfill/reset flow so you can inspect -results in the Dreams scene before deciding whether the grounded candidates -deserve promotion. The Scene also shows a distinct grounded lane so you can see -which staged short-term entries came from historical replay, which promoted -items were grounded-led, and clear only grounded-only staged entries without -touching ordinary live short-term state. +The Control UI exposes the same diary backfill/reset flow so you can inspect results in the Dreams scene before deciding whether the grounded candidates deserve promotion. The Scene also shows a distinct grounded lane so you can see which staged short-term entries came from historical replay, which promoted items were grounded-led, and clear only grounded-only staged entries without touching ordinary live short-term state. ## Deep ranking signals @@ -109,13 +104,11 @@ Deep ranking uses six weighted base signals plus phase reinforcement: | Consolidation | 0.10 | Multi-day recurrence strength | | Conceptual richness | 0.06 | Concept-tag density from snippet/path | -Light and REM phase hits add a small recency-decayed boost from -`memory/.dreams/phase-signals.json`. +Light and REM phase hits add a small recency-decayed boost from `memory/.dreams/phase-signals.json`. ## Scheduling -When enabled, `memory-core` auto-manages one cron job for a full dreaming -sweep. Each sweep runs phases in order: light -> REM -> deep. +When enabled, `memory-core` auto-manages one cron job for a full dreaming sweep. Each sweep runs phases in order: light → REM → deep. Default cadence behavior: @@ -125,43 +118,44 @@ Default cadence behavior: ## Quick start -Enable dreaming: - -```json -{ - "plugins": { - "entries": { - "memory-core": { - "config": { - "dreaming": { - "enabled": true + + + ```json + { + "plugins": { + "entries": { + "memory-core": { + "config": { + "dreaming": { + "enabled": true + } + } } } } } - } -} -``` - -Enable dreaming with a custom sweep cadence: - -```json -{ - "plugins": { - "entries": { - "memory-core": { - "config": { - "dreaming": { - "enabled": true, - "timezone": "America/Los_Angeles", - "frequency": "0 */6 * * *" + ``` + + + ```json + { + "plugins": { + "entries": { + "memory-core": { + "config": { + "dreaming": { + "enabled": true, + "timezone": "America/Los_Angeles", + "frequency": "0 */6 * * *" + } + } } } } } - } -} -``` + ``` + + ## Slash command @@ -174,47 +168,52 @@ Enable dreaming with a custom sweep cadence: ## CLI workflow -Use CLI promotion for preview or manual apply: + + + ```bash + openclaw memory promote + openclaw memory promote --apply + openclaw memory promote --limit 5 + openclaw memory status --deep + ``` -```bash -openclaw memory promote -openclaw memory promote --apply -openclaw memory promote --limit 5 -openclaw memory status --deep -``` + Manual `memory promote` uses deep-phase thresholds by default unless overridden with CLI flags. -Manual `memory promote` uses deep-phase thresholds by default unless overridden -with CLI flags. + + + Explain why a specific candidate would or would not promote: -Explain why a specific candidate would or would not promote: + ```bash + openclaw memory promote-explain "router vlan" + openclaw memory promote-explain "router vlan" --json + ``` -```bash -openclaw memory promote-explain "router vlan" -openclaw memory promote-explain "router vlan" --json -``` + + + Preview REM reflections, candidate truths, and deep promotion output without writing anything: -Preview REM reflections, candidate truths, and deep promotion output without -writing anything: + ```bash + openclaw memory rem-harness + openclaw memory rem-harness --json + ``` -```bash -openclaw memory rem-harness -openclaw memory rem-harness --json -``` + + ## Key defaults All settings live under `plugins.entries.memory-core.config.dreaming`. -| Key | Default | -| ----------- | ----------- | -| `enabled` | `false` | -| `frequency` | `0 3 * * *` | + + Enable or disable the dreaming sweep. + + + Cron cadence for the full dreaming sweep. + -Phase policy, thresholds, and storage behavior are internal implementation -details (not user-facing config). - -See [Memory configuration reference](/reference/memory-config#dreaming) -for the full key list. + +Phase policy, thresholds, and storage behavior are internal implementation details (not user-facing config). See [Memory configuration reference](/reference/memory-config#dreaming) for the full key list. + ## Dreams UI @@ -230,6 +229,6 @@ When enabled, the Gateway **Dreams** tab shows: ## Related - [Memory](/concepts/memory) -- [Memory Search](/concepts/memory-search) -- [memory CLI](/cli/memory) +- [Memory CLI](/cli/memory) - [Memory configuration reference](/reference/memory-config) +- [Memory search](/concepts/memory-search)