AxAgentMemoriesSearchFn Generated TypeScript API reference. typescript api api/reference build/apidocs/TypeAlias.AxAgentMemoriesSearchFn.md type AxAgentMemoriesSearchFn

AxAgentMemoriesSearchFn

TypeScript
type AxAgentMemoriesSearchFn = (searches: readonly string[], alreadyLoaded: readonly AxAgentMemoryResult[]) => 
  | readonly AxAgentMemoryResult[]
| Promise<readonly AxAgentMemoryResult[]>;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/agent/agentInternal/memoriesTypes.ts#L32

Memories search callback. Receives the raw search strings and the snapshot of inputs.memories already loaded for the current run (deduped by id, sorted). Use the second argument to skip work for entries that are already in scope — for example, filter your vector search by id NOT IN alreadyLoaded so you don’t re-fetch and the actor doesn’t pay tokens for duplicates. Returning already-loaded entries is still safe (the runtime dedupes by id) but wastes work.

Parameters

ParameterType
searchesreadonly string[]
alreadyLoadedreadonly AxAgentMemoryResult[]

Returns

| readonly AxAgentMemoryResult[] | Promise<readonly AxAgentMemoryResult[]>

Docs