Module 9, Lecture 9.3 | Memory Systems
A memory store that only grows collects contradictions, stale references, relative dates, and duplicates, and stale memory is worse than no memory because the model trusts what it reads. This lecture covers consolidation, the process that keeps memory accurate. Most systems append memories during sessions and consolidate between them, as a separate background job, often overnight. Consolidation turns many episodes into a few current facts, maintains a layered store (a small index that is always loaded, topic files read on demand, and raw transcripts that are only searched), and works through four phases: orient, gather signal, consolidate, and prune and index. Those phase names come from reports on AutoDream, an unreleased and undocumented Claude Code feature. Because deciding which fact is current takes judgment, an LLM does the curation: the harness sends the tutoring agent's notes and new episodes to a model with a consolidation prompt, keeps a backup, and writes back the result, and the lecture walks through that prompt and its before-and-after output. The lecture closes with OpenClaw's memory cycle, which records daily notes, flushes durable facts before compaction, and runs a nightly dreaming job that promotes facts into MEMORY.md.
Read the full lecture narrative
MEMORY.md.MEMORY.md, and the silent memory flush that runs before context compaction.