---
url: 'https://adk.nht.io/api/@nhtio/adk/common/classes/Thought.md'
description: 'An immutable, validated internal reasoning trace produced by an agent.'
---

# Class: Thought

Defined in: [lib/classes/thought.ts:156](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L156)

An immutable, validated internal reasoning trace produced by an agent.

## Remarks

Represents an agent's internal thinking — distinct from [@nhtio/adk!Message](Message.md) (which is part of
the visible conversation) and never shown to end users directly. Carries an `identity` so
reasoning traces can be attributed to a specific agent in multi-agent conversations.
Constructed from a [RawThought](../interfaces/RawThought.md) via `rawThoughtSchema`. The `content` field is always
a [@nhtio/adk!Tokenizable](Tokenizable.md) so token cost can be estimated inline.

## Constructors

### Constructor

```ts
new Thought(raw: RawThought): Thought;
```

Defined in: [lib/classes/thought.ts:212](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L212)

#### Parameters

| Parameter | Type                                        | Description                                                 |
| --------- | ------------------------------------------- | ----------------------------------------------------------- |
| `raw`     | [`RawThought`](../interfaces/RawThought.md) | The raw thought input validated against `rawThoughtSchema`. |

#### Returns

`Thought`

#### Throws

[@nhtio/adk!E\_INVALID\_INITIAL\_THOUGHT\_VALUE](../../exceptions/variables/E_INVALID_INITIAL_THOUGHT_VALUE.md) when `raw` does not satisfy the schema.

## Properties

| Property                                                        | Modifier   | Type                                                          | Default value      | Description                                                                                                                                                                             | Defined in                                                                                                    |
| --------------------------------------------------------------- | ---------- | ------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|  `content`                         | `readonly` | [`Tokenizable`](Tokenizable.md)                               | `undefined`        | The reasoning content as a [@nhtio/adk!Tokenizable](Tokenizable.md) for inline token estimation.                                                                                        | [lib/classes/thought.ts:182](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L182) |
|  `createdAt`                     | `readonly` | `DateTime`                                                    | `undefined`        | When this thought was recorded.                                                                                                                                                         | [lib/classes/thought.ts:196](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L196) |
|  `id`                                   | `readonly` | `string`                                                      | `undefined`        | Stable unique identifier for this thought.                                                                                                                                              | [lib/classes/thought.ts:180](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L180) |
|  `identity`                       | `readonly` | [`Identity`](Identity.md)                                     | `undefined`        | The identity of the agent who produced this thought.                                                                                                                                    | [lib/classes/thought.ts:184](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L184) |
|  `payload`                         | `readonly` | `unknown`                                                     | `undefined`        | Optional vendor-opaque payload that round-trips back to a matching model wire. See [RawThought.payload](../interfaces/RawThought.md#property-payload).                                  | [lib/classes/thought.ts:189](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L189) |
|  `replayCompatibility` | `readonly` | `string` | `undefined`                                       | `undefined`        | Optional wire-shape identifier describing which adapter can safely replay this thought. See [RawThought.replayCompatibility](../interfaces/RawThought.md#property-replaycompatibility). | [lib/classes/thought.ts:194](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L194) |
|  `updatedAt`                     | `readonly` | `DateTime`                                                    | `undefined`        | When this thought was last modified.                                                                                                                                                    | [lib/classes/thought.ts:198](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L198) |
|  `schema`                           | `static`   | `ObjectSchema`<[`RawThought`](../interfaces/RawThought.md)> | `rawThoughtSchema` | Validator schema that accepts a [RawThought](../interfaces/RawThought.md) object. **Remarks** Reusable fragment for any schema that needs to validate or nest a thought entry.          | [lib/classes/thought.ts:163](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L163) |

## Methods

### isThought()

```ts
static isThought(value: unknown): value is Thought;
```

Defined in: [lib/classes/thought.ts:175](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/lib/classes/thought.ts#L175)

Returns `true` if `value` is a Thought instance.

#### Parameters

| Parameter | Type      | Description        |
| --------- | --------- | ------------------ |
| `value`   | `unknown` | The value to test. |

#### Returns

`value is Thought`

`true` when `value` is a Thought instance.

#### Remarks

Uses [@nhtio/adk!isInstanceOf](../../guards/functions/isInstanceOf.md) for cross-realm safety — `instanceof` would fail for instances
created in a different module copy or VM context.
