AdvancedAbout 18 min

    Vector DB Internals & Serving

    Read the full article on Substack

    7 min read.

    Walk an HNSW small-world graph to a neighbor, descend its layer hierarchy, contrast IVF clustering + product quantization, and see the LLM-serving tricks: KV cache, batching, streaming.

    Think of it this way: Exact search is reading every name in the phone book; an ANN index is using the tabs and your sense of where "M" is to jump close, then look around. You might miss by one, but you finish a thousand times sooner.

    entryquery

    From the entry node, step to whichever neighbour is closest to the query; stop when none is closer.

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    What each index trades away

    Sort

    Sort each index type by what it gives up.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Exact — no recall loss

    Drop items here

    Approximate — trades recall for speed

    Drop items here
    4 pieces left to place

    Quiz

    20 questions
    Question 1 of 20
    Score: 0

    An HNSW search always begins at which node?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going