Skip to content

Chunk

Extended chunk type with positional and token metadata. KnowledgeChunk is a subset of this (id + text + meta).

optional endIndex?: number;

Character offset of the chunk end in the original text.


id: string;

Unique identifier for this chunk within its source.


optional metadata?: Record<string, unknown>;

Arbitrary metadata (heading, section name, source path, etc.).


optional startIndex?: number;

Character offset of the chunk start in the original text.


text: string;

The chunk text content.


optional tokens?: number;

Estimated token count for this chunk.