Skip to main content

Interface: IKbRetrieverConfig

Defined in: internal/kb-retriever/types.ts:11

Configuration of the KbRetriever. Lands in IAIGatewayConfig.kbRetriever.

Properties​

k?​

optional k?: number

Defined in: internal/kb-retriever/types.ts:22

The most chunks a search returns (top-k).

Each chunk costs prompt tokens on every call; more chunks is not more grounding.

Examples​

5 - a few chunks of a few hundred tokens: the default
10 - short chunks (a low `maxTokens` of the chunker) or a model with a large window

Default​

5

minScore?​

optional minScore?: number

Defined in: internal/kb-retriever/types.ts:35

The similarity below which a hit is dropped; an empty result after it is a noMatch.

Decides between a wrong chunk in the prompt and "not in the knowledge base".

Measured for text-embedding-3-small with the eval set (the right chunk scores 0.64–0.85, the best chunk of an off-topic question 0.54–0.57); another embedding model needs its own number.

Example​

0.6 - text-embedding-3-small

Default​

0.6