---
url: 'https://adk.nht.io/api/@nhtio/adk/turn_runner/interfaces/TurnRunnerConfig.md'
description: 'Configuration supplied to {@link @nhtio/adk!TurnRunner} at construction time.'
---

# Interface: TurnRunnerConfig

Defined in: [lib/contracts/turn\_runner\_config.ts:49](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L49)

Configuration supplied to [@nhtio/adk!TurnRunner](../classes/TurnRunner.md) 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](../../types/interfaces/TurnContext.md)
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

| Property                                                                                        | Type                                                                                                              | Description                                                                                                                                                                                                                                                                                                          | Defined in                                                                                                                              |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|  `deleteMemoryCallback`                               | [`MemoryDeleteFn`](../../types/type-aliases/MemoryDeleteFn.md)                                                    | Removes a memory from the persistence layer by ID.                                                                                                                                                                                                                                                                   | [lib/contracts/turn\_runner\_config.ts:75](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L75)   |
|  `deleteMessageCallback`                             | [`MessageDeleteFn`](../../types/type-aliases/MessageDeleteFn.md)                                                  | Removes a message from the persistence layer by ID.                                                                                                                                                                                                                                                                  | [lib/contracts/turn\_runner\_config.ts:89](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L89)   |
|  `deleteRetrievableCallback`                     | [`RetrievableDeleteFn`](../../types/type-aliases/RetrievableDeleteFn.md)                                          | Removes a retrievable record from the persistence layer by ID.                                                                                                                                                                                                                                                       | [lib/contracts/turn\_runner\_config.ts:83](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L83)   |
|  `deleteStandingInstructionCallback`     | [`StandingInstructionDeleteFn`](../../types/type-aliases/StandingInstructionDeleteFn.md)                          | Removes a standing instruction from the persistence layer.                                                                                                                                                                                                                                                           | [lib/contracts/turn\_runner\_config.ts:69](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L69)   |
|  `deleteThoughtCallback`                             | [`ThoughtDeleteFn`](../../types/type-aliases/ThoughtDeleteFn.md)                                                  | Removes a thought from the persistence layer by ID.                                                                                                                                                                                                                                                                  | [lib/contracts/turn\_runner\_config.ts:95](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L95)   |
|  `deleteToolCallCallback`                           | [`ToolCallDeleteFn`](../../types/type-aliases/ToolCallDeleteFn.md)                                                | Removes a tool call from the persistence layer by ID.                                                                                                                                                                                                                                                                | [lib/contracts/turn\_runner\_config.ts:101](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L101) |
|  `dispatchInputPipeline?`                            | [`DispatchPipelineMiddlewareFn`](../../dispatch_runner/type-aliases/DispatchPipelineMiddlewareFn.md)\[]            | LLM-iteration input middleware, executed in order against the [@nhtio/adk!DispatchContext](../../types/interfaces/DispatchContext.md) before the executor on each iteration. Defaults to `[]`.                                                                                                                       | [lib/contracts/turn\_runner\_config.ts:113](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L113) |
|  `dispatchOutputPipeline?`                          | [`DispatchPipelineMiddlewareFn`](../../dispatch_runner/type-aliases/DispatchPipelineMiddlewareFn.md)\[]            | LLM-iteration output middleware, executed in order against the [@nhtio/adk!DispatchContext](../../types/interfaces/DispatchContext.md) after the executor on each iteration. Defaults to `[]`.                                                                                                                       | [lib/contracts/turn\_runner\_config.ts:115](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L115) |
|  `executorCallback`                                       | [`DispatchExecutorFn`](../../dispatch_runner/type-aliases/DispatchExecutorFn.md)                                  | Performs the LLM API/SDK call for each iteration of the dispatch loop; receives the active [@nhtio/adk!DispatchContext](../../types/interfaces/DispatchContext.md) and an [@nhtio/adk!DispatchExecutorHelpers](../../dispatch_runner/interfaces/DispatchExecutorHelpers.md) object for managing per-id stream state. | [lib/contracts/turn\_runner\_config.ts:51](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L51)   |
|  `fetchMemoriesCallback`                             | [`MemoryRetrievalFn`](../../types/type-aliases/MemoryRetrievalFn.md)                                              | Called once per turn to supply memories; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                                        | [lib/contracts/turn\_runner\_config.ts:53](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L53)   |
|  `fetchMessagesCallback`                             | [`MessageRetrievalFn`](../../types/type-aliases/MessageRetrievalFn.md)                                            | Called once per turn to supply conversation history; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                            | [lib/contracts/turn\_runner\_config.ts:55](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L55)   |
|  `fetchRetrievablesCallback`                     | [`RetrievableRetrievalFn`](../../types/type-aliases/RetrievableRetrievalFn.md)                                    | Called once per turn to supply retrievable (RAG) records; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                       | [lib/contracts/turn\_runner\_config.ts:77](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L77)   |
|  `fetchThoughtsCallback`                             | [`ThoughtRetrievalFn`](../../types/type-aliases/ThoughtRetrievalFn.md)                                            | Called once per turn to supply thought traces; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                                  | [lib/contracts/turn\_runner\_config.ts:57](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L57)   |
|  `fetchToolCallsCallback`                           | [`ToolCallRetrievalFn`](../../types/type-aliases/ToolCallRetrievalFn.md)                                          | Called once per turn to supply tool call records; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                               | [lib/contracts/turn\_runner\_config.ts:59](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L59)   |
|  `fetchToolsCallback`                                   | [`ToolsRetrievalFn`](../../types/type-aliases/ToolsRetrievalFn.md)                                                | Called to supply available tools; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                                               | [lib/contracts/turn\_runner\_config.ts:61](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L61)   |
|  `mutateMemoryCallback`                               | [`MemoryMutateFn`](../../types/type-aliases/MemoryMutateFn.md)                                                    | Updates an existing memory in the persistence layer.                                                                                                                                                                                                                                                                 | [lib/contracts/turn\_runner\_config.ts:73](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L73)   |
|  `mutateMessageCallback`                             | [`MessageMutateFn`](../../types/type-aliases/MessageMutateFn.md)                                                  | Updates an existing message in the persistence layer.                                                                                                                                                                                                                                                                | [lib/contracts/turn\_runner\_config.ts:87](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L87)   |
|  `mutateRetrievableCallback`                     | [`RetrievableMutateFn`](../../types/type-aliases/RetrievableMutateFn.md)                                          | Updates an existing retrievable record in the persistence layer.                                                                                                                                                                                                                                                     | [lib/contracts/turn\_runner\_config.ts:81](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L81)   |
|  `mutateStandingInstructionCallback`     | [`StandingInstructionMutateFn`](../../types/type-aliases/StandingInstructionMutateFn.md)                          | Updates an existing standing instruction in the persistence layer.                                                                                                                                                                                                                                                   | [lib/contracts/turn\_runner\_config.ts:67](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L67)   |
|  `mutateThoughtCallback`                             | [`ThoughtMutateFn`](../../types/type-aliases/ThoughtMutateFn.md)                                                  | Updates an existing thought in the persistence layer.                                                                                                                                                                                                                                                                | [lib/contracts/turn\_runner\_config.ts:93](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L93)   |
|  `mutateToolCallCallback`                           | [`ToolCallMutateFn`](../../types/type-aliases/ToolCallMutateFn.md)                                                | Updates an existing tool call in the persistence layer.                                                                                                                                                                                                                                                              | [lib/contracts/turn\_runner\_config.ts:99](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L99)   |
|  `refreshStandingInstructionsCallback` | [`StandingInstructionsRefreshFn`](../../types/type-aliases/StandingInstructionsRefreshFn.md)                      | Called to refresh and return standing instructions; receives the active [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md).                                                                                                                                                                             | [lib/contracts/turn\_runner\_config.ts:63](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L63)   |
|  `storeMediaBytesCallback`                         | [`MediaBytesStoreFn`](../../types/type-aliases/MediaBytesStoreFn.md)                                              | Persists tool-generated media bytes into consumer storage; returns a `MediaReader`.                                                                                                                                                                                                                                  | [lib/contracts/turn\_runner\_config.ts:103](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L103) |
|  `storeMemoryCallback`                                 | [`MemoryStoreFn`](../../types/type-aliases/MemoryStoreFn.md)                                                      | Persists a new memory.                                                                                                                                                                                                                                                                                               | [lib/contracts/turn\_runner\_config.ts:71](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L71)   |
|  `storeMessageCallback`                               | [`MessageStoreFn`](../../types/type-aliases/MessageStoreFn.md)                                                    | Persists a new message.                                                                                                                                                                                                                                                                                              | [lib/contracts/turn\_runner\_config.ts:85](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L85)   |
|  `storeRetrievableBytesCallback`             | [`RetrievableBytesStoreFn`](../../types/type-aliases/RetrievableBytesStoreFn.md)                                  | Persists extracted retrievable text bytes into consumer storage; returns a `SpoolReader`.                                                                                                                                                                                                                            | [lib/contracts/turn\_runner\_config.ts:105](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L105) |
|  `storeRetrievableCallback`                       | [`RetrievableStoreFn`](../../types/type-aliases/RetrievableStoreFn.md)                                            | Persists a new retrievable record.                                                                                                                                                                                                                                                                                   | [lib/contracts/turn\_runner\_config.ts:79](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L79)   |
|  `storeStandingInstructionCallback`       | [`StandingInstructionStoreFn`](../../types/type-aliases/StandingInstructionStoreFn.md)                            | Persists a new standing instruction.                                                                                                                                                                                                                                                                                 | [lib/contracts/turn\_runner\_config.ts:65](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L65)   |
|  `storeThoughtCallback`                               | [`ThoughtStoreFn`](../../types/type-aliases/ThoughtStoreFn.md)                                                    | Persists a new thought.                                                                                                                                                                                                                                                                                              | [lib/contracts/turn\_runner\_config.ts:91](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L91)   |
|  `storeToolCallCallback`                             | [`ToolCallStoreFn`](../../types/type-aliases/ToolCallStoreFn.md)                                                  | Persists a new tool call.                                                                                                                                                                                                                                                                                            | [lib/contracts/turn\_runner\_config.ts:97](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L97)   |
|  `tools?`                                                            | [`Tool`](../../forge/classes/Tool.md)<[`SpooledArtifact`](../../spooled_artifact/classes/SpooledArtifact.md)>\[] | Baseline tools available on every turn. Middleware may trim or extend this per-turn via `ctx.tools`. Defaults to `[]`.                                                                                                                                                                                               | [lib/contracts/turn\_runner\_config.ts:107](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L107) |
|  `turnInputPipeline?`                                    | [`TurnPipelineMiddlewareFn`](../type-aliases/TurnPipelineMiddlewareFn.md)\[]                                       | Turn-level input middleware, executed in order against the [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md) before the LLM dispatch. Defaults to `[]`.                                                                                                                                                | [lib/contracts/turn\_runner\_config.ts:109](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L109) |
|  `turnOutputPipeline?`                                  | [`TurnPipelineMiddlewareFn`](../type-aliases/TurnPipelineMiddlewareFn.md)\[]                                       | Turn-level output middleware, executed in order against the [@nhtio/adk!TurnContext](../../types/interfaces/TurnContext.md) after the LLM dispatch resolves successfully. Defaults to `[]`.                                                                                                                          | [lib/contracts/turn\_runner\_config.ts:111](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_config.ts#L111) |
