Memory and Dreams

The two ways long-term memory gets written: automatic recording on every turn, and the "dream" that consolidates recent sessions.

Klaus organizes long-term memory through a "dream" mechanism — like REM sleep, it weaves threads from recent conversations into long-term memory.

  • Periodic consolidation (automatic dreaming): the second toggle on the same page. It is off by default, so turn it on first. Once it is on, Klaus runs a dream in the background (one round of memory consolidation) only when at least 5 new sessions have accumulated and 24 hours have passed since the last one. Both thresholds are editable; leave them empty to use 24 hours / 5 sessions.
  • Manual trigger: the memory page has a "Dream now" action that ignores both thresholds above — but the automatic-dreaming toggle still has to be on. The engine treats it as the master switch: when it is off, the manual click just answers "the door isn't open" and runs nothing.
  • The manual click can also be refused in three more situations: no session has actually completed a turn since this launch (it answers "there is no context to consolidate" — it will not dream over an empty session), a dream is already running, or another Klaus process holds the consolidation lock. Together with the master switch above, all four cases state the reason plainly instead of pretending a dream ran.
  • A dream that has started cannot be stopped: it runs inside the engine process, and the engine exposes no cancellation entry for "consolidating memory". So the memory page's "wake it up" button only appears when the snapshot declares itself stoppable, and the engine's dreams always declare stoppable: false — the button never shows in practice, and calling the stop interface directly only answers "could not wake it up". Just let it finish on its own (usually tens of seconds to a few minutes). If you do not want it running automatically again, go to "Settings → Dreams" and turn off automatic dreaming.
  • Past dreams: the memory page lists historical dream records, including how many sessions each dream reviewed, which memory files it changed, and a one-sentence summary.
  • Memory files: grouped into memory directory, about you, your preferences, what you are working on, and related material. They live on this machine under ~/.klaus/agent-memory, and you can use "Open in Finder" to look at them directly.
  • Automatic recording: the first toggle under "Settings → Dreams" (labeled "Automatic recording" in the UI), off by default. Once on, each turn writes whatever is worth keeping straight into memory as it ends (slightly higher usage). Leave it off and memory only updates during consolidation (dreaming).
  • "Settings → Dream" has exactly four items: the "Record automatically" and "Periodic tidy-up" switches, plus the "Minimum interval" and "Minimum session changes" thresholds. There is no "distill skills while dreaming" switch; a dream only consolidates memory.