In beta, with limited placesOpen to everyone in Q1 2027

↑↓ to move · Enter to open · Esc to close

AI search

What are embeddings in artificial intelligence?

Embeddings are numerical representations of a text, an image or other content: lists of numbers, called vectors, that a model calculates so that similar contents end up close to each other. The distance between two embeddings measures how alike two pieces of content are, not whether what they say is true. They are the basis of semantic search.

Written by
Reviewed by
Published 7 min read
Takeaway:

Key takeaways

  • An embedding turns a piece of content into a vector, a list of numbers; similar contents end up close together.
  • Similarity is measured by the distance between vectors, usually with cosine similarity, which runs from -1 to 1.
  • A real embedding has hundreds or thousands of dimensions, and they can almost never be interpreted one by one.
  • An embedding measures similarity between texts, not truth: a false description and a true one with the same words end up equally close to the question.
  • Embeddings are the piece that makes searching by meaning possible: semantic search and retrieval-augmented generation (RAG) rely on them.

A shopper types "kettle that doesn't taste like plastic" and the system returns your kettle with a stainless steel interior, even though your product page contains neither "taste" nor "plastic". That is what embeddings make possible: finding content by what it means and not by the words it shares. It is a technical piece you will not configure in your store, but it is worth understanding what it measures, because it is increasingly used to decide which product page fits which question, and because it measures less than it seems.

How it works

OpenAI defines it in its documentation in one sentence: an embedding is a vector, a list of floating-point numbers, and the distance between two vectors measures their relatedness. Small distances suggest high relatedness; large distances, low. They are used for search, clustering, recommendations, classification or detecting what does not fit.⁠[1]OpenAI, API documentation. Vector embeddings

Google's machine learning course explains it with food. If you place dishes along a line by how much they resemble a sandwich, the hot dog and the shawarma end up close; if you add a second dimension, "how much of a dessert it is", the apple strudel pulls away from both. Each added dimension captures one more nuance, and the distance between two points is read as their relative similarity within that representation.⁠[2]Google for Developers, Machine Learning Crash Course. Embeddings: Embedding space and static embeddings The difference from real life is one of scale and clarity: real spaces have many more dimensions (in word spaces, often 256, 512 or 1024) and their dimensions are almost never as understandable as "dessert" or "liquid". Also, each embedding depends on the task it was created for.⁠[2]Google for Developers, Machine Learning Crash Course. Embeddings: Embedding space and static embeddings

Current models work with even more dimensions. OpenAI's return vectors of 1536 numbers by default (text-embedding-3-small) or 3072 (text-embedding-3-large).⁠[1]OpenAI, API documentation. Vector embeddings Gemini's return 3072 by default, and Google recommends 768, 1536 or 3072. Its newest model, gemini-embedding-2, places text, images, video, audio and documents in a single space, in more than a hundred languages.⁠[3]Google AI for Developers, Gemini API documentation. Embeddings

To compare two vectors, cosine similarity is used almost always. The Gemini documentation explains why: it measures direction, not size, which better reflects closeness between concepts, and it runs from -1 (opposite) to 1 (most similar).⁠[3]Google AI for Developers, Gemini API documentation. Embeddings OpenAI recommends it too.⁠[1]OpenAI, API documentation. Vector embeddings

There is a nuance that matters in a store with ambiguous vocabulary. Static embeddings, like those of the classic word2vec, give each word a single point covering all its meanings, and that is a limitation in some cases.⁠[2]Google for Developers, Machine Learning Crash Course. Embeddings: Embedding space and static embeddings Think of "bat": the animal, the baseball kind or the cricket kind. Today's text embedding models calculate the vector for the whole text, which is what they measure when they compare a question with a product page.⁠[1]OpenAI, API documentation. Vector embeddings

Google's guide to its ranking systems does not detail which technique each one uses, but it does describe two that work with concepts and not only words: RankBrain, which helps it understand how words relate to concepts and return relevant content even if it does not contain every word in the search, and neural matching, which understands representations of concepts in queries and pages and matches them.⁠[4]Google Search Central. A guide to Google Search ranking systems And Google cites RAG (retrieval-augmented generation), the technique an assistant uses to retrieve documents before answering, as one of the common uses of embeddings.⁠[3]Google AI for Developers, Gemini API documentation. Embeddings

In a store

