Retrieval depth k
Control final depth, candidate stages and exact context budgets.
On this page
Use the context your application actually sends
k caps final returned units. Larger k can recover evidence while adding irrelevant context. Compare techniques at a matched final depth or an explicit matched context budget; do not credit evidence your generation step never receives.
| Option | Cap |
|---|---|
| --branch-k | Candidates per lexical/dense hybrid branch |
| --child-k | Children before parent deduplication |
| --query-k | Each original/variant search and fused pool |
| --rerank-k | Candidates scored by the cross-encoder |
| --k | Final returned source units |
| --context-budget | Complete rendered context count |
Context budgets
Whole ranked passages that do not fit are skipped and remaining ranks are renumbered. Text is not silently cut. IDs, headings and separators count. The default counter uses exact Unicode characters; --tokenizer-file selects and hashes a local Hugging Face tokenizer JSON for token counts with padding/truncation/special tokens disabled.
Those counts exclude generation instructions and provider framing. Model adapters can independently truncate ranking inputs; exact per-model truncation counts are unavailable. Small explicit candidate caps can return fewer than k passages.