Skip to content

bodhi-realtime-agent / MemoryCacheManager

Class: MemoryCacheManager ​

Defined in: src/core/memory-cache-manager.ts:11

Caches memory facts from a MemoryStore for quick in-session access.

Extracted from VoiceSession to isolate the memory caching concern. Callers use refresh() to reload from the store and facts to read the latest cached snapshot. Failures during refresh are non-fatal — the previous cache is retained.

Constructors ​

Constructor ​

new MemoryCacheManager(store, userId): MemoryCacheManager

Defined in: src/core/memory-cache-manager.ts:14

Parameters ​

store ​

MemoryStore

userId ​

string

Returns ​

MemoryCacheManager

Accessors ​

facts ​

Get Signature ​

get facts(): MemoryFact[]

Defined in: src/core/memory-cache-manager.ts:29

Return the current cached facts.

Returns ​

MemoryFact[]

Methods ​

refresh() ​

refresh(): Promise<void>

Defined in: src/core/memory-cache-manager.ts:20

Reload cached facts from the store. Best-effort: keeps stale cache on failure.

Returns ​

Promise<void>

Built with VitePress