The cognitive cycle
Processes, attention scoring, the global workspace, executive dispatch, modes and metacognition.
The cognitive cycle is the heart of a mind. It is deterministic code: given the same state, the same new events and the same recorded model responses, it produces the same thoughts in the same order. This page describes each stage, the processes that feed it, the modes that change it, and the metacognitive checks that watch it.
On this page
One cycle, end to end
- Load state. The runtime holds the mind, its self-model, mode, cycle counter, workspace and working memory, active goals, drives, affect and the effective attention weights. State is persisted after every cycle and reloaded on start, so restarts are seamless.
- Read new events. Events after the mind's cursor are read in sequence order. An event must have been recorded for at least a short settle window before it is seen, so backdated or in-flight events are not consumed half-written. A cycle triggered by a stimulus only proceeds if at least one of the new events came from outside the brain; a mind's own output never re-triggers it.
- Observe. Every registered cognitive process looks at the state and the new events and returns thought candidates: a kind, a subject, a summary, a salience and confidence, evidence references and a feature vector. Processes run concurrently in a bounded pool with per-process timeouts and panic isolation; a slow or broken process cannot stall the cycle.
- Score. Attention scoring computes ten features for each candidate, multiplies by the effective weights, and orders candidates by score with a stable tie-break on identifier. Every candidate is recorded as a
thought_candidate event with its breakdown.
- Admit. The top candidates enter the workspace up to capacity, displacing the weakest existing thoughts. Admissions are
thought_selected events; the new workspace is a workspace_broadcast event; working memory decays and refreshes.
- Dispatch. The executive runs the handler registered for each admitted thought's kind: encode a memory, create or update a belief, create a goal, register a prediction, generate a response, request an action. Handlers share the cycle's model-call cap.
- Hooks and commit. After-cycle hooks update motivation, narrative and notifications. The whole cycle runs in one database transaction; events are published to live subscribers only after commit, so nobody ever sees a thought that was rolled back.
- Advance. The cursor moves past the events that were read, a
cycle_completed event records timing and counts, and the loop detector records the fingerprints of what was admitted.
The processes
| Process |
Produces |
Deterministic? |
| Attend |
candidates from new perception events, weighted by their salience, trust and urgency |
yes |
| Retrieve |
recalled memories relevant to what is in the workspace, with score breakdowns |
yes (semantic component needs an embedding model) |
| Associate |
low-confidence causal hypotheses when notable observations arrive close together |
yes |
| Perceive |
structured perception of messages and documents (entities, claims, questions, intent) |
deterministic analysis, optionally enriched by a model |
| Goal monitor |
progress, blockers and stalls on active goals |
yes |
| Curiosity |
questions about uncertain or contested beliefs, which can become investigation goals |
yes |
| Metacognition |
warnings about loops, contradictions, overconfidence and budget pressure |
yes |
| Act |
action requests when a thought calls for a capability |
yes; execution goes through policy |
Each process is a small Go type registered in code; there is no plugin loading and nothing a mind can do to add or change them.
Attention features
- salience from the event or memory that produced the candidate;
- urgency from time words, alert-like vocabulary and deadlines;
- novelty from how unlike recent workspace contents the candidate is;
- affect from the mind's current arousal and concern;
- goal_relevance from lexical overlap with active goals, weighted by priority;
- consequence from the candidate's kind (an action request weighs more than a recollection);
- confidence from the candidate's own confidence;
- contradiction when the candidate conflicts with a held belief;
- operator_priority when an operator injected or pinned it;
- context_relevance from overlap with the current conversation.
The weights are per mind (see configuration), modulated each cycle by drives and affect within bounds, and the effective values are stored on every selection event.
Modes
awake is the normal state. focused narrows admission to a conversation's context. idle lengthens the timer. reflecting, consolidating and dreaming are entered by the scheduler around the corresponding background job and left afterwards. paused stops cycles entirely until an operator resumes; events still accumulate and are processed on resume. All transitions are mode_changed events with a reason.
Metacognition
The metacognition process watches for the failure modes of a system that thinks in a loop: the same candidate fingerprint winning repeatedly (loop detector), a belief whose confidence moved far on little evidence, a contradiction left unresolved for too long, and model or cycle budgets running low. Each produces a metacognition event, a workspace warning and, when thresholds are crossed, a notification to the operator. Loops also suppress the repeating candidate for a while.
The causal timeline
Every event records the links it was written with: the event that directly caused it, the events it was assembled from, and the evidence it cites. The timeline page for any event walks those links backwards to causes and forwards to consequences, up to six hops and two hundred events, and draws each edge as caused, parent or cited. Events in the same cycle are grouped and the grouping is labelled correlation, because sharing a cycle is not a cause. Nothing on the page is inferred: where the system did not record why something happened, no arrow is drawn. It answers "why does this belief exist", "what changed it", "which model call contributed" and "what later depended on it" from the record alone.
Operator controls
From the interface or noemactl workspace, an operator can trigger a cycle, pause and resume, reset the workspace or the motivation state, and reload configuration. Every control is an operator_action event in the mind's own history and an entry in the audit log, and the mind encodes it as an autobiographical memory: it knows it was changed.
Causal timeline
Every event records the links it was written with: causation_id (the event that directly led to it), parent_ids (the events it was assembled from) and evidence references (the events, memories, beliefs and model calls it rests on). The causal timeline (/events/{id}/timeline, GET /api/v1/events/{id}/chain) walks those links backwards towards causes and forwards towards consequences, up to six hops and two hundred events, and draws each edge with its kind: caused, parent or cited. Events are grouped by the cognitive cycle they belong to, and that grouping is labelled as correlation, not causation. Nothing on the page is inferred; where the system does not know why something happened, no arrow is drawn. Questions the walk answers directly: why a belief exists (walk back to the observations and assertions it cites), what changed it (the belief_updated events downstream of an outcome), which memories were retrieved and which thoughts won attention in the cycle, which model call contributed (an artefact on the node), and which later decisions depended on it (walk forward).
These subsystems run beside the cognitive cycle. Each is deterministic in what it concludes; a language model may only word things, and only within a configured budget.
Metacognition (per cycle)
The metacognition process audits the mind's own reasoning with explicit checks and proposes warnings that compete for attention like any thought:
| Check |
Fires when |
Effect when admitted |
| insufficient_evidence |
a belief is at ≥ 0.7 with a single supporting item |
counter-evidence (weight ≈ 0.25) from metacognition lowers it |
| single_source |
all support for a ≥ 0.6 belief comes from one source |
counter-evidence |
| fluent_without_evidence |
a belief rests only on model output or free notes |
counter-evidence |
| repeated_failure |
three or more hypotheses about one subject rejected in a month |
warning |
| stale_contradiction |
a contested belief unresolved for a day |
an investigation goal |
| overconfidence |
calibration shows stated confidence running ahead of outcomes |
warning, notification |
| want_suppressed_repeatedly, intention_unsupported, intention_conflicts_commitment, commitment_impossible, intention_churn, repeated_execution_failure, cost_exceeds_value |
volition checks (volition.md) |
warning |
| intention_outlived_goal |
an intention is open although its goal is completed or abandoned |
the intention is abandoned |
| self_model_mismatch |
the self-model's policy for a capability differs from the effective policy |
the self-model entry is corrected |
| unsupported_explanation, action_claim_without_record |
a reply's reasons or action claims do not match records (agency.md) |
warning and a research measurement |
Each warning is a metacognition event with check and ref metadata; the same check on the same target is not repeated within a day. Warnings appear on the mind overview.
Reflection (scheduled, per mind)
reflection.Service.Run reviews the period since the last reflection: prediction errors, rejected beliefs, operator corrections, belief status changes, completed goals, contradictions and calibration. Repeated failures on one subject become a pattern, and each new pattern is written once as a procedural memory ("Lesson: ... seek an independent source before raising confidence"). The findings are stored structurally with a plain rendering; the reflect prompt may rewrite the prose when the narrate role has a model and the mind's reflection budget allows. A reflection event carries everything. Operators can run it now from the Background tab or noemactl reflect.
Consolidation (scheduled, per mind)
consolidation.Service.Run takes the last 30 days of episodes not yet consolidated, clusters them deterministically by shared stemmed terms (speaker prefixes stripped), and for each cluster of at least consolidation_min_episodes episodes creates:
- a belief (epistemic kind inference) whose confidence is computed from the episodes as evidence (weight 0.3 each, credibility from trust, single-source discount), and
- a semantic memory with the same proposition, linked to every episode by
derived_from.
The proposition is a plain deterministic sentence unless the consolidate prompt (summarise role) returns a supported generalisation within the job's model budget; the job records which. Episodes are never modified. Jobs record inputs, outputs and errors; operators can run now, pause scheduled runs globally, and reject a generalisation (memory retracted, belief pinned rejected, episodes untouched). Demo scenario 3 ("user repeatedly selects Go") produces a generalisation this way.
Narrative (after cycles)
The narrative hook builds a five-part structure from state: doing (top workspace thoughts), why (recent stimuli), recently (notable emitted events), resolving (contested beliefs, active goals), next (open predictions). It is rendered as short first-person prose and stored with a narrative_updated event when it changes. With narrative_llm enabled and a narrate model, the prompt may rephrase it; it cannot add content.
Notifications (after cycles)
notifications.Rules maps events to candidates with explicit thresholds: confident prediction misses (≥ 0.7), clear contradictions, strong beliefs (only for minds whose personality says notify proactively, above notify_min_confidence and notify_min_salience), completed goals, overconfidence or loop warnings, denied actions, and very salient observations. Repeats sharing an aggregate key within notify_cooldown increment the existing notification instead of creating another, and are recorded as notification_suppressed events. Every notification stores the rule and the values that fired it.
Modes
While reflection or consolidation runs for a mind, its runtime mode is switched to reflecting or consolidating and back, with mode_changed events, so the dashboard shows what the mind is doing.