Vector Search Basics
Theme
Palette
Download
Caption (tap to copy)
📖 Deep dive (full written explanation)
This is the framing slide for the whole post, and the contrast in the title does the heavy lifting: most people's mental model of search is keyword matching, where the system hunts for the literal strings you typed. Vector search replaces that with a meaning-based model, and naming the shift up front primes everything that follows.
The goal of the Concept angle is not to teach the math but to install the right intuition. If a reader walks away understanding that meaning gets turned into coordinates and similarity becomes proximity, every later slide about distance metrics and indexes has a place to attach.
Defining vector search as 'find items whose meaning is closest to your query' is deliberately metric-agnostic and modality-agnostic. The same machinery works for text, images, and audio because all of them can be pushed through an encoder that emits a fixed-length vector. The query is embedded by the same kind of model, so comparing query to documents is an apples-to-apples geometric operation.
The phrase 'which stored vectors sit nearest' is the entire job description of a vector database. Everything else — indexing, filtering, sharding — is engineering in service of answering that nearest-neighbor question quickly and at scale.
An embedding is the single most important concept in this post, so it gets its own slide stated as plainly as possible: a point in high-dimensional space where similar meanings cluster. The dimensionality (384 for small models, up to a few thousand for large ones) is worth mentioning because it foreshadows why brute-force comparison gets expensive later.
The 'dog near puppy, far from invoice' example is chosen because it has zero lexical overlap, which makes the point that the closeness comes from learned meaning, not shared letters. This is exactly what keyword search cannot do, and it sets up the comparison slide that follows.
Putting keyword and vector search side by side clarifies that they are not rivals so much as different tools. Keyword (lexical) search is fast, exact, and excellent when the user knows the precise term — think product SKUs or error codes. Its weakness is vocabulary mismatch: a query for 'car' will never surface a document that only says 'automobile.'
Vector search inverts those properties. It gracefully handles synonyms, paraphrase, and fuzzy intent, but it can miss an exact token match that a human would consider obvious. Knowing both profiles is what later motivates hybrid search in the mistakes post.
This diagram makes the abstract claim literal by plotting three labels in 2D. 'Dog' and 'puppy' sit close together in green; 'invoice' is pushed away in red. Real embeddings live in hundreds of dimensions, but the human-readable intuition survives the projection down to a plane: related concepts cluster, unrelated ones spread apart.
The reason this picture matters is that it converts a vague phrase — 'captures meaning' — into something you can reason about geometrically. Once meaning is a position, 'most relevant result' simply means 'nearest point,' and that is a problem computers are extremely good at solving.
This slide answers the obvious skeptic's question: why bother turning language into numbers at all? The honest answer is pragmatic. Computers have no native notion of meaning, but they execute billions of arithmetic operations per second. Encoding meaning as coordinates lets us borrow all of that raw speed.
The second benefit is scale. A distance computation is cheap and embarrassingly parallel, so the same approach that ranks three documents also ranks a hundred million. That scalability is precisely why vector search underpins web-scale semantic search and recommendation systems, not just toy demos.
Here we make the vector database concrete by listing what actually lives in a record. The vector is the searchable part, but it is useless on its own — you also store the original chunk of text (or a pointer to it) so you can return something human-readable, plus metadata like source, date, and tags that enable filtering.
The fourth item, the index, is what separates a vector database from a plain array of floats. The index is a specialized data structure that makes nearest-neighbor lookups fast. Introducing it here plants the seed for the How-It-Works post, which dives into ANN indexes like HNSW.
This code slide grounds the abstraction in something the reader can run. Encoding a short string with a sentence-transformer returns a 384-element vector of floats. Printing the length and the first few values demystifies the word 'embedding' — it is genuinely just a list of numbers, nothing more exotic.
The choice of all-MiniLM-L6-v2 is intentional: it is small, fast, free, and runs on a laptop, so a curious reader can reproduce this in seconds. Seeing the concrete output tends to dissolve the mystique and makes the later geometry slides feel obvious rather than magical.
This pipeline diagram is the payoff of the Concept post: it locates vector search inside a real system. The user's query is embedded, the search step returns the nearest stored vectors, those map back to text chunks, and the chunks become context the LLM reads to produce a grounded answer.
Showing the full flow matters because vector search is rarely the end product — it is the retrieval stage of a larger RAG pipeline. By seeing where it plugs in, the reader understands that getting retrieval right is what makes the final LLM answer trustworthy, which is exactly the theme of the next post.
These four mental-model reminders are the things readers most often get wrong once they start building. The first — that the same model must embed both query and documents — is so important it reappears as the number-one mistake in post five. The shared space is what makes comparison meaningful.
The remaining points temper expectations: closeness is a proxy for relevance, results are approximate rather than exact, and the system ranks without understanding. Holding these honestly prevents the common trap of treating a top-ranked result as a verified answer rather than a candidate to be checked.
The takeaway slide compresses the entire post into one sentence so the reader leaves with a portable summary: encode everything into the same meaning-space, then return the nearest neighbors. If they remember nothing else, this is the line that survives.
Naming it as the retrieval engine behind semantic search and RAG connects the abstract concept to the concrete systems they have already used, which makes the idea feel relevant rather than academic and sets up the 'why it matters' deep dive.
The closing card points forward to Day 72 and teases the Why-It-Matters thread. Ending on the promise that semantic retrieval changes what an AI can answer gives the reader a concrete reason to come back rather than a generic follow prompt.
The save-and-follow ask is intentional: this content is reference material, and saves signal to the reader's future self that the mental model here is worth returning to when they actually start building.