Memory Maintenance Orchestrator
interface MemoryMaintenanceOrchestrator
Orchestrates memory maintenance — consolidating, abstracting, retiring, and persisting — as a single entry point suitable for end-of-session or scheduled batch runs.
Three-stage pipeline:
Consolidate — Promote/reinforce/merge/discard session propositions against existing long-term memories.
Abstract — Synthesize higher-level insights from groups of related propositions (grouped by entity).
Retire expired — Delete ACTIVE propositions whose effective confidence has fallen below a threshold.
Usage:
// End-of-session: consolidate + abstract
val orchestrator = MemoryMaintenanceOrchestrator
.withRepository(propositionRepository)
.withConsolidator(DefaultMemoryConsolidator())
.withAbstractor(LlmPropositionAbstractor.withLlm(llm).withAi(ai))
.withRetireBelow(0.1)
val result = orchestrator.maintain(contextId, sessionPropositions)
// Scheduled maintenance: just abstract + retire (no session props)
val result = orchestrator.maintain(contextId)Content copied to clipboard
Inheritors
Types
Link copied to clipboard
class NeedsConsolidator
Intermediate builder step — call withConsolidator to get a usable orchestrator.
Functions
Link copied to clipboard
abstract fun maintain(contextId: <Error class: unknown class>, sessionPropositions: List<Proposition> = emptyList()): MaintenanceResult
Run all maintenance stages for the given context.