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[];
}

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.