Interface RagRetrievedChunk

Structure describing a retrieved chunk.

interface RagRetrievedChunk {
    id: string;
    content: string;
    originalDocumentId: string;
    dataSourceId?: string;
    source?: string;
    metadata?: Record<string, MetadataValue>;
    relevanceScore?: number;
    embedding?: number[];
    tenantId?: string;
    aclGroups?: string[];
    classification?: "internal" | "public" | "confidential" | "restricted";
    status?: "active" | "archived" | "deprecated" | "draft";
    effectiveDate?: string;
    expiresAt?: string;
}

Properties

id: string
content: string
originalDocumentId: string

Original document ID for traceability.

dataSourceId?: string

Data source / collection identifier.

source?: string

Optional human-friendly source description.

metadata?: Record<string, MetadataValue>

Metadata that traveled with the chunk.

relevanceScore?: number

Similarity or relevance score returned by the vector store.

embedding?: number[]

Embedding vector if includeEmbeddings was requested.

tenantId?: string

Tenant the originating document belongs to.

aclGroups?: string[]

ACL groups allowed to retrieve this chunk.

classification?: "internal" | "public" | "confidential" | "restricted"

Sensitivity classification of the originating document.

status?: "active" | "archived" | "deprecated" | "draft"

Lifecycle status of the originating document.

effectiveDate?: string

ISO timestamp: when the originating document became authoritative.

expiresAt?: string

ISO timestamp: when the originating document stops being authoritative.