Automatic memory consolidation — turn scattered daily notes into clean, organized long-term memory.
Memory files accumulate noise over time: relative dates lose meaning, contradictory entries confuse the agent, duplicates waste context, and stale information causes hallucinations. Dream fixes this by running a structured consolidation pass.
openclaw cron add for daily execution (recommended: 3-4 AM)memory/.last_dream is older than 24h AND new daily notes exist since last dreamAlways run as a sub-agent to avoid blocking the main session:
sessions_spawn:
task: "Run openclaw-dream consolidation. Read the skill at skills/openclaw-dream/SKILL.md first."
mode: run
model: sonnet # use a cheaper model
For manual triggers in the main session, spawn the sub-agent, reply to user "开始整理记忆,稍后汇报结果", then yield.
MEMORY.md — note current line count, section headers, last-updated datememory/YYYY-MM-DD.md files from the last 14 daysmemory/self-improving/*.jsonl if it exists (error/correction/best_practice/decision logs).last_dream timestamp to know what's already been processedScan all content for these problems:
Relative dates — Find phrases like "yesterday", "today", "last week", "recently", "刚才", "昨天", "上周". Cross-reference with the file's date to compute the absolute date.
Contradictions — Same topic with conflicting conclusions across different files. Examples:
Duplicates — Same fact recorded in multiple daily notes. Example:
Stale entries — Information about things that no longer exist:
Unprocessed JSONL patterns — High-frequency errors or corrections in self-improving logs that should become rules in MEMORY.md
Important events not yet in MEMORY.md — Significant decisions, lessons, or changes in daily notes that deserve long-term retention
Execute fixes in this order:
[superseded by YYYY-MM-DD] to the old entry if in a daily notememory/self-improving/.last_distill timestamp最后更新 date at the bottom```bash
openclaw memory index --force
```
memory/dream-log-YYYY-MM-DD.md:```markdown
# Dream Log YYYY-MM-DD
## Changes Made
## MEMORY.md Stats
## Skipped
```
```bash
date -u +%Y-%m-%dT%H:%M:%SZ > memory/.last_dream
```
Users can create DREAM.md in workspace root to customize behavior:
# DREAM.md
## Settings
- max_memory_lines: 250
- lookback_days: 14
- min_hours_between_dreams: 24
## Protected Sections
<!-- These MEMORY.md sections are never auto-pruned -->
- 经验教训
- 关于 River
- Agent 网络
## Custom Rules
<!-- Additional consolidation rules -->
- Always keep pricing/billing related entries
- Merge duplicate API endpoint references
If DREAM.md doesn't exist, use defaults above.
openclaw cron add \
--id dream-nightly \
--schedule "0 3 * * *" \
--task "Run openclaw-dream memory consolidation. Read skills/openclaw-dream/SKILL.md and follow Phase 1-4." \
--model sonnet \
--isolated
共 1 个版本