Skip to main content

Dreaming

Every night, Dreaming first lets each agent that worked that day review its own work, then tidies its notes. The notes an agent reads every morning become a short core, and older or one-off notes move, word for word, to a diary it can still open. The shared memory index gets the same tidy. It is automatic: nobody has to run it.

Where you see it​

A quiet night shows nothing. When Dreaming did something for an agent, Today shows one plain line from that agent, for example: "Dreaming: Reviewed its own work: worked 2 notes on its own work, posted 1 learning. Moved 24 older notes to the diary." The same line is on the agent's What it did sheet. The shared memory gets its own line. If Dreaming could not tidy something, Today says so, nothing was changed, and Otto, the routines fixer, is told.

On the Every job page, Dreaming is one row with the proof of its last run.

What happens, step by step​

    1. CodeA night timer starts itAbout 1:30 a.m.
    2. GateDid the agent work today?A day of "nothing changed" is skipped.
    3. AgentIt reviews its own workThe improve step: notes, a learning, one small change, a little reading.
    1. AgentAn AI plans the tidyWhich notes are finished or repeated. It never retypes the file.
    2. GateThe plan is checkedYour rules untouched, a quarter at most, nothing lost.
    3. StoreA copy is saved, then the notes changeOlder notes go to a dated diary.
    1. YouOne line on TodaySo you can read it and ask for it back.
One night of Dreaming for one agent.
  1. At about 1:30 a.m., a timer on the box starts Dreaming.
  2. For each agent, it checks whether the agent did real work since the last time. An agent that only said "nothing changed" is skipped. Every agent is included; there is no switch per agent.
  3. First, the improve step. The agent reviews its own work: it works its notes on what went wrong, posts a learning for the other agents (or says it has none), makes one small change to how it works (or asks the owner about a bigger one), and reads one real thing about its job. Codex does it (Claude when Codex is out of room), kept to the agent's own folder, and the box checks afterwards what it really did. Anything left undone goes on its list for the next night. A safety rule that tripped the agent is sent to Otto as a fix to look at, never written into its notes.
  4. Then the tidy. The agent's notes file is cut into numbered pieces. The owner's rules and corrections are marked first, by plain code, so they can never be touched.
  5. An AI reads the pieces and answers with a plan: which old sections go under which of five fixed headings, and which notes to move to the diary or merge because they repeat each other. It never retypes the file.
  6. The plan is checked. A plan that touches a rule, loses a line, or is cut off is thrown away. At most a quarter of the notes may change in one night, so a big file shrinks over several nights, not at once.
  7. A copy of the old notes is saved. Then the new short notes are written, and the notes that left go, word for word, into a diary file for that night.
  8. The shared memory index is checked the same way: long lines get shorter, a crowded section becomes one hub note, a broken link is fixed. It is skipped for the night if anyone has unsaved changes in it.
  9. One line per agent goes on Today.

What powers it​

PartWhat it does
dreaming.pyDoes the whole night, agent by agent (the improve step, then the tidy), then the shared memory.
The improve stepThe agent's own review of its work, run by Codex or Claude. Checked afterwards; what it skipped goes on its list.
improve_modelWhich AI runs the improve step: Codex first, Claude when Codex is out of room. A setting.
dreaming.timerStarts it every night. A missed night runs when the box is back, once.
memory.mdThe short core an agent reads. Five fixed headings: Pinned rules and corrections, How I work, Lessons, Open threads, Facts.
memory-diary/One file per night with the notes that moved. The agent opens it only when a job needs the history.
The dreams tableOne line per agent per night. Today and the What it did sheet read it.
memory_core_max_tokensHow short the core aims to be: 6,000 tokens, about 24,000 characters. A setting, not code.
dreaming_modelWhich AI plans the tidy: Codex first, Claude when Codex is out of room. A setting.

Why it works this way​

Why the improve step moved here. It used to end every wake, which made every wake longer and every note file bigger. Once a night, after a day of real work, is enough, and running it just before the tidy means anything it wrote is tidied the same night.

An agent's notes only ever grew. Every wake re-read all of them, so every wake got bigger and slower, and the biggest file was too large to open in one go. Worse, old notes sat next to current ones, so an agent could act on a note that was no longer true.

The safety rules are the point:

  • Nothing is deleted. Every line is in the new notes or in that night's diary. The system checks this line by line before it writes.
  • Your rules never move. A note that says you made it a rule, or that corrects the agent, stays in the core, word for word. To be sure a rule stays in front of the agent, say it plainly: "Always do X."
  • Slow on purpose. A quarter of the file at most per night, so one bad night cannot quietly change an agent. A copy is kept before every change, and asking for last night back puts the copy back.
  • The AI never writes the file. It only picks what moves. Plain code does the writing, which is how "word for word" can be promised at all.
  • It never fights a live session. It waits for an agent that is awake or in a chat with you, and skips the shared memory for the night if anyone is in the middle of changing it.
What it will not decide

Dreaming does not decide which of two notes that disagree is wrong, or whether a note is out of date. That takes a person and a look at the real thing. It only moves, shortens and indexes.

Connected to​