POST 1 of 5 MorningRAGConcept
k = how much context the LLM gets
Top-k = how many chunks you retrieve and stuff into the prompt. - k=1 — minimal context, brittle - k=3-5 — typical, balances context with noise - k=10+ — risk of polluting prompt with irrelevant chunks LLMs don't read perfectly through long context (look up 'lost in the middle'). More chunks isn't always better. The sweet spot depends on chunk size and document density. Start at k=4. Tune up if recall is bad, down if answers get noisy.
#RAG#LLM#VectorDatabase#AI#100DaysOfCode#RAG