- dreaming.Service: deterministic memory replay sample keyed by dream id, vocabulary-based association of unlinked memory pairs (similar_to edges + dream_association events), speculative hypotheses as hypothesis-kind beliefs with two weak memory citations (starts ~0.30, asserted <= 0.35) - Run marks the context forbidden for capabilities before anything else; test proves Invoke refuses inside a dream - per-mind settings: enabled (default off), hours window (wraps midnight), interval, model-call / memory / hypothesis caps; global pause switch - optional model wording via new `dream` prompt (role hypothesise) - promotion adds operator evidence, rejection retracts the belief; both audited and recorded as operator actions - migration 0014, API, Dreams tab and page, noemactl dreams, docs/dreaming.md
2.2 KiB
2.2 KiB
Dreaming
Dreaming is an optional idle mode (spec §19). It is off by default. When enabled, and only inside the allowed hours, a mind periodically:
- Replays a deterministic sample of recent episodic and semantic memories (the sample is a function of the dream id, so a dream can be replayed).
- Associates pairs that share vocabulary (Jaccard within a band, excluding
near-duplicates and same-episode pairs) but were never linked. Each new link
is a
similar_torelationship with low confidence and adream_associationevent citing both memories. - Proposes speculative hypotheses for the strongest pairs. Wording is
deterministic unless a budgeted model call (role
hypothesise, promptdream) offers a better one. The model never decides truth.
Guarantees
- Dreams cannot act.
Runmarks its context forbidden for the capability layer before doing anything; anyInvokereached from a dream returnsErrForbiddenContext. There is no code path from dreaming to an executor. - Low confidence by construction. Every hypothesis is a belief with
epistemic kind
hypothesis(prior 0.25) and two memory citations at weight 0.1, giving roughly 0.30. The test suite asserts ≤ 0.35. Confidence can only rise through ordinary evidence. - Nothing is rewritten. Sampled memories are untouched. Rejecting a hypothesis retracts its belief; promoting adds an operator endorsement as evidence, so the arithmetic stays inspectable on the belief page.
- Budgeted. Per-mind model-call, memory and hypothesis caps; a global pause switch; scheduled dreams need enabled + hours window + interval elapsed.
Operating
- UI: mind → Dreams. Review proposed hypotheses (promote / reject), see dreams with counts, change settings (administrator).
- API:
GET /api/v1/minds/{mind}/dreams,POST …/dreams/run,POST …/dreams/settings,POST …/dreams/hypotheses/{id}/promote|reject,POST /api/v1/dreams/pause. - CLI:
noemactl dreams <mind> list|run|promote <id> [note]|reject <id> [reason].
Settings (CognitiveConfig): dreaming_enabled, dream_hours (HH-HH local,
may wrap midnight, blank = any), dream_interval, dream_llm_calls,
dream_max_memories, dream_max_hypotheses.