Key takeaways

An embedding is a list of numbers (usually 256 to 3,072 of them). A model makes it, trained to put 'similar' things close together.
Cosine similarity is how you compare two embeddings. It's the angle between two vectors. 1 means same direction, 0 means unrelated, -1 means opposite.
Embeddings power RAG, semantic search, recommendations, deduplication and clustering. Anything where the question is 'find me things like this'.
Dimensionality trades cost for quality. More dimensions capture more nuance but cost more to store and search. Most modern models default to 768-3,072.
OpenAI text-embedding-4, Voyage voyage-large-3, Cohere Embed v4 and the open-weights BGE-M3 are the practical 2026 picks. Choose by language coverage, dimensionality and price.

Type “how do I cancel my subscription” into a good help centre. It returns a page called “Closing your account”. The two share no important words, so keyword search would never connect them. An embedding does.

Embeddings sit quietly behind semantic search, RAG and most of what AI infrastructure does out of sight. This is the working version of the idea. It’s enough to read a system design and judge a vendor’s claims. It follows the same shape as my explainer on LLMs.

A list of numbers that holds meaning

An embedding is a list of numbers, usually 256 to 3,072 of them. Each is a decimal somewhere around -1 to 1. The embedding for “I love dogs” might start [0.0234, -0.1782, 0.9034, ...].

No single number means anything you could read. The meaning is spread across all of them.

The list is useful because of how the model was trained. It saw huge amounts of text, with one goal: put similar things close together. So “I love dogs” and “I adore puppies” land near each other, though they share one short word. “I love dogs” and “the stock market crashed” land far apart, though they share more.

That’s what people mean when they say embeddings capture meaning. The shape of the space follows the meaning of the text.

Meaning becomes geometry: things that mean similar things land in the same neighbourhood.

How do you compare two?

Systems almost always use cosine similarity. It’s the cosine of the angle between the two vectors. Same direction gives 1, a right angle gives 0, opposite gives -1.

Straight-line distance works too. But cosine ignores length, and for meaning only direction matters. A short sentence and a long, emphatic one saying the same thing point the same way.

import numpy as np

a = embed("I love dogs")        # → 1,536-dim numpy array
b = embed("I adore puppies")    # → 1,536-dim numpy array

similarity = np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
# typically 0.85-0.95 for sentences this similar

Most models scale their vectors to a length of 1. Then the maths shrinks to a dot product, which is very fast.

Where do they come from?

Nobody writes embeddings by hand. A model learns to make them from pairs of texts that belong together. A question and its answer. Two paraphrases. A query and the document that answers it. It’s pushed to put those pairs close and unrelated ones apart. After hundreds of millions of examples, it can place any new text by its meaning.

Embedding models are much smaller and cheaper than chat models. Placing text is an easier job than writing it. They’re also deterministic: the same input gives the same vector every time. That makes them good building blocks.

How many numbers do you need?

The main dial is dimensionality. More numbers capture more nuance and cost more to store and search.

About 256 is enough for narrow jobs, like sorting support tickets into five bins.
768 was the long-time standard for BERT-style models.
1,536 is what OpenAI’s text-embedding-3-small uses. Most RAG systems of the past two years run on it.
3,072 is the top tier at OpenAI, Voyage and Cohere.

The gains drop off fast. Going from 256 to 1,536 gets you most of the quality you’ll ever see. Doubling to 3,072 might add 2-5% on retrieval benchmarks, for twice the storage. Often that’s not worth it.

Newer models support Matryoshka representations. These let you cut a long vector down to a short one and still use it. So you can keep 3,072 numbers for analysis and search on 768.

Why does RAG depend on them?

Embeddings matter because of retrieval-augmented generation (RAG) and its cousins. The pattern has three steps.

Ingest chunk the corpus, embed each chunk, store vector + chunk in a vector DB
Query embed the question, fetch the top-K nearest chunks by cosine similarity
Generate pass the top-K chunks + question to an LLM; it answers grounded in them

You split your documents into chunks. You embed each one and store it in a vector database like Pinecone, Weaviate or pgvector. When someone asks a question, you embed it and fetch the chunks closest to it. Then you give those chunks and the question to an LLM, which answers from them.

Every support bot, internal docs assistant and “chat with your PDF” tool of the past two years works this way. The same idea does other jobs too:

Drop the LLM step and you have semantic search.
Embed a user’s history and look for nearby items, and you have recommendations.
Group close vectors and you can find duplicates.
Look for vectors far from any group and you can spot anomalies.
The LLM provides language. The embedding system provides relevance.

