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
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.