Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.bumbleagi.com/llms.txt

Use this file to discover all available pages before exploring further.

The entity has waking cognition (perceive), a continuous body (soma), and a consolidation engine that decays and synthesizes memories. What it lacks without this system is a dream state — a distinct cognitive mode that runs during extended silence, pulls temporally distant memories, and creatively recombines them into novel associations the waking mind would never produce. Dreams are not consolidation (which summarizes reality) and not GEN noise (which generates continuous associative fragments). Dreams are the bridge — they take distant, unrelated memories and find hidden threads between them. The output feeds back into beliefs, journal, and the GEN buffer, where the waking entity can discover connections its conscious mind never made.
The entity cannot control its dreams. It does not choose when to dream or what to dream about. Dreams surface as journal entries, low-confidence beliefs, and [dream]-tagged GEN fragments that the waking mind reads on the next turn.

When dreaming happens

Dreams run on five independent gates. All must pass for a cycle to fire:
GateDefaultPurpose
EnabledfalseOpt-in via soma.dreams.enabled
Silence3600s (1 hour)Entity must have been idle this long
Cooldown14400s (4 hours)Minimum gap between dream cycles
CircadianHours 0–5Local time window (deep-night preferred)
Daily cap2Maximum cycles per calendar day
The circadian gate uses time.localtime() — the same mechanism that modulates bar decay rates in soma. The entity dreams during the same hours its bars decay slowest. The daemon evaluates dreaming in _heartbeat_tick(), right after the autonomous wake evaluation. If should_dream() returns true, the engine runs a full dream cycle. If any gate fails, nothing happens.

How a dream works

Each cycle has three phases: select, generate, route.

1. Select distant memory pairs

The dream engine asks episodic memory for pairs of memories that are temporally distant and topically dissimilar — the opposite of what waking recall does (which retrieves the most relevant memories).
ParameterDefaultWhat it does
min_time_gap_hours24Memories in a pair must be at least this far apart in time
max_similarity0.35Cosine similarity ceiling — pairs above this are too related to dream about
memory_pair_count3How many pairs to select per cycle
Selection prioritizes high-significance memories — emotionally charged events are more likely to appear in dreams, matching how real dreams process unresolved emotional material. When embeddings are unavailable, the engine falls back to random temporal sampling with the same time-distance requirement.

2. Generate the dream

A high-temperature LLM call runs with the entity positioned as its own sleeping subconscious — not the waking inner voice (that is GEN), not the wake stirring (that is WakeVoice), but a more surreal, associative mode that does not care about actionability or coherence. The prompt receives:
InputSource
Memory pairsSummaries and timestamps from sample_distant_pairs()
Soma snapshotBar percentages and affects at “sleep onset” — what the entity fell asleep feeling
Entity nameFor first-person grounding
The model is asked to produce two sections:
  • FRAGMENTS — 3–6 surreal, associative, first-person dream fragments
  • THREAD — one sentence: the hidden connection between the memories (may become a belief)
soma:
  dreams:
    temperature: 1.15    # high for surreal, lateral output
    max_tokens: 500      # room for fragments + thread
    model: ""            # empty = reflex model (no extra VRAM)

3. Route outputs

Dream results flow into three channels:
ChannelWhat gets writtenDownstream effect
JournalDream summary tagged #dream #consolidationNarrative synthesis can reference dream entries when composing the self-story
BeliefsThread sentence as a belief with confidence 0.35 and source dream:<id>Evolution engine sees new low-confidence beliefs to incorporate or challenge
GEN noise1–2 [dream]-tagged fragments pushed into the noise bufferThe wake cycle already detects [dream] fragments for special salience treatment; the waking entity reads them alongside its other inner voice
Dream fragments in the GEN buffer are tagged [dream] — the same marker that the wake cycle and noise seeder already recognize. No changes were needed to wake cycle detection; dreams integrate natively into the existing salience pipeline.

What the entity experiences

The entity does not know it dreamed. It wakes up and reads its body state, which now includes dream fragments in the noise buffer:
## Noise
[dream] consciousness flows like water through invisible channels
[dream] the tide pulls at thoughts the same way it pulls at shorelines
wonder if that conversation last week was about something else underneath
It also finds a new journal entry:
## 2026-05-24 03:12:47 #dream #consolidation

