The dream cycle
Periodically (gated on elapsed time or accumulated sessions, whichever fires first), the brain runs a consolidation pass. On macOS it holds a sleep assertion for the duration, so closing the lid mid-cycle cannot leave memory half-consolidated. The cycle runs a fixed sequence:- Orient: snapshot recent working memory.
- Supersession sweep: retire facts that newer, contradicting facts have replaced (see Memory).
- Consolidate: housekeeping over world-knowledge bookkeeping.
- Label: turn recall feedback into training labels: a recalled fact the conversation actually used labels 1.0, one that was ignored labels 0.0.
- Train: one optimizer step on the recall reranker over those fresh labels.
- Drift: apply a small personality adjustment derived from the working-memory snapshot, so tone and priorities track how you actually work.
- Persist: write the updated reranker and identity state to disk.
The recall reranker
Every recalled fact is scored by a small linear model over 12 features of the hit: similarity, age, source, past usage. A background learner takes one training step every 10 seconds when labeled samples are available and persists weights every 50 steps, so the model is always slightly better than yesterday and never blocks a query. Its influence is deliberately capped: the reranker can move a result’s score by at most ±0.25. It reorders close calls; it cannot bury a strong direct match or promote a weak one to the top.Reflection
Reflection is the slower, heavier loop. On its own schedule the brain hands recent working-memory context to an LLM and parses the response back into insights and knowledge-graph triples. This is where cross-cutting observations come from: patterns no single perception states outright. Reflection output gets no special treatment: every derived insight passes through the same write-time filter as everything else, and derived facts enter at lower confidence than things you said directly.Learned actions
When the agent completes the same kind of request the same way twice, the winning tool call is cached as a learned action: at least three keywords from the request, the tool, and its arguments. The next time a request matches all of the pattern’s keywords, the agent replays the cached call directly, with no model round-trip at all. This is the fastest path through the agent, and it only exists for things that have already worked at least twice. The cache holds up to 200 actions; stale ones age out.Lessons
Learned actions capture what works; lessons capture what fails. When an approach fails and a different one succeeds in the same turn, the agent records an avoid/prefer pair keyed to the request’s keywords. A lesson seen three times becomes strong, and strong lessons actively gate the agent: a tool call matching a strong avoid-lesson is blocked before it runs, with the preferred alternative suggested in its place. The store caps at 200 lessons, and eviction favors keeping repeated mistakes over one-offs. Inspect or clear them viaGET /api/lessons on the daemon.
The skill model
A separate per-user model, running as a subprocess of the brain, learns to score how relevant a memory is to a query from your accumulated recall history. Each recall appends training samples; you can trigger a training run over the accumulated data through the brain’sskill_train operation and check state with skill_status. Its score is blended into recall ranking with a fixed 0.4 weight, clamped: like the reranker, it nudges, it does not decide.