Skip to content
3 min read · 675 words

Interface: TurnRunnerConfig

Configuration supplied to @nhtio/adk!TurnRunner at construction time.

Remarks

Validated against turnRunnerConfigSchema at construction — a misconfigured runner throws immediately rather than failing on the first turn.

All fetch and mutation callbacks are required: they are injected into each @nhtio/adk!TurnContext so middleware can call fetch, refresh, and persistence methods directly on the context without coupling to the runner.

tools is optional at the caller level and defaults to [] after schema resolution — a runner with no baseline tools is valid.

Properties

PropertyTypeDescription
deleteMemoryCallbackMemoryDeleteFnRemoves a memory from the persistence layer by ID.
deleteMessageCallbackMessageDeleteFnRemoves a message from the persistence layer by ID.
deleteRetrievableCallbackRetrievableDeleteFnRemoves a retrievable record from the persistence layer by ID.
deleteStandingInstructionCallbackStandingInstructionDeleteFnRemoves a standing instruction from the persistence layer.
deleteThoughtCallbackThoughtDeleteFnRemoves a thought from the persistence layer by ID.
deleteToolCallCallbackToolCallDeleteFnRemoves a tool call from the persistence layer by ID.
dispatchInputPipeline?DispatchPipelineMiddlewareFn[]LLM-iteration input middleware, executed in order against the @nhtio/adk!DispatchContext before the executor on each iteration. Defaults to [].
dispatchOutputPipeline?DispatchPipelineMiddlewareFn[]LLM-iteration output middleware, executed in order against the @nhtio/adk!DispatchContext after the executor on each iteration. Defaults to [].
executorCallbackDispatchExecutorFnPerforms the LLM API/SDK call for each iteration of the dispatch loop; receives the active @nhtio/adk!DispatchContext and an @nhtio/adk!DispatchExecutorHelpers object for managing per-id stream state.
fetchMemoriesCallbackMemoryRetrievalFnCalled once per turn to supply memories; receives the active @nhtio/adk!TurnContext.
fetchMessagesCallbackMessageRetrievalFnCalled once per turn to supply conversation history; receives the active @nhtio/adk!TurnContext.
fetchRetrievablesCallbackRetrievableRetrievalFnCalled once per turn to supply retrievable (RAG) records; receives the active @nhtio/adk!TurnContext.
fetchThoughtsCallbackThoughtRetrievalFnCalled once per turn to supply thought traces; receives the active @nhtio/adk!TurnContext.
fetchToolCallsCallbackToolCallRetrievalFnCalled once per turn to supply tool call records; receives the active @nhtio/adk!TurnContext.
fetchToolsCallbackToolsRetrievalFnCalled to supply available tools; receives the active @nhtio/adk!TurnContext.
mutateMemoryCallbackMemoryMutateFnUpdates an existing memory in the persistence layer.
mutateMessageCallbackMessageMutateFnUpdates an existing message in the persistence layer.
mutateRetrievableCallbackRetrievableMutateFnUpdates an existing retrievable record in the persistence layer.
mutateStandingInstructionCallbackStandingInstructionMutateFnUpdates an existing standing instruction in the persistence layer.
mutateThoughtCallbackThoughtMutateFnUpdates an existing thought in the persistence layer.
mutateToolCallCallbackToolCallMutateFnUpdates an existing tool call in the persistence layer.
refreshStandingInstructionsCallbackStandingInstructionsRefreshFnCalled to refresh and return standing instructions; receives the active @nhtio/adk!TurnContext.
storeMemoryCallbackMemoryStoreFnPersists a new memory.
storeMessageCallbackMessageStoreFnPersists a new message.
storeRetrievableCallbackRetrievableStoreFnPersists a new retrievable record.
storeStandingInstructionCallbackStandingInstructionStoreFnPersists a new standing instruction.
storeThoughtCallbackThoughtStoreFnPersists a new thought.
storeToolCallCallbackToolCallStoreFnPersists a new tool call.
tools?Tool<SpooledArtifact>[]Baseline tools available on every turn. Middleware may trim or extend this per-turn via ctx.tools. Defaults to [].
turnInputPipeline?TurnPipelineMiddlewareFn[]Turn-level input middleware, executed in order against the @nhtio/adk!TurnContext before the LLM dispatch. Defaults to [].
turnOutputPipeline?TurnPipelineMiddlewareFn[]Turn-level output middleware, executed in order against the @nhtio/adk!TurnContext after the LLM dispatch resolves successfully. Defaults to [].