Skip to main content

chunkDocument

@forge/monorepo


@forge/monorepo / backend/src / chunkDocument

Function: chunkDocument()

chunkDocument(blocks, limits?): readonly Chunk[]

Defined in: backend/src/knowledge/chunking.ts:129

Chunk a document.

Headings are not chunks of their own — a heading alone retrieves nothing useful. They become the locator and the prefix of the chunks beneath them, which is what makes an isolated sentence findable.

Parameters

blocks

readonly DocumentBlock[]

limits?

ChunkingLimits = DEFAULT_CHUNKING_LIMITS

Returns

readonly Chunk[]