💤 Tree Dreams

While you sleep, your trees maintain themselves. The dream cycle cleans up structure, drains pending thoughts, and refreshes the AI's understanding automatically, once a day.

🕐 Setting Dream Time
Each tree can have its own dream time, a daily schedule for when background maintenance runs. Set it on your root node's settings page using 24-hour HH:MM format (e.g. 03:00 for 3 AM).
APIPOST /api/v1/root/:rootId/dream-time
{ "dreamTime": "03:00" }
Pass null or omit the field to disable dreaming for a tree. Trees with fewer than 2 children are skipped automatically. The server checks every 30 minutes. Once the clock passes your dream time and the tree hasn't dreamed today, it begins.
🧠 Short-Term Memory
When you chat with a tree or place a raw idea, not everything has an obvious home right away. Sometimes the context is ambiguous, the idea spans multiple branches, or the AI just isn't confident enough to commit it to a specific node.

Instead of forcing a bad placement, the system stores these items as short-term memories on the root node. Each one holds the original content, where it came from (chat, raw idea, etc.), and any early placement candidates the AI considered.
chat"we should also think about backup plans"
raw idea"compare pricing tiers for all three vendors"
These memories sit in a pending queue until the next dream. During the drain phase, the AI revisits each one with full tree context, groups related items together, scouts for the best placement, builds a plan, and commits them into the tree as notes or new nodes.

Items that fail placement 3 times get escalated and skipped so they don't block the rest of the queue.
Pending
Placed
Escalated
Dismissed
⚙️ The Dream Pipeline
Every dream runs three phases in order. Each phase can run multiple passes until no more work remains.
01
Cleanup
Two sub-stages run back to back, up to 5 passes each:
Reorganize consolidates small or redundant nodes. Moves children to better parents, merges duplicates, and deletes empty branches.
Expand finds sparse or thin branches and creates sub-nodes to give them more structure. Turns flat lists into meaningful hierarchies.
Passes stop early when neither sub-stage makes any changes. The tree is considered stable.
02
Short-Term Drain
Processes any pending ShortMemory items that accumulated from chat or raw ideas. Runs up to 5 passes.
Cluster
Scout
Plan
Build
Place
Items that fail 3 times are escalated and skipped. Passes stop when no pending items remain.
03
Understanding Run
The AI builds a compressed semantic map of the entire tree. It processes every node bottom up, leaves first, then parents, merging child summaries layer by layer until a single root encoding remains.
Root encoding
↑ merge
Layer 1
↑ merge
Leaves
You can run understandings from any perspective you choose, but the dream run is specifically tuned for navigation. It encodes each node's role in the bigger picture so the AI has richer semantic context when traversing the tree in future conversations.

Uses incremental mode so only nodes that changed since the last dream are reprocessed. Costs 1 energy per node understood.
🔒 Safeguards
🔐
One at a time
An in-memory lock prevents concurrent dreams on the same tree. If a dream is already running, new triggers are skipped.
📅
Once per day
Each tree records lastDreamAt. The scheduler won't re-trigger until the next calendar day.
🌱
Minimum size
Trees with fewer than 2 top-level children are skipped. No point dreaming on an empty tree.
🤖 Custom LLMs Per Stage
Each dream phase uses the tree's per-mode LLM assignments. You can assign different models to different stages, like a smart model for cleanup and a fast model for understanding:
Cleanupcleanup
Draindrain
Understandingunderstanding
If no custom LLM is assigned for a stage, it falls back to the tree's placement slot, then your account default.