Retrieval
Once a question is embedded into the same space as every stored chunk, finding relevant context becomes a nearest-neighbor search, and k decides how many neighbors come back.
Run real dense, keyword, and hybrid retrieval on your own textProximity as relevance
Retrieval reduces to a spatial question: given a question's embedding, which stored chunk vectors sit closest to it. Chunks about the same topic land near each other in that space regardless of the exact words either one used, which is what makes this work at all.
A question about vacation days and a chunk that only ever says "PTO" can still end up close together, because the embedding model was trained to place similar meanings near each other, not similar spellings. Two clusters about unrelated topics, a PTO policy and shipping delays, sit far apart even though a keyword search would treat both as nothing more than bags of words.
k: how many candidates come back
Once the nearest vectors are identified, a parameter called k decides how many of them actually get pulled into context. Retrieval isn't winner-take-all, it returns the k closest chunks, not just the single closest one.
Set k = 1 and only the single nearest chunk comes back, precise, but a poor bet if the answer is actually spread across two or three passages.
Raise k to 3 and more candidates come back, a wider net but a noisier one: more material for the model to work with, and more chances of pulling in something only tangentially related, diluting the same context window a whole pipeline exists to protect.