AI engineering glossary · RAG vector search
What is top-k retrieval?
Top-k retrieval: Returning the k highest-scoring items for a query, where k is a chosen number such as 5 or 10. A small k risks missing the answer, while a large k fills the model's context with noise and cost.
Top-k retrieval: an example
Setting k = 5 sends the five most similar chunks to the generator.
Related terms
More RAG vector search terms
- Two-stage retrieval
- Vector database
- Vector index
- Vector normalisation
- Vector quantisation
- Abstention
- Access control in retrieval
- Agentic RAG
Where you learn it
Top-k retrieval is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.