← ALL ARTICLES
AI Fundamentals 2026-10-19 10 min read

What Are Embeddings in AI?

Embeddings turn words, documents and images into lists of numbers that capture meaning, so software can find things that mean the same even when the wording differs. Here is how they work, what they are used for, and how to choose a model.

Embeddings are lists of numbers that represent the meaning of a piece of data, such as a sentence, a document or an image. An embedding model converts the input into a vector, and things with similar meanings end up with similar vectors. That lets software compare meaning mathematically, which powers semantic search, RAG, recommendations and clustering.

That is the short answer. Embeddings are one of the least visible parts of modern AI and one of the most useful. Every time a support bot finds the right help article even though you typed the question your own way, or a store suggests a product that is related rather than identical, there is a good chance embeddings did the matching. This guide explains what they are, how they work, what they cost in general terms, and what to think about before you put your business data into them.

What Is an Embedding in AI?

An embedding is a way to turn something a person understands, like a sentence, into something a computer can measure. OpenAI's embeddings guide defines it in one line: "An embedding is a vector (list) of floating point numbers. The distance between two vectors measures their relatedness."

Cohere's embeddings documentation describes the same idea in plainer terms: "Embeddings are a way to represent the meaning of texts, images, or information as a list of numbers." Using a simple comparison function, you can then score how similar two pieces of information are.

The key word is meaning. A keyword search treats "cancel my subscription" and "stop my monthly plan" as different strings that share almost no words. Their embeddings land close together, because they mean nearly the same thing.

What Is a Simple Way to Picture Embeddings?

Think of a giant map where every sentence gets a pin. Sentences about refunds cluster in one neighborhood, sentences about shipping delays in another, and sentences about birthday cakes somewhere far away. The embedding is the pin's address, written as a list of coordinates.

Google's Machine Learning Crash Course builds this up with food. On a single "sandwichness" scale, a hot dog and a pizza can be placed relative to a salad. Add a "dessertness" dimension and apple strudel finds its own spot. Add "liquidness" and borscht separates from the rest. In the resulting space, hot dog and shawarma sit closer together than apple strudel and borscht, and Google notes that the distance between any two items "can be interpreted as a measure of relative similarity."

The analogy has one limit worth knowing. A real map has two dimensions you can name, north and east. A real embedding has hundreds or thousands of dimensions, and individual dimensions rarely mean anything a person could label. The meaning lives in the overall pattern.

How Are Embeddings Made?

Embeddings come from an embedding model, a neural network trained for this specific job. You send it text (or, with multimodal models, images, audio or video), and it returns a fixed-length vector.

The model learns where to place things during training. Broadly, it sees enormous amounts of data and is rewarded for putting related items close together and unrelated items far apart. Google's course points to word2vec as a classic example, where words that appear in similar contexts end up near each other in the embedding space. Modern embedding models work on whole sentences and documents rather than single words, but the principle is the same.

In practice, you rarely train one yourself. You call a provider's API or run an open model, and you get vectors back. Two practical rules follow from that:

  • • Use the same model for everything you compare. Each model creates its own space, so a vector from one model means nothing next to a vector from another. Switch models and you re-embed your documents.
  • • Queries and documents can be treated differently. Voyage AI, for example, asks you to mark each input as a query or a document. Its guide, published in Anthropic's documentation, says this "can create better dense vector representations for retrieval."

What Do Embedding Dimensions Mean?

The dimension count is simply the length of the list. A 1,024-dimension embedding is 1,024 numbers. More dimensions can hold more nuance, but each vector takes more storage and comparisons take more computing.

Current defaults vary by provider, according to their own documentation fetched in October 2026:

  • • OpenAI: text-embedding-3-small returns 1,536 dimensions by default and text-embedding-3-large returns 3,072.
  • • Google: gemini-embedding-2 outputs 3,072 dimensions by default, and Google recommends 768, 1,536 or 3,072.
  • • Voyage AI: voyage-4 and voyage-4-large default to 1,024 dimensions, with 256, 512 and 2,048 also available.
  • • Cohere: embed-v5.0-pro supports 256, 512, 768, 1,024, 1,536 or 2,048.

Many current models let you choose a shorter vector. OpenAI calls this the dimensions parameter, which shortens an embedding "without losing its concept-representing properties." Google says gemini-embedding-2 can be truncated to a smaller size to save storage space. Shorter vectors trade a little accuracy for lower storage and faster search, which is often a good deal for a small business with modest data.

What Is Cosine Similarity?

