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:

  1. Consolidate — Promote/reinforce/merge/discard session propositions against existing long-term memories.

  2. Abstract — Synthesize higher-level insights from groups of related propositions (grouped by entity).

  3. 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)

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

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.