Consolidation
A batch-oriented pipeline stage that replays episodic events to produce semantic abstractions, reinforcement updates, and decay decisions. Runs as a background worker on a configurable interval; the interval must be short enough to prevent catastrophic convergence of trusted memories.
Consolidation is the system's sleep-equivalent: the background process that transforms raw experience into durable knowledge. During the cognitive loop's active phase, experience events are recorded quickly and indexed for immediate retrieval. Consolidation runs later, reading those raw events in batch and doing the more expensive work: clustering similar experiences into semantic abstractions via the abstraction engine, computing reinforcement updates that reflect the full outcome picture rather than just immediate feedback, applying decay to memories that have not been retrieved recently, identifying and flagging contradictions between new experience and existing semantic memories, and pruning memory links that have lost relevance. The consolidation interval is a critical parameter: too long, and a surge of correlated events can accumulate high trust scores before the contradiction-detection pass runs, causing catastrophic convergence where the system confidently believes something false. At scale, full-corpus consolidation is replaced with incremental consolidation that processes only new events since the last watermark, keeping cost proportional to throughput.