← Back to Plugins
Tools

OpenClawDreams

RogueCtrl By RogueCtrl ⭐ 5 stars 👁 238 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...