Menu

1 / 3

I Increased RAG Top-K From 3 to 50. What Actually Happened?

medium.datadriveninvestor.com·Gulsaba Fiha·12 days ago
#mrk2cAYB
Reading 0:00
15s threshold

Member-only story

Python I Increased RAG Top-K From 3 to 50. What Actually Happened?

Gulsaba Fiha

10 min readNov 16, 2026

I tested six retrieval configurations using Python, Sentence Transformers, and an LLM. The results revealed an interesting relationship between retrieval recall, precision, and context size.

When I first started experimenting with Retrieval-Augmented Generation (RAG), I assumed that retrieving more documents would give an LLM more information and help it generate better answers.

It sounded reasonable.

If retrieving three documents gives an AI some context, retrieving ten or twenty should provide even more useful information.

But is that actually true?

I decided to investigate by building a small RAG pipeline and increasing the retrieval parameter, Top-K, from 3 to 50.

I wanted to understand:

Does retrieving more documents improve retrieval recall?

Does precision decrease as more documents enter the context?

Does a larger context improve answer quality?

How much additional…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.