Which model in 2026?

Four models cover most needs as of mid-2026.

OpenAI text-embedding-4 is the easy pick if you already generate with GPT-5.5. Up to 3,072 dimensions, Matryoshka support, about $0.10 per million tokens.
Voyage voyage-large-3 leads the MTEB retrieval benchmark for English. 1,024 dimensions, about $0.12.
Cohere Embed v4 covers the most languages of the closed models, more than 100. About $0.10.
BGE-M3 from BAAI is the strongest open-weights model. It’s multilingual and free per token if you host it yourself on a single GPU.
Figures are as stated in this section: dimensions, approximate price per million tokens, language coverage, and deployment model.
Product DimensionsPriceLanguagesDeployment
OpenAI text-embedding-4 up to 3,072~$0.10/MEnglish-strongAPI
Voyage voyage-large-3 1,024~$0.12/MEnglish (top MTEB)API
Cohere Embed v4 1,024~$0.10/M100+ languagesAPI
BGE-M3 (open) multilingual$0 self-hostmultilingualself-host
OpenAI text-embedding-4
Dimensions
up to 3,072
Price
~$0.10/M
Languages
English-strong
Deployment
API
Voyage voyage-large-3
Dimensions
1,024
Price
~$0.12/M
Languages
English (top MTEB)
Deployment
API
Cohere Embed v4
Dimensions
1,024
Price
~$0.10/M
Languages
100+ languages
Deployment
API
BGE-M3 (open)
Dimensions
multilingual
Price
$0 self-host
Languages
multilingual
Deployment
self-host
Cite or embed this

For English and the best raw quality, take Voyage. Already on OpenAI? One fewer vendor is worth a lot. For many languages, take Cohere, or BGE-M3 if you host it yourself. For anything on-premises, BGE-M3 is the only real option.

Don’t agonise over it. On most production tasks, the gap between these models is smaller than the gap between good and bad chunking. Pick one that fits. Then spend your time testing retrieval on your own data.

What they can’t do

An embedding is an input to search. The vector database and its nearest-neighbour algorithm do the actual finding.

It doesn’t understand anything either. Two texts can sit close for shallow reasons, like a shared style or a passing shared topic.

It doesn’t replace an LLM. One finds, the other writes.

And no single model is best at everything. One trained on the web can be poor at medical, legal or code text. That’s why specialised models exist.

Picture every piece of text as a dot in a huge cloud, placed by what it means. An embedding model gives new text its coordinates. A vector database finds a point’s nearest neighbours. RAG asks an LLM to answer only from those neighbours. It’s a small idea, and most of modern AI infrastructure is built on it.

Frequently asked questions

What is an embedding in simple terms?

It's a list of numbers that stands for the meaning of a piece of text (or an image, or audio). Computers can do maths on it. Think of it as a point in a very high-dimensional space. Content with similar meanings ends up close together.

What's the difference between an embedding and a vector?

An embedding IS a vector. The word 'embedding' just means a vector made by a model trained to put similar inputs near each other. So all embeddings are vectors, but not all vectors are embeddings.

Why are embeddings used for search?

Keyword search only finds documents with the same words as your query. Embedding search (semantic search) compares the MEANING of your query with the meaning of each document. So it finds answers even when they share none of your words. That's how 'how do I cancel my subscription' can find a doc titled 'closing your account.'

How big are embeddings?

Modern models make vectors with 256 to 3,072 dimensions (numbers per vector). OpenAI's text-embedding-3-small uses 1,536. text-embedding-4 uses up to 3,072. Voyage's large model uses 1,024. The open-weights BGE-M3 uses 1,024. More dimensions capture more nuance but cost more to store and search.

Which embedding model should I use in 2026?

For most production work: OpenAI text-embedding-4 for the easiest fit with the OpenAI stack. Voyage voyage-large-3 for the best raw retrieval on the MTEB leaderboard. Cohere Embed v4 for strong multilingual coverage at a major-vendor price. BGE-M3 if you want open weights to self-host or run on-prem.

Do embeddings hallucinate?

Not the way LLMs do. An embedding model gives the same numbers for the same input every time. It doesn't write text, so there's nothing to invent. But embedding SEARCH can return odd results. If the model was trained on data unlike yours, it can put unrelated things close together. Test retrieval on your own data before you trust it.

Three-minute lesson on this When it makes things up Marketing course, basic. Free, no sign-up.

More from the blog

All articles →