Skip to content
1 min read · 68 words

Type Alias: MemoryRetrievalFn

ts
type MemoryRetrievalFn = (ctx: TurnContext) => Memory[] | Promise<Memory[]>;

A function that retrieves the memories relevant to the current turn.

Parameters

ParameterType
ctxTurnContext

Returns

| Memory[] | Promise<Memory[]>

Remarks

Receives the active TurnContext so implementations can filter or rank memories based on turn-specific state (e.g. the system prompt, standing instructions, or stash). May be synchronous or asynchronous.