Skip to content
1 min read · 71 words

Type Alias: MemoryRetrievalFn

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

Defined in: lib/contracts/turn_runner_context.ts:91

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.