An embedding is a numerical vector produced from an input such as text. A retrieval system can compare vectors to find passages related to a query. Embeddings are one retrieval method; keyword matching and other methods can be used alongside them.OpenAI's embeddings guide defines an embedding as a vector of floating point numbers where the distance between two vectors measures their relatedness, and lists search, clustering, recommendations, and classification as the standard uses.
Representing text as numbers
The 2013 word2vec research demonstrated useful vector representations of words. Later embedding models can represent sentences and longer passages. Vector length and supported inputs depend on the model.Mikolov et al., Efficient Estimation of Word Representations in Vector Space (2013), the foundational word-vector paper.OpenAI documents default vector lengths of 1,536 numbers (text-embedding-3-small) or 3,072 (text-embedding-3-large), per the embeddings guide.
A vector contains numerical components. An individual component usually has no simple human-readable definition. Cosine similarity compares the directions of two vectors. The resulting score measures similarity under that representation, not factual accuracy.
A worked example
Consider a page titled “CRM software for small teams” and a query asking for “tools to manage sales leads for a five-person company.” An embedding model may represent those texts as similar because they describe related tasks. Whether the page is returned depends on the model, the available documents, and the retrieval system.
Use the language that describes the reader’s task accurately. Related terminology can help explain the subject, but adding synonyms mechanically is not a demonstrated way to secure a recommendation. Keyword matching remains relevant in systems that use lexical or hybrid retrieval.
Retrieving passages from documents
Some retrieval systems split documents into passages and create an embedding for each passage. This can help retrieve a specific section of a long document. Other systems use whole documents or combine several representations. There is no universal passage length.
Write sections that a reader can understand when encountered separately. Name the product or subject and keep qualifications close to the claim. This makes excerpts easier to interpret without requiring assumptions about a provider’s exact splitting method.
Where embeddings sit in the pipeline
Embeddings can also support document grouping and duplicate detection. Reranking may use a different model to assess retrieved candidates. These are separate operations, and a product need not use the same representation for each.
Using embeddings in content work
For content work, test whether a passage answers the relevant question clearly. A similarity score from an embedding model you control is a diagnostic for that model. It is not an AI search ranking score or a measurement of a private provider’s retrieval system.
See Structuring Sites and Pages for Retrieval for page organization and Writing for Retrieval and Citation for passage-level examples.
Similarity can retrieve the wrong answer
“Weekend appointments are available” and “Weekend appointments are not available” discuss almost the same subject. A similarity score can consider them closely related even though the condition is opposite.
Use similarity to find candidates for review. Then check the actual claim. The same applies to two product descriptions with different prices or incompatible plan requirements. A relevant passage can still disqualify a product.