Claude
Skills
Sign in
Back

openclaw-auto-dream

Included with Lifetime
$97 forever

```markdown

Writing & Docs

What this skill does

```markdown
---
name: openclaw-auto-dream
description: Automatic cognitive memory consolidation for OpenClaw/MyClaw agents — sleep cycles, importance scoring, forgetting curves, knowledge graphs, and health dashboards.
triggers:
  - set up auto-dream memory for my openclaw agent
  - configure memory consolidation for myclaw
  - how do I install openclaw auto-dream
  - my ai agent keeps forgetting things between sessions
  - set up dream cycles for memory management
  - how does auto-dream importance scoring work
  - export or import memory bundle between myclaw instances
  - show me the memory health dashboard
---

# OpenClaw Auto-Dream

> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.

OpenClaw Auto-Dream is a cognitive memory architecture for [OpenClaw](https://github.com/openclaw/openclaw) agents (as used on [MyClaw.ai](https://myclaw.ai)). It gives your AI agent the ability to periodically "sleep and dream" — scanning raw daily logs, extracting structured knowledge, scoring importance, applying forgetting curves, building a knowledge graph, and surfacing non-obvious insights. The result is an agent that genuinely learns and connects the dots over time rather than accumulating stale, disconnected files.

---

## How It Works

Auto-Dream runs a **three-phase dream cycle** (default: 4 AM daily via cron):

1. **Collect** — Scans unconsolidated daily logs (last 7 days), detects priority markers, extracts decisions/people/facts/projects/lessons/procedures/open threads.
2. **Consolidate** — Routes each insight to one of five memory layers, deduplicates semantically, assigns unique IDs (`mem_NNN`), creates relation links.
3. **Evaluate** — Scores importance, applies forgetting curves, calculates a 5-metric health score, generates insights, writes dream report, sends notification.

### Five Memory Layers

| Layer | Storage | Purpose |
|-------|---------|---------|
| Working | LCM plugin (auto-detected) | Real-time context compression & semantic recall |
| Episodic | `memory/episodes/*.md` | Project narratives, event timelines |
| Long-term | `MEMORY.md` | Facts, decisions, people, milestones, strategy |
| Procedural | `memory/procedures.md` | Workflows, preferences, tool patterns |
| Index | `memory/index.json` | Metadata, scores, relations, health stats |

---

## Installation

### Via ClawHub (Recommended)

Tell your MyClaw agent:

```
Install the openclaw-auto-dream skill from ClawHub
```

Or manually inside your OpenClaw agent environment:

```bash
claw skill install openclaw-auto-dream
```

### Manual Installation

Clone into your OpenClaw skills directory:

```bash
git clone https://github.com/LeoYeAI/openclaw-auto-dream.git \
  ~/.openclaw/skills/openclaw-auto-dream
```

Then register the skill with your agent:

```bash
claw skill register ~/.openclaw/skills/openclaw-auto-dream
```

### First-Time Setup

After installation, tell your agent:

```
Set up auto-dream
```

The setup wizard will:
- Detect whether the optional LCM plugin is available (for the Working memory layer)
- Create the `memory/` directory structure
- Initialize `memory/index.json` with default health metrics
- Ask for your preferred notification level (`silent` / `summary` / `full`)
- Schedule the dream cron job (default: `0 4 * * *`)

---

## Configuration

Auto-Dream is configured via `memory/config.json` in your agent's workspace:

```json
{
  "dream_schedule": "0 4 * * *",
  "notification_level": "summary",
  "scan_window_days": 7,
  "forgetting": {
    "min_age_days": 90,
    "importance_threshold": 0.3
  },
  "scoring": {
    "recency_half_life_days": 180,
    "permanent_marker": "⚠️ PERMANENT",
    "high_marker": "🔥 HIGH",
    "pin_marker": "📌 PIN"
  },
  "layers": {
    "working_lcm": true,
    "episodic": true,
    "long_term": true,
    "procedural": true
  },
  "export": {
    "compress": true,
    "include_archive": false
  }
}
```

### Environment Variables

If you need to override config values via the environment (e.g. in CI or multi-instance deployments):

```bash
AUTODREAM_SCHEDULE="0 2 * * *"          # Override cron schedule
AUTODREAM_NOTIFY_LEVEL="full"           # silent | summary | full
AUTODREAM_SCAN_DAYS=14                  # Days of logs to scan per cycle
AUTODREAM_FORGET_THRESHOLD=0.25         # Importance below which entries are archived
```

---

## Key Commands (Agent Natural Language)

These phrases trigger built-in Auto-Dream intents inside your OpenClaw agent:

| Phrase | Action |
|--------|--------|
| `"Dream now"` | Trigger an immediate full dream cycle |
| `"Show memory dashboard"` | Generate and open the interactive HTML dashboard |
| `"What do you remember about [topic]?"` | Semantic search across all memory layers |
| `"Memory health"` | Print current 5-metric health score |
| `"Export memory bundle"` | Export all layers to `memory/export-YYYY-MM-DD.json` |
| `"Import memory bundle"` | Merge an exported bundle into current memory |
| `"Export only procedures"` | Selective single-layer export |
| `"Forget [topic]"` | Immediately archive entries matching topic |
| `"Pin this"` | Mark current context with `📌 PIN` (immune to forgetting) |
| `"What did you learn last week?"` | Show insights from the last 7 dream logs |

---

## Priority Markers in Daily Logs

Auto-Dream scans your agent's daily log files for special markers during the Collect phase. Use these in any log entry or conversation note:

```markdown
<!-- important -->
Decided to use Postgres over SQLite for the user DB — scalability concern.

⚠️ PERMANENT
Client prefers all reports in US Letter format, not A4.

🔥 HIGH
The deploy pipeline breaks when NODE_ENV is not explicitly set.

📌 PIN
Weekly sync with Alex every Tuesday at 10 AM.
```

| Marker | Effect |
|--------|--------|
| `<!-- important -->` | Extracted and routed to appropriate memory layer |
| `⚠️ PERMANENT` | Always scores `1.0` importance; never archived |
| `🔥 HIGH` | Base weight doubled during importance scoring |
| `📌 PIN` | Immune to forgetting curve; always retained |

---

## Importance Scoring

Every memory entry is scored on each dream cycle:

```
importance = (base_weight × recency_factor × reference_boost) / 8.0
```

Where:
- `recency_factor = max(0.1, 1.0 - days_since_created / 180)`
- `reference_boost = log₂(reference_count + 1)`
- `base_weight` doubles for `🔥 HIGH` entries; `⚠️ PERMANENT` always returns `1.0`

### Example (Python-style pseudocode)

```python
import math

def score_entry(entry: dict, today_date) -> float:
    if "⚠️ PERMANENT" in entry.get("markers", []):
        return 1.0

    days_old = (today_date - entry["created_at"]).days
    recency = max(0.1, 1.0 - days_old / 180)

    refs = entry.get("reference_count", 0)
    ref_boost = math.log2(refs + 1) if refs > 0 else 1.0

    base = entry.get("base_weight", 1.0)
    if "🔥 HIGH" in entry.get("markers", []):
        base *= 2.0

    return min(1.0, (base * recency * ref_boost) / 8.0)
```

---

## Forgetting Curve & Archival

Entries are **never deleted** — only gracefully archived:

```python
def should_archive(entry: dict, today_date) -> bool:
    # Immune markers
    immune = {"⚠️ PERMANENT", "📌 PIN"}
    if immune & set(entry.get("markers", [])):
        return False

    days_unreferenced = (today_date - entry["last_referenced"]).days
    importance = entry["importance_score"]

    return days_unreferenced > 90 and importance < 0.3

def archive_entry(entry: dict):
    summary = f"[{entry['id']}] {entry['title']} — {entry['one_line_summary']}"
    append_to_file("memory/archive.md", summary)
    entry["status"] = "archived"
    # Original ID preserved for relation tracking
```

---

## Health Score

```
health = (
    freshness   × 0.25 +
    coverage    × 0.25 +
    coherence   × 0.20 +
    efficiency  × 0.15 +
    reachability× 0.15
) × 100
```

| Metric | Definition |
|--------|-----------|
| **Freshness** | % of entries referenced in the last 30 days |
| **Coverage** | % of knowledge categories updated in the l

Related in Writing & Docs