Skip to content
1 min read · 261 words

@nhtio/adk/batteries/tools/memory

Pre-constructed CRUD tools for model-visible ADK memory management.

Remarks

Pre-constructed CRUD tools that expose the ADK's @nhtio/adk!Memory surface to the model. Each tool delegates to the corresponding callback on the active @nhtio/adk!DispatchContext (fetchMemories, storeMemory, mutateMemory, deleteMemory) — the persistence layer is whatever the consumer wired into the runner.

Memory entries carry agent-internal confidence / importance scores and are rendered through the LLM battery's recall-tier envelope. Letting the model author and curate its own memories is the canonical use case for these tools; deployers who do not want the model to mutate memory should simply not register the relevant tools.

Output is JSON for every tool so consumers can parse the result without re-tokenising — the artifact constructor is set to @nhtio/adk!SpooledJsonArtifact.

Tools:

  • listMemoriesTool — read-only list of every memory currently held by the context.
  • storeMemoryTool — create a new memory (auto-generates id / createdAt / updatedAt unless explicit values are supplied).
  • updateMemoryTool — replace an existing memory by id. Bumps updatedAt.
  • deleteMemoryTool — remove a memory by id.

Variables

VariableDescription
deleteMemoryToolRemove an existing @nhtio/adk!Memory by id.
listMemoriesToolList every memory currently held by the active execution context.
memoryToolsConvenience tuple of every memory CRUD tool. Spread into a @nhtio/adk!ToolRegistry to register the entire category at once: registry.register(...memoryTools).
storeMemoryToolCreate a new @nhtio/adk!Memory record and persist it via the context's storeMemory callback.
updateMemoryToolReplace an existing @nhtio/adk!Memory by id.