Vector

Quick answer:

A vector, in AI, is just a list of numbers: [0.12, -0.87, 0.33, ..], often hundreds or thousands of numbers long. Those numbers are coordinates that place a piece of data (a sentence, an image, a product) as a point in a huge multi-dimensional space, where distance means similarity. Things with similar meaning land close together; unrelated things land far apart.

Nearly everything interesting in modern AI (search that understands meaning, recommendations, RAG) is built on measuring distances between these lists of numbers.

What is a vector, really?

You already know vectors from school: an arrow with direction and length, or a point at coordinates (x, y). A point on a map is a 2-dimensional vector. Add altitude and you have 3 dimensions.

AI just keeps adding dimensions. Instead of 2 or 3, a vector describing a sentence might have 768 or 1,536 dimensions. No human can picture that space, but the math doesn’t care: distance and angles compute the same way in 1,536 dimensions as in 2. Each dimension captures some learned aspect of the data, and no, nobody can tell you cleanly what dimension 847 “means”. The meaning lives in the geometry as a whole.

How does data become a vector?

A trained neural network reads the input and outputs the numbers. Feed the sentence “refund my order” into an embedding model and out comes a 1,536-number list. Feed in “I want my money back” and out comes a different list.. that happens to sit very close to the first one in the space, because the model learned during training that those phrases behave alike.

That output has its own name, an embedding, which is worth its own entry. The short version: every embedding is a vector, and “vector” is the generic math word while “embedding” means a vector that a model produced to represent meaning.

How do you measure similarity between vectors?

Pick a distance. The 3 you’ll meet:

  • Cosine similarity: the angle between 2 vectors, ignoring their lengths. The default for text, scored from -1 to 1, where 1 means “pointing the same way”.
  • Euclidean distance: straight-line distance between the points. The school one.
  • Dot product: a mix of angle and magnitude, popular because it’s fast and many models are trained for it.

For most practical work the choice matters less than people fear; use whatever the embedding model’s documentation recommends and move on.

Where do vectors show up in a data stack?

Anywhere “find similar things” is the job. Semantic search (query vector vs document vectors). Recommendations (this user’s taste vector vs product vectors). Deduplication (2 records suspiciously close together). Anomaly detection (a point far from every cluster). And the flagship: retrieval-augmented generation, where an LLM’s answers get grounded in documents fetched by vector similarity.

Storing and searching millions of these efficiently is a genuine engineering problem, which is why the vector database exists as a category, and why regular databases like Postgres grew vector powers of their own.

What are the strengths and limits of vector representations?

Strengths of vectors

Everything becomes comparable

Text, images, audio, and products all reduce to points in a space, so “how similar are these?” gets one answer for any pair. Cross-modal tricks like searching photos with a text query fall out of this almost for free.

Meaning survives rephrasing

“Refund my order” and “I want my money back” share no keywords and sit side by side in vector space. Keyword systems spent decades failing at exactly this.

The math is old and fast

Distances and angles are linear algebra, which hardware has been optimized for since forever. Comparing a million vectors is a solved, cheap problem.

They’re composable infrastructure

Vectors slot into ordinary systems: a column in Postgres, a field in a search index, features for a downstream model. No exotic runtime required.

Limits of vectors

Nobody can read them

1,536 numbers explain nothing to a human. When retrieval misbehaves, you debug by examples and metrics, never by inspecting the values.

They inherit their model’s blind spots

A vector captures what the embedding model learned to care about, including its gaps and biases. Domain jargon the model never saw lands in the wrong neighborhood.

Exact matching is their weak event

Part numbers, names, and codes need exactness, and similarity is the wrong tool for it. Production search almost always ends up hybrid: vectors plus old-fashioned keywords.

Precision costs dimensions, dimensions cost money

Richer representations mean longer vectors, which mean more storage and slower indexes. At scale you’ll meet quantization and dimension-trimming, both trading nuance for cost.

What’s the one mental model to keep?

A map of meaning. Every item gets dropped as a pin, the model decides where pins go, and similar things cluster into neighborhoods. Search means “find the nearest pins to this one”. Once that picture is in your head, most vector-flavored jargon (similarity, nearest neighbor, index, dimension) turns into plain geography, and vendor pitches get a lot easier to evaluate.

Avatar photo

Panoply

Panoply wrote for the Panoply blog.