Default Memory Maintenance Orchestrator
Default MemoryMaintenanceOrchestrator: runs consolidation, abstraction, retirement, and optionally the mark-and-sweep collector as a four-stage pipeline.
The consolidation and abstraction logic delegates to SessionConsolidationPass and AbstractionPass respectively — they own the details of what changes. This orchestrator just drives the sequence and persists results in the legacy per-step call shape so maintain's observable contract stays intact.
A few intentional divergences from the dream-loop path worth knowing:
Every qualifying entity group is re-abstracted on every maintain call with no level ceiling. The dream-loop's skip-covered idempotency guard has nothing to match here because maintain only ever sees the level-0 ACTIVE snapshot.
The decay/retirement step hard-deletes propositions below retireBelow, unlike the dream-loop which soft-transitions them to STALE by default. This preserves the original behavior for backward compatibility.
Persistence is per-step, not transactional: the abstraction step saves each entity group as it goes, so if a later group throws, earlier groups are already written. That's safe here because maintain re-runs abstraction from the level-0 snapshot on every call, so the next call simply re-processes whatever didn't finish — partial state heals itself rather than corrupting.
Parameters
Storage backend for propositions.
Decides how session propositions are folded into long-term memory.
Optional; synthesizes higher-level insights from entity groups.
Minimum propositions per entity group before abstraction runs.
How many abstractions to generate per group.
Hard-delete propositions whose effective confidence falls below this; null disables retirement.
Decay-rate multiplier used when computing effective confidence for retirement.
Optional; refreshes the store's materialised effective-confidence column right before retirement so the pushed-down below-threshold filter reads fresh values (see retire). Null for backends that compute effective confidence live (the in-memory store), where there is no column to refresh.
Optional mark-and-sweep collector run as the final stage; null disables it.
Constructors
Functions
Run all maintenance stages for the given context.
Attach the decay manager whose sweep refreshes the materialised column before retirement runs.