Vector Databases
A vector database stores embeddings and finds the nearest ones very fast. It does not compare your query with every item. It looks only in the right neighbourhood. In this lesson you see how much work that saves, and what it costs.
New words
- Vector database
- A database made to store vectors and find the nearest ones fast.
- Top-k
- The k closest items to your query. For example, the top 5.
- Exact search
- Compare the query with every stored vector. Always correct, but slow.
- ANN
- Approximate nearest neighbour search: very fast, but it can miss some results.
- HNSW
- A popular ANN method that uses layers of links, like highways and roads.
- Recall
- How many of the true nearest items your search found.
- Metadata filter
- A rule on extra fields, for example only items from 2025.
What you will learn
- The problem: one question, ten lakh answers
- What a vector database stores
- Exact search and why it gets slow
- Approximate search: look only nearby
- HNSW: a map with highways and local roads
- Try it: exact search against ANN
- Recall, speed and filters
- In a real system
- Interview tip
- Key takeaways
10 quiz questions at the end.
The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.