← Back to Glossary
Top-K Retrieval
Phase 03 · RAGtechnique

Configuring the exact number (K) of top-matching document chunks pulled from the index to pass to the generator or reranker.

Why it exists

Controls the balance between context depth and prompt token consumption / API cost.

How it works

Specifying K=10 fetches the top 10 vector/keyword matches. Rerankers often slice Top-10 down to Top-3 for final prompt injection.

Where you'll use this