RAG & Retrieval · Ground answers in evidence
How does vector search work?
Short answer
Vector search compares the query vector with stored vectors and returns the nearest neighbours under a chosen metric. Exact search is accurate but slow; approximate indexes trade a little recall for speed.
At query time the question is embedded into the same vector space as the chunks. The index finds vectors with the smallest distance or largest similarity. For small collections a brute-force comparison is fine; for millions of vectors an approximate nearest-neighbour index is necessary.
- Exact search: compare every vector, highest accuracy, linear cost.
- Approximate search: faster, with a tunable recall-speed trade-off.
- Filters can be applied before, during or after the vector search, with different correctness and performance implications.
- The metric must match the embedding model and index configuration.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What does an approximate index actually approximate?
- 2How do pre-filters and post-filters differ?
- 3When would brute-force search be acceptable?
Say it in the interview
Vector search embeds the query and finds stored vectors that are closest under a metric like cosine. For small sets, exact comparison is fine. At scale, an approximate index trades a little recall for much lower latency. I make sure the metric matches the embedding model, and I remember that a nearest vector is not automatically a relevant passage. Chunking and reranking still decide answer quality.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live RAG & Retrieval mock interview and get scored feedback on depth, clarity and confidence.