Skip to content

bodhi-realtime-agent / MemoryDistiller

Class: MemoryDistiller ​

Defined in: src/memory/memory-distiller.ts:49

Extracts durable user facts from conversation and persists them to a MemoryStore.

Extraction triggers:

  • onTurnEnd(): Every turnFrequency turns (default 5th turn).
  • onCheckpoint(): Immediately (e.g. on agent transfer, tool result, session close).
  • forceExtract(): Awaitable on-demand extraction.

Coalescing: Only one extraction runs at a time (extractionInFlight flag). Additional triggers while an extraction is running are silently skipped.

Merge-on-write: Each extraction produces the COMPLETE updated fact list (existing + new, deduplicated, contradictions resolved) and replaces all facts.

Constructors ​

Constructor ​

new MemoryDistiller(conversationContext, memoryStore, hooks, model, config): MemoryDistiller

Defined in: src/memory/memory-distiller.ts:58

Parameters ​

conversationContext ​

ConversationContext

memoryStore ​

MemoryStore

hooks ​

HooksManager

model ​

LanguageModelV1

config ​

MemoryDistillerConfig

Returns ​

MemoryDistiller

Methods ​

forceExtract() ​

forceExtract(): Promise<void>

Defined in: src/memory/memory-distiller.ts:83

Returns ​

Promise<void>


onCheckpoint() ​

onCheckpoint(): void

Defined in: src/memory/memory-distiller.ts:79

Returns ​

void


onTurnEnd() ​

onTurnEnd(): void

Defined in: src/memory/memory-distiller.ts:72

Returns ​

void

Built with VitePress