Once you have two vectors, you need a way to score how close they are. The most common score is cosine similarity, which measures the angle between two vectors rather than their length. Picture two arrows starting at the same point. If they point in nearly the same direction, the score is close to 1 and the meanings are close. If they point at right angles, the score is 0 and the items are unrelated in that space.

Here is a toy example with made-up two-dimensional vectors, just to show the idea. Say "refund request" is [0.9, 0.1], "money back please" is [0.85, 0.2], and "store hours" is [0.1, 0.95]. The first two point in almost the same direction, so their cosine similarity is high. "Store hours" points somewhere else, so its score against either is low. Real embeddings do the same math across hundreds or thousands of dimensions.

OpenAI's guide recommends cosine similarity and adds that "the choice of distance function typically doesn't matter much." Because OpenAI embeddings are normalized to length 1, cosine similarity can be computed with a plain dot product, and cosine similarity and Euclidean distance produce identical rankings. Voyage AI's embeddings are normalized the same way.

What Are Embeddings Used For?

OpenAI's guide lists search, clustering, recommendations, anomaly detection, diversity measurement and classification. For a business, the most useful jobs look like this:

  • • Semantic search. Embed every help article, product page or policy once. Embed each search query the same way, then return the closest matches. People find answers even when they use different words than your documents do.
  • • Retrieval-augmented generation (RAG). RAG is how a chatbot answers from your own documents. The retrieval step usually runs on embeddings: find the passages closest in meaning to the question, then hand them to the language model to write the answer.
  • • Recommendations. Suggest articles, products or listings whose embeddings sit near the one a customer is viewing.
  • • Clustering. Group thousands of reviews, survey answers or support tickets by topic without writing rules first, then read a sample from each group.
  • • Deduplication. Find near-duplicate records, such as the same customer question asked three different ways or the same product listed twice, by flagging pairs with very high similarity scores.
  • • Classification. Label new items by comparing them to examples you have already labeled, for instance routing incoming emails to billing, sales or support.

RAG deserves a special note because it connects to accuracy. Grounding answers in retrieved text is one of the main ways builders reduce AI hallucinations. But if the embedding search pulls the wrong passages, the model answers confidently from the wrong material. Retrieval quality is answer quality.

What Is the Difference Between Embeddings and Tokens?

They are related but not the same thing.

  • • A token is a small unit of text, often a word or part of a word, that a model reads and writes. Usage is usually counted and billed in tokens, and limits are set in tokens.
  • • An embedding is a list of numbers that represents meaning. It can represent a single token, a sentence, a paragraph, a whole document or an image.

The two meet in two places. Inside a language model, each token is converted into an internal vector before the model works with it. And embedding APIs measure input in tokens: OpenAI says requests "are billed based on the number of tokens in the input," and its current embedding models accept up to 8,192 tokens per input. So tokens are how text is counted and chopped up; embeddings are how its meaning is represented.

What Is a Vector Database, and Do You Need One?

A vector database stores embeddings and quickly finds the ones nearest to a query. Comparing a query against a few hundred vectors is easy for any computer. Comparing it against millions, fast enough for a live chat, needs an index built for similarity search. OpenAI's guide puts it simply: "For searching over many vectors quickly, we recommend using a vector database."

Whether you need one depends on scale:

  • • A small set of documents, such as a few hundred help articles, can often be searched with a simple in-memory comparison or an extension to a database you already run.
  • • Large or fast-growing collections, or many users searching at once, are where a dedicated vector database or a vector index in your existing database pays off.

Most vector stores also hold the original text and metadata, such as the source page, date and access level, next to each vector. That metadata matters for filtering results and for permissions, which comes up again under privacy.

How Do You Choose an Embedding Model?

Anthropic's documentation notes that Anthropic "does not offer its own embedding model." It points to Voyage AI by MongoDB as one provider "with a wide variety of models and capabilities," while advising readers to "assess a variety of embeddings vendors to find the best fit." Its checklist is a good starting point for anyone:

  • • Domain fit. Training data that is larger or closer to your domain "generally produces better in-domain embeddings." Voyage AI, for example, offers voyage-law-2 for legal work, voyage-finance-2 for finance and voyage-code-4 for code.
  • • Speed. Lookup speed and end-to-end latency matter most for large, live deployments.
  • • Customization. Some providers let you specialize models on private data or narrow vocabularies.

