Class: Retrievable
An immutable, validated retrieved record (RAG content) held by the agent.
Remarks
Peer of @nhtio/adk!Memory / Message / Thought / ToolCall. Carries an explicit trustTier that LLM batteries branch on to choose the rendering envelope. The retrieval middleware that produced the record is the only party that knows its provenance — batteries MUST NOT auto-classify or infer the tier from source.
Constructors
Constructor
ts
new Retrievable(raw: RawRetrievable): Retrievable;Parameters
| Parameter | Type | Description |
|---|---|---|
raw | RawRetrievable | The raw retrievable input validated against rawRetrievableSchema. |
Returns
Retrievable
Throws
@nhtio/adk/exceptions!E_INVALID_INITIAL_RETRIEVABLE_VALUE when raw does not satisfy the schema.
Properties
| Property | Modifier | Type | Default value | Description |
|---|---|---|---|---|
content | readonly | Tokenizable | undefined | The retrieved content as a @nhtio/adk!Tokenizable for inline token estimation. |
createdAt | readonly | DateTime | undefined | When the source record was created. |
id | readonly | string | undefined | Stable unique identifier for this retrieved record. |
kind | readonly | string | undefined | undefined | Optional semantic label. |
score | readonly | number | undefined | undefined | Optional relevance / similarity score in [0, 1]. |
source | readonly | string | undefined | undefined | Optional provenance string. |
trustTier | readonly | RetrievableTrustTier | undefined | Trust tier declared by the retrieval middleware. |
updatedAt | readonly | DateTime | undefined | When the source record was last modified. |
schema | static | ObjectSchema<RawRetrievable> | rawRetrievableSchema | Validator schema that accepts a RawRetrievable object. Remarks Reusable fragment for any schema that needs to validate or nest a retrievable record. |
Methods
isRetrievable()
ts
static isRetrievable(value: unknown): value is Retrievable;Returns true if value is a Retrievable instance.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is Retrievable
Remarks
Uses @nhtio/adk!isInstanceOf for cross-realm safety.