Lesson deck
Vector databases flashcards
Reviewing needs JavaScript. You can read every card in the list below.
Loading your cards...
Back to the lesson8 cards in this deck
Read all 8 cards as a list
- Front
- What is HNSW?
- Back
- Hierarchical Navigable Small World: a layered proximity graph. Search starts in a sparse top layer, hops toward the query and descends to a dense bottom layer. High recall, memory-heavy.
- Front
- Is ANN search exact? What is recall@k?
- Back
- No. Recall@k is the share of the true top-k neighbors the index returned. It is the price paid for speed and memory.
- Front
- What do ef_search, M and ef_construction do in HNSW?
- Back
- ef_search: candidates tracked per query (more recall, more latency; adjustable per query). M: links per node. ef_construction: build-time search width. M and ef_construction are fixed at build, so changing them means a rebuild.
- Front
- IVF in one line?
- Back
- Cluster vectors around centers learned in a training step. At query time scan only the nprobe nearest clusters. Lighter on memory than HNSW; recall depends on nprobe and on training data.
- Front
- How do you measure ANN recall?
- Back
- On a sample of real queries, compute exact top-k by brute force and ANN top-k, and take the overlap. Change one knob at a time and record recall and latency.
- Front
- What does product quantization (PQ) trade?
- Back
- It stores compressed approximations of vectors to save memory and speed up distance checks, at some recall loss. Re-ranking a short list with the original vectors recovers some of it.
- Front
- When is pgvector enough, and when move to a dedicated database?
- Back
- Start with what you run (often pgvector) and measure. Move when a measured limit (latency, memory, ops burden, filtering) forces it. Qdrant and Weaviate are open source and can be self-hosted.
- Front
- Fewer than k results with a metadata filter, and stale results after an edit: causes?
- Back
- Filter applied after the ANN search removes candidates (fix: iterative scan, larger candidate list, partitioning). Stale: old chunks not overwritten or deleted, so use deterministic chunk IDs.