Install
openclaw skills install memory-dream-consolidationStructured memory classification and periodic consolidation (Dream) for OpenClaw agents. Activate when setting up a new agent's memory system, when MEMORY.md is getting too long (over 200 lines), when doing periodic memory maintenance during heartbeats, or when the user says "整理记忆" "记忆维护" "dream" "memory cleanup". NOT for daily note writing (just write normally) or conversation recall (use memory_search).
openclaw skills install memory-dream-consolidationInspired by Claude Code's Dream memory consolidation system. Adapted for OpenClaw's file-based memory architecture.
Every memory entry belongs to one of four types. Tag each entry when writing.
| Type | What to Store | Where | Example |
|---|---|---|---|
| user | User's role, preferences, knowledge, communication style | USER.md / MEMORY.md | "Jim prefers casual Chinese, works at Amazon, timezone UTC+8" |
| feedback | Corrections AND confirmations — what works and what doesn't | AGENTS.md / MEMORY.md | "append over write for Feishu docs. Why: write overwrites history. How: always use feishu_doc append" |
| project | Ongoing work, goals, deadlines, decisions | daily notes / MEMORY.md | "France trip Jun 19-27, 4 people, budget TBD — optimized for museum closure days" |
| reference | Pointers to where information lives | TOOLS.md / MEMORY.md | "Brave API ~1000/mo free, usage tracked in memory/brave-search-usage.json" |
Every feedback/project memory entry should follow:
**Rule/Fact:** [the thing itself]
**Why:** [reason — past incident, user preference, or constraint]
**How to apply:** [when/where this kicks in]
Even if the user asks to save something from the exclusion list, ask what was surprising or non-obvious — that's the part worth keeping.
Hard limit: 200 lines / 25KB. When exceeded, run a Dream cycle.
Check with: wc -l MEMORY.md && wc -c MEMORY.md
A periodic consolidation pass over memory files. Run during heartbeats or when MEMORY.md exceeds limits.
Track state in memory/heartbeat-state.json:
{
"lastDreamAt": "2026-03-31T15:40:00Z",
"lastDreamResult": "pruned from 269 to 85 lines"
}
memory/YYYY-MM-DD.md files since last DreamlastDreamAt in heartbeat-state.jsonTo add this system to a new OpenClaw agent:
> 📏 限制:≤ 200 行 / 25KB | 上次整理:YYYY-MM-DD
lastDreamAt field to memory/heartbeat-state.json- [ ] **记忆整理(Dream)**:检查是否满足三重门控,满足则执行四阶段整理
Before acting on a recalled memory: