---
url: 'https://adk.nht.io/api/@nhtio/adk/types/type-aliases/ThoughtRetrievalFn.md'
description: A function that retrieves the thought traces relevant to the current turn.
---

# Type Alias: ThoughtRetrievalFn

```ts
type ThoughtRetrievalFn = (ctx: TurnContext) => Thought[] | Promise<Thought[]>;
```

Defined in: [lib/contracts/turn\_runner\_context.ts:124](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/contracts/turn_runner_context.ts#L124)

A function that retrieves the thought traces relevant to the current turn.

## Parameters

| Parameter | Type                                          |
| --------- | --------------------------------------------- |
| `ctx`     | [`TurnContext`](../interfaces/TurnContext.md) |

## Returns

| [`Thought`](../../common/classes/Thought.md)\[]
| `Promise`<[`Thought`](../../common/classes/Thought.md)\[]>

## Remarks

Receives the active [TurnContext](../interfaces/TurnContext.md) so implementations can apply turn-aware filtering or
attribution (e.g. filtering to a specific agent's identity in multi-agent conversations).
May be synchronous or asynchronous.
