Memory Dream Consolidation

v1.0.0

Structured memory classification and periodic consolidation (Dream) for OpenClaw agents. Activate when setting up a new agent's memory system, when MEMORY.md...

0· 114·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for xwz119/memory-dream-consolidation.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Memory Dream Consolidation" (xwz119/memory-dream-consolidation) from ClawHub.
Skill page: https://clawhub.ai/xwz119/memory-dream-consolidation
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install memory-dream-consolidation

ClawHub CLI

Package manager switcher

npx clawhub@latest install memory-dream-consolidation
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the requested actions: reading MEMORY.md and daily notes, classifying entries, consolidating and pruning memory files, and updating heartbeat-state.json. No unrelated credentials, binaries, or installs are requested.
Instruction Scope
Instructions explicitly tell the agent to read/write/delete files inside the agent's memory/docs (MEMORY.md, daily notes, heartbeat-state.json, AGENTS.md, HEARTBEAT.md). This is expected for a consolidation system, but the skill will modify and delete user-visible content — review and backups are recommended before enabling autonomous runs.
Install Mechanism
Instruction-only skill with no install spec or third-party downloads. No code files to execute, so nothing is written to disk by an installer.
Credentials
No environment variables, credentials, or external endpoints are requested. All required artifacts are local files within the agent workspace, which is proportional to the described purpose.
Persistence & Privilege
always:false (good). The skill recommends running during heartbeats and updating heartbeat-state.json and MEMORY.md; that implies autonomous read/write access to the agent workspace. This is appropriate for a memory manager but increases blast radius if the agent has broad filesystem permissions—consider limiting workspace write scope or requiring user confirmation for destructive changes.
Assessment
This skill appears coherent for local memory consolidation and does not ask for credentials or external installs. However it will edit and prune your MEMORY.md and related files (including deleting contradicted facts). Before enabling autonomous runs: (1) back up MEMORY.md and your memory directory; (2) review the SKILL.md's pruning rules so you understand what may be deleted or replaced; (3) if you want human review, require the agent to prompt before making deletions/major edits; (4) note the included reference file mentions a ‘source leak’ — if intellectual-property provenance matters, review that file before trusting its guidance. If any of these are unacceptable, do not enable autonomous execution or restrict the skill to user-invoked only.

Like a lobster shell, security has layers — review code before you run it.

latestvk97eh4fhs2q3de5aq224v5qnm9845a5f
114downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

Memory Dream — 记忆分类与整合系统

Inspired by Claude Code's Dream memory consolidation system. Adapted for OpenClaw's file-based memory architecture.

Memory Classification — 四类记忆

Every memory entry belongs to one of four types. Tag each entry when writing.

TypeWhat to StoreWhereExample
userUser's role, preferences, knowledge, communication styleUSER.md / MEMORY.md"Jim prefers casual Chinese, works at Amazon, timezone UTC+8"
feedbackCorrections AND confirmations — what works and what doesn'tAGENTS.md / MEMORY.md"append over write for Feishu docs. Why: write overwrites history. How: always use feishu_doc append"
projectOngoing work, goals, deadlines, decisionsdaily notes / MEMORY.md"France trip Jun 19-27, 4 people, budget TBD — optimized for museum closure days"
referencePointers to where information livesTOOLS.md / MEMORY.md"Brave API ~1000/mo free, usage tracked in memory/brave-search-usage.json"

Writing Format

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]

Key Principles

  1. Record success too — Only recording failures makes the agent overly cautious. "This approach worked well + why" is as valuable as "this broke + why"
  2. Include Why — Without Why, the agent can't judge edge cases and blindly follows rules
  3. Absolute dates only — Write "2026-03-31" not "today" or "yesterday". Memories must be interpretable after time passes
  4. Verify before trusting — "Memory says X exists" ≠ "X exists now". Check current state before acting on recalled memories

What NOT to Store

  • Code patterns, architecture, file structure (derivable from code)
  • Git history (git log is authoritative)
  • Debugging solutions (the fix is in the code, commit message has context)
  • Ephemeral task details or current conversation context
  • Content already in CLAUDE.md / AGENTS.md

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.

MEMORY.md Size Control

Hard limit: 200 lines / 25KB. When exceeded, run a Dream cycle.

Check with: wc -l MEMORY.md && wc -c MEMORY.md

Dream Cycle — 记忆整合流程

A periodic consolidation pass over memory files. Run during heartbeats or when MEMORY.md exceeds limits.

Trigger Gates (all three must pass)

  1. Time gate: ≥ 3 days since last Dream
  2. Session gate: ≥ 3 days of new daily notes since last Dream
  3. Lock gate: No other Dream in progress

Track state in memory/heartbeat-state.json:

{
  "lastDreamAt": "2026-03-31T15:40:00Z",
  "lastDreamResult": "pruned from 269 to 85 lines"
}

Four Phases

Phase 1 — Orient

  • Read MEMORY.md — understand current long-term memory landscape
  • Scan recent memory/YYYY-MM-DD.md files since last Dream
  • Note current MEMORY.md line count and byte size

Phase 2 — Gather

  • Extract entries worth keeping long-term from daily notes
  • Classify each as user / feedback / project / reference
  • Priority: important decisions, then lessons learned, then discoveries, then people info
  • Collect successes too, not just failures

Phase 3 — Consolidate

  • Write or update MEMORY.md entries in appropriate sections
  • Convert any relative dates to absolute dates
  • Delete contradicted facts (new info overrides old)
  • Merge near-duplicate entries
  • For feedback type: ensure each has Why + How to apply

Phase 4 — Prune

  • Enforce ≤ 200 lines / 25KB limit
  • Remove: completed projects, resolved issues, stale preferences
  • Replace verbose details with pointers: "详见 daily notes 2026-03-31"
  • Check for and resolve contradictions between entries

After Dream

  • Update lastDreamAt in heartbeat-state.json
  • Log what was done in today's daily notes: lines before → after, what was added/removed

Setup Guide — First-Time Configuration

To add this system to a new OpenClaw agent:

  1. Add the memory classification table and Dream procedure to AGENTS.md
  2. Add size limit header to MEMORY.md:
    > 📏 限制:≤ 200 行 / 25KB | 上次整理:YYYY-MM-DD
    
  3. Add lastDreamAt field to memory/heartbeat-state.json
  4. Add Dream trigger check to HEARTBEAT.md:
    - [ ] **记忆整理(Dream)**:检查是否满足三重门控,满足则执行四阶段整理
    
  5. Run an initial Dream cycle to establish baseline

Memory Drift Warning

Before acting on a recalled memory:

  • If memory names a file path → check the file exists
  • If memory names a function or config → grep for it
  • If memory is a state snapshot (activity log, architecture) → prefer git log or reading current code
  • If memory conflicts with current reality → trust what you see now, update the memory

Comments

Loading comments...