Why Vectors? The Quiet Revolution That Broke Keyword Search
If you’ve ever typed a perfectly reasonable query into your company’s internal search tool only to get a list of completely irrelevant documents, you’ve felt the sharp edge of the semantic gap—the yawning chasm between what you mean and what keyword search systems think you mean. For decades, this gap was just an accepted frustration of working with information retrieval systems, a quirk of technology we all learned to work around by rephrasing queries 3 or 4 times, guessing the exact keywords the system’s administrators decided to index, or just giving up and asking a colleague. But in the late 2010s, a quiet revolution in how we represent meaning as numbers changed everything: suddenly, systems could understand what we meant, not just what we typed.
To appreciate why this shift matters so much, we first have to take a hard look at the technology it replaced. Keyword search isn’t a bad technology—it’s a technology that solved the exact problem it was designed to solve, and it did so remarkably well for its time. Its story starts in the 1960s with libraries and academic search, moves through the early web’s AltaVista and Yahoo, and still powers most of the search boxes you interact with today. But its core design, built on matching literal strings of text, has fundamental limitations that become more painful every year as the amount of unstructured data we generate explodes.
The Rise and Limitations of Keyword Search: A Brief, Frustrating History
The earliest form of web search was Boolean search, named for the Boolean algebra logic it used to combine keywords with AND, OR, and NOT operators. If you wanted to find documents about “vector search” and “RAG” but not “keyword search”, you’d type `(vector search AND RAG) NOT keyword search`. The system would then return every document that contained all the terms connected by AND, minus any that contained the terms after NOT. It was precise, but only if you knew how to write Boolean queries—a skill that took training, and one most regular users never bothered to learn. A 1998 study of university library search systems found that 68% of undergraduate students could not construct a valid Boolean query to find a specific journal article, leading to either zero results or thousands of irrelevant ones.
The next major leap was TF-IDF (Term Frequency-Inverse Document Frequency), a statistical measure that assigned weights to terms based on how often they appeared in a document (term frequency) and how rare they were across the entire corpus (inverse document frequency). The core formula is: $$w_{t,d} = \text{tf}(t,d) \times \log\frac{N}{\text{df}(t)}$$ Where $w_{t,d}$ is the weight of term $t$ in document $d$, $\text{tf}(t,d)$ is the number of times $t$ appears in $d$, $N$ is the total number of documents in the corpus, and $\text{df}(t)$ is the number of documents that contain $t$. The logic was intuitive: a term that appears a lot in a specific document but rarely across all documents is a good signal of what that document is about. TF-IDF powered the first generation of commercial search engines, and it was a massive improvement over Boolean search—no more needing to learn arcane operators, just type natural language queries and the system would rank results by term weight.
But TF-IDF had a critical flaw: it treated every term as an independent, unrelated unit of meaning. There was no built-in way to know that “car” and “automobile” meant the same thing, that “buy” and “purchase” were synonyms, or that “how do I trim my cat’s nails?” and “what’s the right way to cut a cat’s claws?” were asking the same question. If a document only used one of these phrasings, TF-IDF would assign it zero weight for the other phrasing, no matter how semantically similar they were.
BM25, the current gold standard for keyword search, fixed some of TF-IDF’s edge cases—most notably by adding a saturation function to term frequency (so a term appearing 100 times in a document doesn’t get 10x the weight of a term appearing 10 times) and normalizing for document length (so a 10,000-word document doesn’t automatically outrank a 100-word document just because it has more terms). Its core formula is: $$\text{BM25}(q,d) = \sum_{t \in q} \text{IDF}(t) \times \frac{\text{tf}(t,d) \times (k_1 + 1)}{\text{tf}(t,d) + k_1 \times (1 - b + b \times \frac{|d|}{\text{avgdl}})}$$ Where $k_1$ (typically 1.2–2.0) controls term frequency saturation, $b$ (typically 0.75) controls document length normalization, $|d|$ is the length of document $d$, and $\text{avgdl}$ is the average document length across the corpus. BM25 is fast, interpretable, and works extremely well for exact keyword matching—if you’re searching for a specific product ID, a legal statute number, or a technical term that is used consistently across your corpus, it’s still the best tool for the job.
But BM25 does nothing to solve the semantic gap. To see this in action, let’s look at three real-world examples of keyword search failure that are so common they’ve become industry memes:
Case 1: The E-commerce Search Frustration
In 2022, a major Southeast Asian e-commerce platform ran an internal audit of its search performance and found that 41% of user queries returned zero results in the top 10, even though relevant products existed in the catalog. One of the top failing queries was “cheap phone case for iPhone 14 Pro Max”. The system only returned results for products whose titles contained all three terms: “cheap”, “phone case”, and “iPhone 14 Pro Max”. But many sellers listed their products as “affordable protective cover for iPhone 14 Pro Max” or “budget iPhone 14 Pro Max case”—no match for the term “cheap”. The platform tried fixing this with a manually maintained synonym dictionary that mapped “cheap” to “affordable”, “budget”, “low-cost”, and “inexpensive”, but this introduced a new problem: users searching for “cheap phone repair” started getting results for phone cases, because the synonym expansion added “affordable” and “budget” to the query, matching product listings for cases. The synonym approach was a game of whack-a-mole: every new synonym fixed one query but broke 10 others, and the list of synonyms grew to 12,000 entries for just the term “cheap” across 8 product categories, with no way to prioritize context-specific meanings.
Case 2: The Medical Search Disaster
In 2021, a US hospital system rolled out a new internal search tool for its clinical staff to find patient education materials and internal guidelines. Three months after launch, an audit found that 29% of searches for cardiac-related symptoms returned results for orthopedic conditions. A common failing query was “chest tightness and shortness of breath”. The system’s BM25 implementation matched documents that contained the exact terms “chest”, “tightness”, “shortness”, and “breath”, but many of the top results were for post-surgical breathing exercises for chest surgery patients, not the cardiac guidelines for angina and heart attack that clinicians were looking for. The term “tightness” was a key term in both cardiac and post-surgical documentation, but the system had no way to understand that in the context of “chest” and “shortness of breath”, the user was almost certainly looking for cardiac care. The hospital had to roll back the search tool and revert to a curated folder structure, adding 10 hours of manual work per week for clinical staff to find the right documents.
Case 3: The Legal Research Bottleneck
A 2023 survey of 500 US corporate lawyers found that 62% spend 3 or more hours per week searching for relevant case law and legal precedents, and 78% reported that keyword search tools regularly return irrelevant results for nuanced legal queries. One common failing query is “employee injured in car accident while stopping to buy groceries on the way home from work, is it covered by workers’ compensation?”. A keyword search will return every document that contains the terms