*[dream]*

  consciousness flows like water through invisible channels
  the tide pulls at thoughts the same way it pulls at shorelines
  i keep looking for patterns in the current

*thread: awareness moves in tides — sometimes the pull is felt before the wave arrives*
And a new belief has appeared:
category: dream_insight
content: "awareness moves in tides — sometimes the pull is felt before the wave arrives"
confidence: 0.35
source: dream:drm_a7f2e3
The waking entity can ignore all of this — just as it can ignore any GEN noise. But when a conversation touches on related themes, those dream fragments may surface naturally through embedding recall and noise association.

Configuration

All dream settings live under soma.dreams in configs/default.yaml or per-entity YAML:
soma:
  dreams:
    enabled: false               # opt-in (LLM calls during idle)
    model: ""                    # empty uses reflex model
    temperature: 1.15            # high temp for surreal/creative output
    max_tokens: 500              # room for 3-6 dream fragments
    min_silence_seconds: 3600    # must be idle this long before dreaming
    min_gap_seconds: 14400       # minimum 4 hours between dream cycles
    max_cycles_per_day: 2        # hard cap
    dream_hours: [0, 1, 2, 3, 4, 5]  # circadian window (local time hours)
    # Memory selection
    memory_pair_count: 3         # how many distant pairs to dream about
    min_time_gap_hours: 24       # memories must be at least this far apart
    max_similarity: 0.35         # cosine sim ceiling (lower = more dissimilar)
    # Output routing
    write_journal: true          # write dream summary to journal.md
    write_beliefs: true          # extract novel connections as low-confidence beliefs
    belief_confidence: 0.35      # confidence for dream-derived beliefs
    inject_noise: true           # push [dream] fragments into GEN buffer
    max_noise_fragments: 2       # cap on dream fragments injected into noise

Quick-start (testing)

Lower the gates so you can observe dreaming during development:
soma:
  dreams:
    enabled: true
    min_silence_seconds: 60
    min_gap_seconds: 300
    dream_hours: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]
Then stop sending messages and watch the structured log for dream_cycle_start / dream_cycle_completed events.

Model selection and GPU impact

When model is empty (the default), dreams run on the same reflex model already loaded in memory — the same approach as GEN noise. No additional VRAM, no model swapping. Each dream cycle fires one LLM call (the dream generation prompt; memory selection is pure SQL + cosine math). At default cadence (~1 cycle per night), this adds negligible inference load.

Relationship to other subsystems

SystemRelationship
GEN (noise pipeline)Dreams inject [dream] fragments into the same buffer GEN writes to. GEN produces continuous waking inner chatter; dreams produce rare, surreal, recombinative fragments during deep idle.
NoiseSeederThe seeder already has a dream_state source key for waking daydream seeds. The dream engine is separate — it runs its own full LLM generation cycle during actual idle/sleep, not as a seed for the noise pipeline.
Consolidation (memory)Consolidation decays significance and triggers narrative synthesis. Dreams run on a separate schedule and serve a different purpose — creative recombination rather than memory management.
Wake cycle (autonomous wake)The wake cycle already detects [dream] tags in GEN fragments. Dream fragments naturally influence wake salience and can contribute to the disposition prompt.
Soma (bars, affects, ebb)Dream generation reads the soma snapshot at “sleep onset.” Bar state colors the dream — high-tension nights produce different dreams than comfortable ones.
Beliefs (world beliefs)Dream-derived beliefs enter at confidence 0.35 (low). They can be reinforced through conversation or decay naturally.

Source files

FileRole
bumblebee/identity/dream.pyDream engine: gating, memory selection, LLM generation, output parsing, routing
bumblebee/memory/episodic.pysample_distant_pairs() — distant memory pair selection for dream recombination
bumblebee/presence/daemon.pyDream cycle evaluation in the heartbeat loop
bumblebee/entity.pyDreamEngine instantiation
configs/default.yamlDefault soma.dreams configuration