---
url: 'https://adk.nht.io/api/@nhtio/adk/batteries/functions/filterThoughts.md'
---

# Function: filterThoughts()

```ts
function filterThoughts(
  thoughts: Iterable<Thought>,
  mode: "all-self" | "latest-self" | "all",
  selfIdentity: string,
  replayCompatibility: readonly string[],
): Thought[];
```

Defined in: [batteries/llm/chat\_common/helpers.ts:448](https://github.com/NHTIO/ADK/blob/v1.20260609.0/src/batteries/llm/chat_common/helpers.ts#L448)

Implements [ChatHelpersCommon.filterThoughts](../llm/ollama/interfaces/ChatHelpersCommon.md#property-filterthoughts).

## Parameters

| Parameter             | Type                                                       |
| --------------------- | ---------------------------------------------------------- |
| `thoughts`            | `Iterable`<[`Thought`](../../common/classes/Thought.md)> |
| `mode`                | `"all-self"` | `"latest-self"` | `"all"`                 |
| `selfIdentity`        | `string`                                                   |
| `replayCompatibility` | readonly `string`\[]                                        |

## Returns

[`Thought`](../../common/classes/Thought.md)\[]
