Dream Cycle

The dream cycle is Cerebrumma's self-improvement loop. It compresses raw episodic memory into lasting knowledge — distilling what happened into facts, rules, and equity notes that live in the deeper memory layers.

Two ways to run it

Manual— generate a prompt, run it through any LLM yourself, and ingest the result. Fully offline, no API key. That's the flow documented on this page.
Automatic — configure a key and let the daemon close the loop on its own in the background, frequency-capped so it never runs away.

How the manual flow works #

  1. Generate — Cerebrumma reads your episodic memory and builds a structured reflection prompt.
  2. Reflect — You paste the prompt into any LLM (Claude, Grok, GPT-4, etc.) and save the response as a Markdown file.
  3. Ingest — Cerebrumma parses the LLM response and promotes insights into the right memory layers.

Step 1: Generate the reflection prompt #

bash
$ cerebrum dream

This archives your current episodic entries and writes a reflection prompt to stdout. The prompt is structured to elicit useful insights from any capable LLM.

Step 2: Run the reflection #

Paste the prompt output into Claude, Grok, GPT-4, or any LLM. Ask it to respond in the format below. Save the response as a Markdown file — for example, reflection.md.

Step 3: Ingest the reflection #

bash
$ cerebrum dream --ingest reflection.md

Cerebrumma parses the response and routes each section to the correct memory layer.

Expected response format #

The LLM response should use ## Section headers with - bullet items. Cerebrumma parses four sections:

markdown
## Key Insights
- Functional components outperform class components in this codebase
- TypeScript strict mode catches ~40% of bugs before runtime

## New Rules
- Always run cerebrum status before starting a new session
- Use cerebrum add --global for cross-project conventions

## Equity & Bias Notes
- Avoid "blacklist/whitelist" terminology — use "allowlist/denylist"

## Prune Suggestions
- Entry from 2026-04-01 about webpack config is outdated (migrated to Vite)
Key Insightssemantic/Distilled facts and knowledge
New Rulesprocedural/skills/Skills and protocols you follow
Equity & Bias Notespersonal/Equity rules and preferences
Prune Suggestionsstdout onlyPrinted for manual review — never auto-deleted

Safety #

Prune suggestions are never acted on automatically. Cerebrumma prints them for you to review and delete manually. Your Brain only shrinks when you decide it should.

Run it automatically #

Don't want to shuttle prompts in and out of an LLM by hand? Give Cerebrumma a key and it runs the whole cycle itself — generate, reflect, and ingest in one step:

bash
$ cerebrum dream --auto

The background daemon does the same thing on a schedule once enough fresh episodic memory has accumulated — with a built-in frequency cap so it never spams your LLM provider. See the Daemon & Auto-Reflection guide to set it up. Without a key, everything stays manual and fully offline.

When to run it #

There's no hard rule — weekly is a good cadence for active projects. Run it whenever you feel like your episodic memory has grown noisy and you want to distill the signal. If you'd rather not think about it, let the daemon handle the cadence for you.