bodhi-realtime-agent / MemoryStore
Interface: MemoryStore
Defined in: types/memory.ts:21
Persistence interface for per-user memory facts and directives. Implementations must be safe for concurrent reads and writes. See JsonMemoryStore for the built-in file-based implementation.
Methods
addFacts()
addFacts(
userId,facts):Promise<void>
Defined in: types/memory.ts:23
Append new facts to the user's memory (creates the store entry if needed).
Parameters
userId
string
facts
Returns
Promise<void>
getAll()
getAll(
userId):Promise<MemoryFact[]>
Defined in: types/memory.ts:25
Retrieve all stored facts for a user (empty array if none).
Parameters
userId
string
Returns
Promise<MemoryFact[]>
getDirectives()
getDirectives(
userId):Promise<Record<string,string>>
Defined in: types/memory.ts:29
Retrieve structured directives (e.g. behavior presets) for a user.
Parameters
userId
string
Returns
Promise<Record<string, string>>
replaceAll()
replaceAll(
userId,facts):Promise<void>
Defined in: types/memory.ts:27
Atomically replace all facts for a user (used by consolidation).
Parameters
userId
string
facts
Returns
Promise<void>
setDirectives()
setDirectives(
userId,directives):Promise<void>
Defined in: types/memory.ts:31
Persist structured directives for a user (preserves existing facts).
Parameters
userId
string
directives
Record<string, string>
Returns
Promise<void>