Skip to content

bodhi-realtime-agent / MemoryStore

Interface: MemoryStore ​

Defined in: src/types/memory.ts:19

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: src/types/memory.ts:21

Append new facts to the user's memory (creates the store entry if needed).

Parameters ​

userId ​

string

facts ​

MemoryFact[]

Returns ​

Promise<void>


getAll() ​

getAll(userId): Promise<MemoryFact[]>

Defined in: src/types/memory.ts:23

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: src/types/memory.ts:27

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: src/types/memory.ts:25

Atomically replace all facts for a user (used by consolidation).

Parameters ​

userId ​

string

facts ​

MemoryFact[]

Returns ​

Promise<void>


setDirectives() ​

setDirectives(userId, directives): Promise<void>

Defined in: src/types/memory.ts:29

Persist structured directives for a user (preserves existing facts).

Parameters ​

userId ​

string

directives ​

Record<string, string>

Returns ​

Promise<void>

Built with VitePress