Skip to content

wireSearchMemory

function wireSearchMemory(
agent,
session,
store): Promise<AnyTool | undefined>;

Wires the search_memory tool for one turn, or withholds it entirely.

Two independent reasons withhold the tool, both “absent” rather than “present but broken” — a search tool that silently returns nothing is worse than one that is not offered at all:

  • No declared extractor is addressable in this session (no owner — see resolveWorkingMemoryOwner). Mirrors wireWorkingMemory exactly.
  • The agent declares no extractors at all. z.enum([]) is not constructible, so there is no schema to build.
Parameter Type

agent

AgentConfig

session

Session

store

ExtractedValueStore

Promise<AnyTool | undefined>