Skip to main content

Interface: IMdChunkerConfig

Defined in: internal/md-chunker/types.ts:4

Configuration of the MdChunker. Lands in IAIGatewayConfig.mdChunker.

Properties​

maxTokens?​

optional maxTokens?: number

Defined in: internal/md-chunker/types.ts:18

The target size of a chunk, in estimated tokens (characters / 4).

Big enough to hold one idea, small enough that several fit the history budget next to the answer.

A section over it is cut at paragraph, line, then sentence borders; a fenced code block is never cut, so a chunk that holds one may be larger.

Examples​

600 - a few paragraphs: the default for prose documentation
300 - FAQ-style documents with short, self-contained answers

Default​

600

minTokens?​

optional minTokens?: number

Defined in: internal/md-chunker/types.ts:24

Below this a section merges with its neighbour, so a heading with two lines is not a chunk of its own.

Default​

100

overlapTokens?​

optional overlapTokens?: number

Defined in: internal/md-chunker/types.ts:31

The overlap between consecutive pieces of one cut section: the last units of a piece open the next one, so a sentence on the border is whole in one of them.

Default​

80