Dream Mode: Auto-Learning After Every Session
Today you had Helix work all day: it learned your code style, remembered the naming conventions you dislike, and discovered three common pitfalls in the project. Then you shut down your laptop and open a new session tomorrow — everything resets, and it's like onboarding a fresh hire again.
This isn't a model problem. The knowledge never got consolidated.
Helix's Dream Mode solves exactly this: after a session ends, automatically review the conversation, distill what's worth remembering into persistent memory, and actively use it in future sessions.
What Dream Mode Is
In one sentence: beyond "working while awake," Helix also gets a "consolidation phase while sleeping."
Like a human, Helix's Agent focuses on executing tasks during sessions (awake), then enters a consolidation phase when the session ends (dreaming): reviewing what happened, deciding which experiences are worth keeping, and writing them into memory files. When the next session starts, memory is automatically injected — you don't have to explain everything again.
How It Works: Four-Phase Consolidation
Dream Mode is a structured "memory consolidation" task with four phases:
Session history
│
▼ ① Read
Read new sessions since the last consolidation via digests, diving deeper on demand
│
▼ ② Distill
Identify valuable knowledge: user preferences, project conventions, technical decisions, pitfalls
│
▼ ③ Write
Write/update memory files (organized by topic)
│
▼ ④ Update index
Update the MEMORY.md index so memories stay discoverable by topic
① Read: Incremental Only
Dream Mode doesn't repeat work. It only reads sessions created since the last consolidation, passing compact digests (session ID, name, message count) and letting the Dream Agent dive deeper on demand — keeping costs in check without missing key information.
② Distill: What's Worth Remembering
Not every conversation deserves persistence. The Dream Agent identifies these high-value categories:
| Category | Example |
|---|---|
| User preferences | "I prefer Go-style error handling" / "Comments should be in Chinese" |
| Project conventions | "This repo's release flow updates the changelog first" / "Tests are organized by module" |
| Technical decisions & rationale | "No goroutine pool here because of memory peaks" / "TiDB chosen for strong consistency" |
| Pitfalls | "This SDK needs HTTP/2 disabled on macOS to reach the proxy" |
| Reusable methods | "Release flow: build → verify → upload → smoke test" kept as a memory entry for future reference |
③ Write: Topic-Organized Memory
Memory isn't one big grab-bag. It's a topic-organized file system: an index file (MEMORY.md) maintains the global directory, while per-topic files (user preferences, project background, common pitfalls) hold the details. Writes use a "read-then-merge" strategy — existing entries are updated and merged, never silently overwritten.
④ Update the Index: Keep Memory Discoverable
After writing memory files, the Dream Agent also maintains the MEMORY.md index — registering existing entries by topic so any piece of experience can be found quickly. Memory isn't "write and forget"; it becomes a knowledge base that grows and stays searchable.
Concurrency & Consistency: Lock Protection
Memory consolidation reads and writes shared files, so Helix protects it with a locking scheme:
- Run lock — only one Dream task runs at a time; duplicate triggers are rejected outright
- State separation — the lock file and the "last consolidated at" timestamp are stored separately to avoid concurrent read/write races; even after an abnormal exit, the next start recovers correctly
- Non-blocking — consolidation runs asynchronously in a dedicated session and never blocks your other work
How Memory Is Used: Injection & Continuity
The point of consolidation is usage. At the start of the next session, Helix injects relevant memory into the Agent's context:
- You once said "just use DeepSeek for models" → new sessions follow by default
- "Releases must run the full test suite" → the Agent runs it before delivering
- The naming style you dislike → generated code avoids it automatically
Memory is scoped per Workspace — different projects keep separate memories that never bleed into each other.
Triggering
| Method | Description |
|---|---|
| Auto trigger | Consolidates after conversations based on gating conditions (e.g. enough time since the last consolidation, enough accumulated sessions) — no intervention needed; adjustable or disableable in settings (enabled by default on the international edition) |
| Manual trigger | Run "Start Dream" with one click from settings to consolidate the current workspace immediately |
Model configuration: Dream uses its own configured model for consolidation — in the China edition you can pick a dedicated model in settings; in the international edition the backend policy chooses automatically (BYOK session model first, otherwise the default model for the Dream purpose). Choose a stronger or cheaper model specifically for this task.
Tip: trigger Dream after an important task so key decisions and preferences enter memory quickly.
Synergies with Other Capabilities
With the Skills System
Dream Mode consolidates memories about you (preferences, conventions, decisions, pitfalls); the Skills system consolidates reusable operation steps (produced by a separate skill self-learning mechanism, or created manually). They complement each other — one answers "what to remember", the other "how to do it".
With Context Management
Dream Mode and Cache/Compact solve different problems: Compact keeps a single session alive longer; Dream extends knowledge across sessions. Together they give Helix both per-task stamina and long-term memory.
Related Documentation
- Feature Overview — back to the core capabilities overview
- Context Management — keeping a single session fresh
- Skills System — how reusable skills are distilled and used