Skip to main content

Interface: IChunk

Defined in: contracts/types.ts:541

One retrievable unit of the knowledge base: a piece of a document with its heading path, embedded and searched as one.

Produced by the MdChunker, embedded by the Embedder, stored by the VectorStore, returned by the KbRetriever to the ContextAssembler; its id is what IAnswerResponse.citations lists.

Properties​

bookId​

bookId: string

Defined in: contracts/types.ts:547

The book the document belongs to; a search filter (IChunkFilters.bookIds).


docId​

docId: string

Defined in: contracts/types.ts:545

The document the chunk was cut from.


headingPath​

headingPath: string

Defined in: contracts/types.ts:551

"Refunds > Paid invoices > Time limits" — prefixed into the text at embed time.


id​

id: string

Defined in: contracts/types.ts:543

The chunk's id; IAnswerResponse.citations lists these.


language​

language: string

Defined in: contracts/types.ts:561

BCP-47.


libraryId​

libraryId: string

Defined in: contracts/types.ts:549

The library the book belongs to (a tenant has libraries, a library has books); copied from the document. The usual search filter.


order​

order: number

Defined in: contracts/types.ts:555

Position inside the document.


tags​

tags: string[]

Defined in: contracts/types.ts:559

Free tags of the document, copied to every chunk.


text​

text: string

Defined in: contracts/types.ts:553

The chunk's text: what is embedded (with headingPath in front) and what the model reads.


tokens​

tokens: number

Defined in: contracts/types.ts:557

Token count of text, for the context budget.