Skip to content
3 min read · 545 words

Interface: RawThought

Plain input object supplied to Thought at construction time.

Remarks

Validated against rawThoughtSchema before the Thought instance is created. Temporal fields accept any value that Luxon can parse — ISO strings, Unix timestamps, Date objects, or existing DateTime instances.

Properties

PropertyTypeDefault valueDescription
contentstring | TokenizableundefinedThe reasoning content as a plain string or an existing @nhtio/adk!Tokenizable instance.
createdAtstring | number | Date | DateTime<boolean>undefinedWhen this thought was recorded.
idstringundefinedStable unique identifier for this thought.
identity?| string | Identity | RawIdentityundefinedThe identity of the agent who produced this thought. Remarks Required in multi-agent conversations to attribute reasoning traces to a specific agent. Three accepted forms when provided: - A plain string — used as both identifier and representation. - A @nhtio/adk!RawIdentity object — validated and wrapped into an @nhtio/adk!Identity. - An existing @nhtio/adk!Identity instance — passed through unchanged. When omitted, defaults to 'assistant' (both identifier and representation).
payload?unknownundefinedOptional vendor-opaque payload that round-trips back to a matching model wire. Remarks Carries anything the ADK cannot interpret but a specific provider can — for example, an Anthropic Messages thinking-block signature, an OpenAI Responses ResponseReasoningItem.encrypted_content blob, a DeepSeek server-side reasoning handle, or an MCP-mediated reasoning item. When present, an LLM battery MUST treat the thought as opaque-mode: do NOT inline content through the plain <thought> envelope; serialise payload back to the wire in whichever shape the matching RawThought.replayCompatibility identifier specifies. The plain-text content is kept alongside for token-accounting and human/observer inspection — it is not the thing the model sees. Cross-field invariant: a present payload REQUIRES a present RawThought.replayCompatibility. A payload without replayCompatibility is malformed (the ADK has no way to know which adapter can consume it) and Thought.schema rejects with @nhtio/adk!E_INVALID_INITIAL_THOUGHT_VALUE.
replayCompatibility?stringundefinedOptional free-form identifier describing which adapter wire-shape this thought can be safely replayed into. Remarks Examples (none of these are reserved by the ADK — they are consumer conventions): - 'plain-text' — replayable into every LLM battery - 'anthropic-messages-thinking-v1' - 'openai-responses-reasoning-item-v1' - 'deepseek-reasoning-handle-v1' LLM batteries declare via constructor option which tags they can safely replay; matching opaque thoughts are routed to the wire's typed reasoning channel where it exists, or to a documented side-channel key on the request body where the wire has none. Non-matching opaque thoughts are elided from the current dispatch but NOT removed from ctx.turnThoughts — they remain in context so a subsequent dispatch to a different adapter that DOES declare the matching tag can pick them up. Plain-text thoughts (payload === undefined AND replayCompatibility === undefined, or explicit replayCompatibility: 'plain-text') are always replayable. A replayCompatibility without a payload is allowed — it documents intent ("this plain-text thought is only meaningful to a specific fine-tuned variant") without requiring an opaque blob.
updatedAtstring | number | Date | DateTime<boolean>undefinedWhen this thought was last modified.