Vector search


Updated 14 October 20261 min read

Vector search finds the items whose embeddings, numeric representations of meaning, are closest to the embedding of a query, so results match by meaning rather than by exact words.

Vector search is a way of finding information by meaning instead of by matching words. Text, and sometimes images or audio, is converted into an embedding: a list of hundreds or thousands of numbers produced by a model so that items with similar meanings end up close together. Searching means embedding the query and finding the stored vectors nearest to it.

Closeness is measured with a similarity function, most often cosine similarity, which compares the direction of two vectors, or dot product and Euclidean distance. A query like "how do I end the contract early" lands near a passage that says "either party may terminate with sixty days' notice" even though they share almost no words. Keyword search would miss that match; vector search finds it.

For large collections, comparing the query with every vector is too slow, so vector databases and search engines use approximate nearest neighbour indexes such as HNSW. These trade a tiny amount of recall for large speedups. MongoDB Atlas and dedicated vector databases both offer this.

Vector search is not always better than keyword search. Exact identifiers, product codes, error messages and names are often found more reliably by keywords, so many systems combine both in hybrid search and rerank the results. Embeddings also depend on the model that produced them: you must embed queries and documents with the same model, and switching models means re-embedding everything.

Vector search is the retrieval step in most RAG systems. In wuup, uploaded documents are split into passages and embedded; when you ask a question, the closest passages above a similarity threshold are retrieved and given to the model, which answers with numbered citations to them. Structured data is handled differently: questions about MongoDB or Google Sheets are answered by real queries, not by similarity search over rows.

Example
query:    "how do I end the contract early"
embedding: [0.021, -0.113, 0.087, ...]

nearest passages (cosine similarity):
0.83  "Either party may terminate at renewal by giving sixty (60) days' notice"
0.71  "Early termination fees are set out in Schedule C"
0.42  "This agreement is governed by the laws of India"
A worked example of Vector search.

Questions,
answered

From definitions
to answers.