Memory-Dream

v1.0.3

Memory consolidation for OpenClaw agents. Periodically reviews daily memory files (memory/*.md), extracts durable knowledge, and merges it into MEMORY.md — l...

0· 23·0 current·0 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name/description, declared behavior, and runtime instructions all match: the skill lists/reads memory/*.md, extracts facts, and edits MEMORY.md. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md confines actions to listing/reading memory files, reading/writing MEMORY.md (via surgical edits), and appending a run log to today's journal. It explicitly forbids deleting files and exposing secrets in reports. The instructions do reference cron/heartbeat integration and an `edit` tool for precise file edits — these are within scope but require the corresponding agent tools to exist.
Install Mechanism
There is no install spec in the registry (instruction-only skill). README suggests installing via ClawHub or cloning from a GitHub repo (raw.githubusercontent.com). Fetching code from GitHub is common but would introduce executable code from an external source; the registry metadata shows source/homepage unknown which reduces traceability. This is not necessarily malicious but worth verifying the repo before cloning/installing.
Credentials
The skill declares no environment variables, credentials, or config paths. Runtime instructions do not require secrets or unrelated tokens. The only file access is to memory/ and MEMORY.md, which is appropriate for the stated function.
Persistence & Privilege
always:false (normal). The skill is user-invocable and allowed to be invoked autonomously by the agent (platform default). It will write to MEMORY.md and append a Dream Log to today's memory file — this is necessary for its function but means it will make persistent changes to user files, so initial runs should be monitored/backed up.
Assessment
What to consider before installing or enabling: - Backup: Make a copy of MEMORY.md and your memory/ directory before first run so you can inspect changes and recover if needed. - Inspect source: The registry lists no homepage/source; README points to a GitHub repo. If you plan to clone/install, review that repository (SKILL.md/README/LICENSE) yourself to ensure it matches what's in the registry. - Manual first run: Trigger the skill manually (e.g., say "dream") and review the consolidation report and the diff of changes to MEMORY.md before allowing automatic cron runs. - Cron/automation: If you enable the recommended cron job, start with a low-frequency schedule (manual or weekly) until you confirm behavior is safe and idempotent. - Principle of least surprise: The skill will read recent daily logs and edit MEMORY.md and today's journal (append log). It claims not to delete files or surface secrets, but verify reports do not accidentally leak sensitive data. - Trust boundary: Because the skill can autonomously edit files, only enable it if you trust the author/source. If the source is unknown, keep confidence lower and require manual review of changes. - If you want higher assurance: ask the publisher for a signed release or a repository URL included in registry metadata; check for community reviews or run the skill in a sandbox/workspace copy first.

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

latestvk97as824vq5ahbr7k1wq5548cs8404n9

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Dream — Memory Consolidation for OpenClaw

Memory consolidation for OpenClaw agents. Your agent accumulates daily notes in memory/YYYY-MM-DD.md files, but without periodic consolidation, long-term memory (MEMORY.md) becomes stale while daily files grow endlessly. Dream fixes this — like REM sleep for your AI.

When to Use

  • User says "dream", "做梦", "consolidate memory", or "整理记忆"
  • Cron trigger (recommended: nightly at 3:00 AM)
  • Heartbeat detects memory files piling up (>20 files or >3000 total lines)

Consolidation Flow

Phase 1 — Orient

  1. ls memory/ to inventory daily files
  2. Read MEMORY.md to understand current long-term memory structure
  3. Count: total files, total lines, files from last 7 days

Phase 2 — Scan Recent Journals

Read daily files from the last 7 days (memory/YYYY-MM-DD.md). Extract:

  • New facts, preferences, or decisions not yet in MEMORY.md
  • Information that contradicts MEMORY.md (needs correction)
  • Recurring themes (indicates importance)

Token budget rules:

  • Skip files older than 7 days (too many tokens)
  • If a file exceeds 500 lines, read only the first 200 lines
  • Focus on headings and key facts, not verbose logs

Phase 3 — Merge into MEMORY.md

Apply these operations to MEMORY.md using surgical edits (not full rewrites):

  1. Add: Append new facts to the appropriate section
  2. Correct: Update outdated information with newer data from journals
  3. Deduplicate: Merge entries that say the same thing
  4. Prune: Remove clearly obsolete info (e.g., "temporary workaround for X" when X is resolved)
  5. Absolutize dates: Convert "yesterday", "just now" → actual dates (e.g., "2026-03-27")

Phase 4 — Mark Old Journals (Optional)

For daily files older than 30 days:

  • If content is consolidated → prepend: <!-- consolidated to MEMORY.md on YYYY-MM-DD -->
  • Never delete any file (user may want to look back)

Phase 5 — Report

Output a brief consolidation report:

🌙 Dream complete
- Scanned N daily files (X lines total)
- MEMORY.md: +N added / ~N corrected / -N pruned
- Next suggestion: [if any]

Critical Rules

  • MEMORY.md is the primary output — all consolidated knowledge goes here
  • Surgical edits only — use the edit tool for precise changes, never overwrite the whole file
  • Conservative by default — when unsure whether to remove something, keep it
  • No secrets in logs — don't expose API keys, passwords, or tokens in the dream report
  • Log each run — append a ## Dream Log (HH:MM) entry to today's memory/YYYY-MM-DD.md

Cron Setup

/cron add --schedule "0 3 * * *" --task "Execute dream skill: consolidate memory" --label dream-nightly

How It Works (Under the Hood)

This skill mimics the human sleep cycle's memory consolidation process:

Daily experiences          Nightly consolidation        Long-term memory
┌─────────────────┐       ┌─────────────────┐         ┌─────────────────┐
│ memory/03-26.md │──┐    │                 │         │                 │
│ memory/03-27.md │──┤    │    Dream Skill   │────────▶│   MEMORY.md     │
│ memory/03-28.md │──┤    │   (scan+merge)  │         │  (structured,   │
│ memory/03-29.md │──┘    │                 │         │   deduplicated) │
│       ...       │       └─────────────────┘         └─────────────────┘
└─────────────────┘
     Raw daily logs            Consolidation              Curated knowledge

Without Dream, MEMORY.md stays frozen at whatever was manually written, while daily files accumulate unbounded. With Dream, your agent's long-term memory stays fresh, accurate, and compact.

Files

2 total
Select a file
Select a file to preview.

Comments

Loading comments…