Add a few questions of your own:

  • • Language. If your customers write in several languages, check multilingual support. Google says gemini-embedding-2 works across over 100 languages, and Cohere says the same of embed-v5.0-pro.
  • • Data types. If you need to search images, PDFs or video alongside text, look at multimodal models such as gemini-embedding-2 or voyage-multimodal-3.5.
  • • Size versus quality tiers. Most providers offer a larger, higher-quality model and a lighter, cheaper one. Voyage AI's own guidance is voyage-4-large for best quality, voyage-4-lite for lowest latency and cost, and voyage-4 for balance. OpenAI offers text-embedding-3-small and text-embedding-3-large.
  • • Test on your own data. Embed a sample of real documents, write twenty or thirty real customer questions, and check whether the right document comes back first. That small test tells you more than any leaderboard.

How Much Do Embeddings Cost?

Embeddings are usually one of the cheaper parts of an AI project. Providers typically charge per input token to create embeddings, and you pay once per document unless the document changes or you switch models. Queries are embedded too, so each search adds a small cost.

As one example from an official page, OpenAI's embeddings guide, fetched October 19, 2026, estimates roughly 62,500 pages of text per dollar for text-embedding-3-small and 9,615 pages per dollar for text-embedding-3-large, assuming about 800 tokens per page. Prices change, so check each provider's current pricing page before you budget.

The costs that grow quietly are storage and search. More vectors, longer vectors and more searches mean more database resources. Shorter dimensions help, and so does compression. Voyage AI's documentation says converting embeddings to 8-bit integers or 1-bit binary values reduces "storage, memory, and costs by 4x and 32x, respectively," with some loss of precision.

What Privacy Risks Come With Embeddings?

It is tempting to treat embeddings as anonymous because they look like random numbers. They are not.

Researchers John X. Morris, Volodymyr Kuleshov, Vitaly Shmatikov and Alexander M. Rush showed in Text Embeddings Reveal (Almost) As Much As Text, presented at EMNLP 2023, that their method could "recover 92% of 32-token text inputs exactly" from embeddings, and could recover full names from a dataset of clinical notes. The OWASP GenAI Security Project lists vector and embedding weaknesses among its top risks for LLM applications, including data leakage, embedding inversion and leaks between users who share a vector database.

Practical habits:

  • • Treat embeddings like the source text. If the documents are confidential, the vectors are too. Protect them with the same access controls and encryption.
  • • Know where your data goes. Creating embeddings through an API sends your text to that provider. Read its data use and retention terms. OpenAI's guide states that "customers own their input and output from our models, including in the case of embeddings."
  • • Respect permissions in search. OWASP recommends "permission-aware vector and embedding stores." If an employee cannot open a file, your AI search should not retrieve it for them.
  • • Keep sensitive fields out. Strip or mask details like Social Security numbers or medical information before embedding, unless the use case truly requires them.
  • • Consider running a model yourself. Open-weight options exist, such as voyage-4-nano, which Voyage AI publishes under an Apache 2.0 license to run on your own hardware.

The Bottom Line

Embeddings turn meaning into numbers so software can measure how similar things are. They sit underneath semantic search, RAG chatbots, recommendations and clustering, and they are usually cheap to create. The decisions that matter are practical ones: pick a model that fits your language, data types and budget; use the same model for everything you compare; test retrieval on your real questions; and protect the vectors as carefully as the documents they came from.

Sources

Frequently Asked Questions
What are embeddings in AI?
Embeddings are lists of numbers that represent the meaning of data such as a sentence, document or image. An embedding model turns the input into a vector, and items with similar meanings get similar vectors, so software can compare meaning mathematically.
What is cosine similarity in embeddings?
Cosine similarity scores how close two embeddings are by measuring the angle between them. Vectors pointing in nearly the same direction score close to 1, meaning similar meaning. OpenAI recommends it and notes the choice of distance function typically does not matter much.
What is the difference between embeddings and tokens?
A token is a small unit of text, often a word or part of a word, that models read, write and bill by. An embedding is a list of numbers representing meaning, which can cover a single token, a sentence, a whole document or an image.
Do I need a vector database to use embeddings?
Not always. A few hundred documents can be compared with a simple in-memory search or a database extension you already run. Large or fast-growing collections, or many people searching at once, are where a dedicated vector database or vector index pays off.
Does Anthropic offer an embedding model?
No. Anthropic's documentation says it does not offer its own embedding model and points to Voyage AI by MongoDB as one provider, while advising teams to assess a variety of embeddings vendors to find the best fit for their use case.
Are embeddings private or anonymous?
No. Research presented at EMNLP 2023 recovered 92% of 32-token text inputs exactly from their embeddings. Treat vectors like the source text, protect them with the same access controls, and check your provider's data terms before embedding sensitive material.
Build Your AI System

Tell us what is costing you the most time. We will map out exactly what your business needs. Free, no obligation.

Build An Agent