/** * Pre-constructed CRUD tools for model-visible ADK memory management. * * @module @nhtio/adk/batteries/tools/memory * * @remarks * Pre-constructed CRUD tools that expose the ADK's {@link @nhtio/adk!Memory} surface to the model. * Each tool delegates to the corresponding callback on the active {@link @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 {@link @nhtio/adk!SpooledJsonArtifact}. * * Tools: * - {@link listMemoriesTool} — read-only list of every memory currently held by the context. * - {@link storeMemoryTool} — create a new memory (auto-generates `id` / `createdAt` / * `updatedAt` unless explicit values are supplied). * - {@link updateMemoryTool} — replace an existing memory by `id`. Bumps `updatedAt`. * - {@link deleteMemoryTool} — remove a memory by `id`. */ import { SpooledJsonArtifact, Tool } from "../../../common"; /** * List every memory currently held by the active execution context. * * @remarks * Delegates to `ctx.fetchMemories()`. Returns a JSON-encoded array of memory records (id, * content, confidence, importance, createdAt, updatedAt). The model can use the `id` values * to drive subsequent `update_memory` / `delete_memory` calls. */ export declare const listMemoriesTool: Tool>; /** * Create a new {@link @nhtio/adk!Memory} record and persist it via the context's `storeMemory` callback. * * @remarks * When `id` is omitted, a UUID v6 is generated. When `createdAt` / `updatedAt` are omitted, * the current time is used. The model authors `content`, `confidence`, and `importance` * directly. The resulting record is added to `ctx.turnMemories` and flushed to the consumer's * persistence layer. */ export declare const storeMemoryTool: Tool>; /** * Replace an existing {@link @nhtio/adk!Memory} by `id`. * * @remarks * The model supplies `id` plus any subset of `content` / `confidence` / `importance`; fields * left undefined retain their prior values. `updatedAt` is always bumped to the current time; * `createdAt` is preserved. Returns an error when no memory with the supplied `id` is found. */ export declare const updateMemoryTool: Tool>; /** * Remove an existing {@link @nhtio/adk!Memory} by `id`. * * @remarks * Delegates to `ctx.deleteMemory(id)`. Returns `{ ok: true, id }` on success regardless of * whether a memory was actually present — `deleteMemory` is idempotent at the ADK level. */ export declare const deleteMemoryTool: Tool>; /** * Convenience tuple of every memory CRUD tool. Spread into a {@link @nhtio/adk!ToolRegistry} to register * the entire category at once: `registry.register(...memoryTools)`. */ export declare const memoryTools: readonly [ Tool>, Tool>, Tool>, Tool> ];