Flashcard: what is a vector database, and why does RAG need one?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
A vector database is a data store built around fast approximate nearest neighbor search over high dimensional embeddings, so RAG can fetch the top-k similar chunks in milliseconds.
Imagine you have a library where every book is placed at a coordinate based on its meaning, so books about similar topics sit close together on a vast multi-dimensional shelf. Now someone walks in and asks a question. You convert their question into a coordinate too, and you need to find the books closest to that point. Walking past every shelf would take forever in a real library. So the library has a clever map that lets you jump straight to the right neighborhood without checking every aisle. A vector database is that library plus that map. It stores millions of vectors and ships with a search algorithm that finds the closest ones in milliseconds. Without it, RAG would crawl, because comparing one query against a million embeddings the slow way is a slow way.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: define the vector database as ANN index plus payload store, walk through why brute force scanning fails at scale, name HNSW and IVF, and list the 2026 vendor landscape.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming a vector database is just a regular database with a vector column. The defining feature is the ANN index (HNSW, IVF, ScaNN) that makes top-k search sub-linear; without it you have storage, not retrieval.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.