← the late compiler
C_000418 · llms and generative ai · advanced

Vector Search

Finding the nearest embeddings to a query vector, using approximate algorithms to keep the search fast at scale.

Step 1 of 4

In words

What it is, why it matters, and what it is like.

Why am I learning this?

Vector search is the engine that lets a computer find the most relevant information by meaning, not just by exact words. This unlocks Retrieval-Augmented Generation (RAG) — the technique that lets a large language model answer questions using documents you give it, instead of only what it memorised. With vector search you can build: a chatbot over your company's manuals, a search box that finds a paragraph even when the query uses different words, and a recommendation system that finds similar movies based on description. It is also the foundation for agentic retrieval, where a model decides what to look up next. Master vector search, and you will understand the retrieval half of modern AI systems.

The idea, in plain terms

Vectors are lists of numbers. In vector search, every document and every query is turned into a vector by an embedding model. The vectors are placed in a space so that similar meanings are closer together. When you ask a question, its vector is placed in the same space, and the search finds the documents whose vectors are closest to it. Exact search checks every vector one-by-one, which is slow for millions of documents. Approximate search uses clever shortcuts — like grouping vectors into clusters or using a tree of regions — to look at only a fraction of the candidates, trading a little accuracy for a huge speed gain. The key mental model: the vector database is the retrieval engine, not an implementation detail.

An analogy

Imagine you have a huge library of books. You want to find a book about 'how birds fly'. Exact word search would only find books containing the phrase 'how birds fly', missing books titled 'Aerodynamics of soaring'. Vector search is like having a librarian who, instead of matching words, understands the *meaning* of books and places them on shelves so that similar ideas are near each other. You ask your question, the librarian finds the idea's location on the shelf, and picks the few books closest to it. This works great for meaning, but the librarian is lazy: instead of walking the entire library to find the closest book, they only look at a few shelves that are most likely to contain it (the approximate part). This saves time, but occasionally they miss a great book that was far away. That is the trade-off: speed versus perfection.

Definition

Vector search is the process of finding the embeddings (lists of numbers that represent meaning) in a database that are most similar to the embedding of a query, using approximate algorithms to keep the search fast even when the database has millions of entries.

Where this sits

Vector search builds on embeddings and vector databases. It is a core part of Retrieval-Augmented Generation (RAG), where documents are embedded and then retrieved at query time. It connects to Hybrid and Semantic Search, where vector similarity is combined with keyword matching for better results. It is also linked to Agentic Retrieval, where the search is repeated in a loop, and to Context Precision and Recall, which measure how good the retrieval is. You will reuse these ideas in the next topics: Reranking, GraphRAG, and Multi-Document Retrieval. Your library notes say: 'Retrieval quality is measurable separately from answer quality' — vector search is that retrieval quality. Also, your notes mention 'The vector database is the retrieval engine' — that is the mental model here.

Signal from the Frontier

Get the next essay on mind, machine, and meaning

Essays at the intersection of AI, philosophy, and Indian governance. No promotional content.

We'll send a one-click sign-in link to confirm. No password needed.

Views expressed are personal and do not represent the Government of India or the Government of Uttarakhand.