Consolidation
Background process that transforms raw observations into structured knowledge.
What Consolidation Does
Consolidation is the process of reviewing accumulated observations, scoring their relevance, promoting or deprecating them, and revising the perspective summaries for each memory layer. It runs as a scheduler-driven background job — not inline with agent execution.
Pipeline Stages
- Intake
- New session material is scanned. Observations are extracted and written to the appropriate memory layer. Ontology reconciliation may occur (new entities detected, property updates). Intake runs after each session completes or on a schedule.
- Review
- Observations are scored based on recency, weight, and relevance. The reviewer can promote (new → current), demote (current → deprecated), or leave observations unchanged. Each decision includes an explicit motivation — why the observation was promoted or deprecated.
- Perspective revision
- A separate pass over each layer's accumulated context. The three perspective summaries (retrospective, current, future) are rewritten to reflect the current state of the layer. This is where the agent's understanding of its own history evolves.
Scheduler Integration
Consolidation jobs are triggered by the built-in scheduler. Each layer can define its own consolidation schedule via a cron expression (consolidation_interval). The scheduler dispatches consolidation jobs tagged with tag=consolidation, which the kernel routes to the consolidation pipeline.
Watermarks track which observations have been processed. The ConsolidationStore maintains run logs and watermarks per layer, so consolidation resumes from where it left off after a restart.
Evaluation Gating
Not every observation is reviewed every cycle. Evaluation gating uses last_evaluated_at_ms combined with a decay rate to determine which observations are due for review. This prevents the reviewer from wasting cycles on recently-reviewed observations.
Design principle: Consolidation is passive — it scans existing activity rather than requiring agents to explicitly log observations. Diary interactions are picked up automatically. No tool needs special awareness of consolidation.