Skip to content
2 min read · 364 words

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

ParameterTypeDescription
rawRawRetrievableThe 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

PropertyModifierTypeDefault valueDescription
contentreadonlyTokenizableundefinedThe retrieved content as a @nhtio/adk!Tokenizable for inline token estimation.
createdAtreadonlyDateTimeundefinedWhen the source record was created.
idreadonlystringundefinedStable unique identifier for this retrieved record.
kindreadonlystring | undefinedundefinedOptional semantic label.
scorereadonlynumber | undefinedundefinedOptional relevance / similarity score in [0, 1].
sourcereadonlystring | undefinedundefinedOptional provenance string.
trustTierreadonlyRetrievableTrustTierundefinedTrust tier declared by the retrieval middleware.
updatedAtreadonlyDateTimeundefinedWhen the source record was last modified.
schemastaticObjectSchema<RawRetrievable>rawRetrievableSchemaValidator 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

ParameterType
valueunknown

Returns

value is Retrievable

Remarks

Uses @nhtio/adk!isInstanceOf for cross-realm safety.