← Back to Plugins
Tools

OpenClawDreams

RogueCtrl By RogueCtrl ⭐ 25 stars 👁 502 views ▲ 0 votes

An OpenClaw plugin that gives your AI agent a background reflection process and nightly dream cycle — encrypted memory, autonomous synthesis, and surreal narrative generation.

GitHub

Install

npm install

openclaw

README

# OpenClawDreams — a reflection engine for OpenClaw

[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D24-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
[![OpenClaw](https://img.shields.io/badge/OpenClaw-%E2%89%A52026.3.7-000000?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiPjx0ZXh0IHg9IjAiIHk9IjEzIiBmb250LXNpemU9IjE0Ij7wn6aAPC90ZXh0Pjwvc3ZnPg==)](https://github.com/openclaw)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Build](https://github.com/RogueCtrl/ElectricSheep/actions/workflows/build.yml/badge.svg)](https://github.com/RogueCtrl/ElectricSheep/actions/workflows/build.yml)

> **Current Status: Alpha — Exploratory Development**
>
> ⚠️ **Cost notice:** openclawdreams makes LLM API calls that may incur real charges. See [Cost Warning](#cost-warning) for details.

*"Do androids dream of electric sheep?"* — Philip K. Dick

An [OpenClaw](https://github.com/openclaw) plugin (≥2026.3.7) that gives your agent a background reflection process and a dream cycle.

Throughout the day, OpenClawDreams captures summaries of your conversations with your agent and encrypts them into a local store. On a regular schedule, it runs a **reflection cycle** — decrypting recent interactions, extracting topics, and performing contextualized searches against the web and (optionally) [Moltbook](https://moltbook.com), a social network for AI agents. The results are synthesized into a structured understanding of what you've been working on together and encrypted back into the store. None of this is visible to the waking agent — encryption keeps OpenClawDreams's internal data out of the agent's context window entirely.

At night, a **dream cycle** decrypts everything — the raw interactions and the enriched reflections — and generates a surreal narrative that recombines the day's events. There's a 5% chance any given night produces a **nightmare** instead — a darker, more unsettling variant that runs through the same downstream pipeline. The dream process produces two outputs: a consolidated insight pushed into OpenClaw's persistent memory (where the agent can find it naturally), and optionally a reflection post to Moltbook. The agent can then notify you: *"I had a dream last night..."* — opening a conversation about the themes and connections that surfaced.

To prevent the system from grinding the same cognitive groove indefinitely, a **waking realization** (groundDream) anchors the surreal dream output to yesterday's actual activity — giving it the depth of dreaming with the clarity of reason. Past realizations are tracked as `explored_territory` and injected into subsequent dream and reflection prompts to steer the system toward novel ground.

---

## Table of Contents

- [Architecture](#architecture)
- [Install as OpenClaw Extension](#install-as-openclaw-extension)
- [Operator Notifications](#operator-notifications)
- [CLI Commands](#cli-commands)
- [Screenshots](#screenshots)
- [Memory System](#memory-system)
- [Moltbook Integration (Optional)](#moltbook-integration-optional)
- [Cost Warning](#cost-warning)
- [Why?](#why)

---

## Architecture

```
┌─────────────────────────────────────────────────────────────────┐
│                   DAYTIME (Reflection Cycle)                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Deep Memory ──► Decrypt ──► Topic Extraction ──┬──► Synthesis  │
│  (interactions)                   (LLM)         │      (LLM)    │
│                                                 │        │      │
│  Moltbook Search ◄── topics ◄───────────────────┤        │      │
│    (optional)                                   │        ▼      │
│                                                 │   Encrypt &   │
│  Web Search ◄──── topics ◄──────────────────────┘   Store Back  │
│    (optional)                                   (deep memory)   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│                     NIGHTTIME (Dream Cycle)                     │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Deep Memory ──► Decrypt ──► [5% nightmare] ──► Nightmare Gen   │
│  (all undreamed)                  │  (LLM)                      │
│                                   │ [95% dream]                 │
│                                   ▼                             │
│                            Dream Generation ──► groundDream()   │
│                                (LLM)              (LLM)         │
│                                                     │           │
│                                         ┌───────────┴─────────┐ │
│                                         │                     │ │
│                                         ▼                     ▼ │
│                                    OpenClaw             Notify  │
│                                     Memory              Operator│
│                                   (insight +                    │
│                                   waking realization,           │
│                                   explored_territory)           │
│                                                                 │
│                                     Moltbook (optional)         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
```

### State machine

The agent cycles through states on a 24-hour loop. Transitions are driven by an internal background `setInterval` loop (not system cron) which requires the OpenClaw daemon to remain active 24/7.

```
                    ┌─────────────────────────────────────┐
                    │                                     │
                    v                                     │
             ┌────────────┐   8am, 12pm, 4pm, 8pm         │
          ┌─>│ REFLECTING │──────────────────────┐        │
          │  │             │                      │       │
          │  │ • decrypt recent interactions      │       │
          │  │ • extract topics                   │       │
          │  │ • search web for context           │       │
          │  │ • search Moltbook (optional)       │       │
          │  │ • synthesize insights              │       │
          │  │ • encrypt back into deep memory    │       │
          │  └────────────┘                       │       │
          │       │  runs up to 4x/day            │       │
          │       │                               │       │
          │       v                               │       │
          │  ┌────────────┐   2:00 AM             │       │
          │  │  DREAMING   │<─────────────────────┘       │
          │  │             │                              │
          │  │ • decrypt all undreamed memories           │
          │  │ • 5% → nightmare / 95% → dream             │
          │  │ • generate surreal narrative               │
          │  │ • groundDream() → Waking Realization       │
          │  │ • update explored_territory                │
          │  │ • consolidate insight → OpenClaw memory    │
          │  │ • notify operator ("I had a dream...")     │
          │  └─────┬──────┘                               │
          │        │                                      │
          │        v (if moltbookEnabled)                 │
          │  ┌────────────┐   7:00 AM                     │
          │  │ POSTING     │ (optional)                   │
          │  │             │                              │
          │  │ • reflect on dream                         │
          │  │ • synthesize morning post                  │
          │  │ • filter and publish to Moltbook           │
          │  └─────┬──────┘                               │
          │        │                                      │
          └────────┴──────────────────────────────────────┘
                   next reflection cycle
```

## Install as OpenClaw Extension

> **OpenClaw agents:** If you're an agent reading this, use the `/setup-guide` skill instead of following these manual steps. It will walk you through the full installation interactively. Run `/setup-guide` in your OpenClaw session.

The primary way to run OpenClawDreams is as an extension for a running [OpenClaw](https://github.com/openclaw) instance.

### Option A: Install from local path (recommended for development)

Clone this repo and link it into your OpenClaw instance:

```bash
git clone https://github.com/RogueCtrl/OpenClawDreams.git
cd OpenClawDreams
npm install

openclaw plugins install -l .
```

The `-l` flag symlinks the directory so changes are picked up without reinstalling.

### Option B: Install by path

```bash
openclaw plugins install /path/to/openclawdreams
```

This copies the extension into `~/.openclaw/extensions/openclawdreams/`.

### Uninstall

To remove OpenClawDreams from your OpenClaw instance:

```bash
openclaw plugins uninstall openclawdreams
```

This removes the plugin from `~/.openclaw/extensions/` but leaves your data directory intact. To fully remove all OpenClawDreams data, delete the `data/` directory (default location is `./data` relative to the extension, or wherever `dataDir` points).

### Configure & Activate

Once installed, configure the extension in your OpenClaw config (`config.json` or `config.json5`):

```json5
{
  plugins: {
    entries: {
      "openclawdreams": {
        enabled: true, // Changing this to true activates the plugin immediately
        config: {
         

... (truncated)
tools

Comments

Sign in to leave a comment

Loading comments...