A fictitious example, with a toy space of three made-up dimensions: how much a text has to do with boiling water, with metal and with plastic. The coordinates do not come from any model; they are set by hand so you can see the math.

Text Boiling water Metal Plastic
Search: "stainless steel kettle" 0.8 0.6 0.0
Page A: "Electric kettle with stainless steel interior" 0.9 0.7 0.1
Page B: "Stainless steel frying pan" 0.1 0.9 0.0
Page C: "BPA-free plastic electric kettle" 0.9 0.0 0.8

The cosine similarity of the search with each page, with page A's math worked out:

A: (0.8 × 0.9) + (0.6 × 0.7) + (0.0 × 0.1) = 1.14
   length of the search = 1.000   length of A = 1.145
   similarity = 1.14 / (1.000 × 1.145) = 0.996

B: similarity = 0.685
C: similarity = 0.598

Page A wins, and that makes sense. Now imagine someone copies A's description onto page C by mistake, though C is plastic: page C would have exactly the same vector as A and would sit just as close to the search. The embedding is calculated from the text, not the product, so it does not know whether what the text says is true. That is why a well-written fact on the product page matters: it is the only thing the vector can represent. Clione, for example, calculates a 1536-dimension vector for each product, category, collection and content page for semantic search inside the catalog.

Warning:

What gets mixed up

That a high similarity means the system "understands" the product or that the product page answers the question well. Google's course puts it carefully: distance is interpreted as relative similarity within the model's representation, and its dimensions can almost never be read.⁠[2]Google for Developers, Machine Learning Crash Course. Embeddings: Embedding space and static embeddings OpenAI speaks of relatedness between texts, not truth.⁠[1]OpenAI, API documentation. Vector embeddings A false text that resembles the question ends up as close as a true one.

How to check it

For anyone who wants to see it with their own product pages, with a few lines of code or a Python notebook:

  1. Write three real searches from your customers, taken from your store's search or from Search Console, and copy the descriptions of the products that should come up.
  2. Calculate the embeddings with an API: the OpenAI and Gemini documentation include a sample call, with the model name and the text as input.⁠[1]OpenAI, API documentation. Vector embeddings⁠[3]Google AI for Developers, Gemini API documentation. Embeddings
  3. Compare each search with each description using cosine similarity, which runs from -1 to 1.⁠[3]Google AI for Developers, Gemini API documentation. Embeddings With OpenAI's models, which return normalized vectors, the dot product is enough.⁠[1]OpenAI, API documentation. Vector embeddings
  4. Always compare within the same model and the same task: embeddings depend on the task they were created for.⁠[2]Google for Developers, Machine Learning Crash Course. Embeddings: Embedding space and static embeddings
  5. Review the top results by hand against each product's real data. The number says which text is most similar, not which is true.

Semantic search is the use; embeddings are the representation that makes it possible in most current systems. Google presents its embeddings for exactly that: searching, ranking and clustering with results that are more precise and more context-aware than those of keyword searches.⁠[3]Google AI for Developers, Gemini API documentation. Embeddings Vector search is the mechanical part: storing millions of vectors and quickly finding the ones closest to a given one. An embedding without search finds nothing, and a semantic search without embeddings needs another way to represent meaning.

To keep going, the entry on AI search explains how an assistant retrieves pages before answering, and the reading path orders the rest of the terms.

Synonyms

English
embeddings, vector embeddings
Español
vectores semánticos

Sources

  1. [1] OpenAI, API documentation. Vector embeddings. Accessed . ↑ ↑ ↑ ↑ ↑ ↑ ↑
  2. [2] Google for Developers, Machine Learning Crash Course. Embeddings: Embedding space and static embeddings. Accessed . ↑ ↑ ↑ ↑ ↑
  3. [3] Google AI for Developers, Gemini API documentation. Embeddings. Accessed . ↑ ↑ ↑ ↑ ↑ ↑
  4. [4] Google Search Central. A guide to Google Search ranking systems. Accessed . ↑

Change history

  • First English version, translated from the Spanish original.

This definition is published under CC BY 4.0. Reuse this definition freely, crediting Clione with a link to this page.

Make your catalog easy for bots to read

Clione fills every product page with what bots read best: the JSON-LD graph with its structured data, the meta description and the FAQs. You review and press Push; then we check your live store so it all stays published.