# Embedding

> An embedding is a list of numbers that represents the meaning of a piece of text, an image or another item, so that items with similar meanings end up close together and can be compared, searched or grouped by software.

Also called: embeddings, vector embedding, text embedding, embedding vector, vector representation. Category: Models and training. Source: https://aibuildindex.com/glossary/embedding

## In the index

- Vector databases: median $4,000, middle half $500 to $11,400, 264 priced briefs (https://aibuildindex.com/skills/vector-databases)
- RAG: median $3,860, middle half $500 to $14,400, 586 priced briefs (https://aibuildindex.com/skills/rag)
- Pinecone: median $3,600, middle half $440 to $7,200, 72 priced briefs (https://aibuildindex.com/tools/pinecone)

Computers compare words by their spelling, which is why a search for "cancel my plan" can miss a help article titled "ending your subscription". An embedding solves this by turning text into a position in a space of meaning. Two passages about the same idea land near each other even if they share no words. Embeddings sit underneath most AI search, document question-answering, recommendation and duplicate detection, so they appear in many builds even when the buyer never sees them.

## How it works

An embedding model reads an input, such as a sentence, a paragraph or an image, and outputs a fixed-length list of numbers, called a vector. The model has been trained so that similar inputs produce similar vectors. Comparing two items then becomes a quick calculation of how close their vectors are.

In a typical document search build:

1. Documents are split into passages ([chunking](https://aibuildindex.com/glossary/chunking)).
2. Each passage is sent to an embedding model, and the resulting vectors are stored in a [vector database](https://aibuildindex.com/glossary/vector-database).
3. When a user asks a question, the question is embedded with the same model.
4. The database returns the passages whose vectors are closest, which is the core of [semantic search](https://aibuildindex.com/glossary/semantic-search) and [retrieval-augmented generation](https://aibuildindex.com/glossary/retrieval-augmented-generation).

Embeddings are also used to group similar support tickets, find duplicate records, match products to customers in a [recommendation system](https://aibuildindex.com/glossary/recommendation-system) and flag unusual items.

Embedding models are separate from chat models. They are generally smaller and cheaper per use, and they differ in language coverage, domain strength and vector size.

## What it means for cost

Creating embeddings is usually a modest part of running cost, because each passage is embedded once and only re-embedded when it changes. The larger cost is in the decisions around them: how to split documents, which embedding model suits your language and subject, how to keep the index in sync as documents change, and how to test that searches return the right passages.

Changing the embedding model later means re-embedding everything, which matters for large collections. Ask a builder which embedding model they chose and why, how updates to documents are handled, and how retrieval quality will be measured.

## Common questions

### Is an embedding the same as a language model?

No. An embedding model turns input into numbers for comparison; it does not write text. A typical AI search build uses an embedding model to find relevant passages and a separate language model to write the answer.

### Can embeddings from different models be mixed?

No. Vectors from different embedding models live in different spaces and cannot be compared meaningfully. Switching models means re-embedding the whole collection.

### Do embeddings work across languages?

Multilingual embedding models can place similar meanings close together across languages, so a question in one language can find a passage in another. Quality varies by language pair, so builds serving several languages should test each.

## Related terms

- [Vector database](https://aibuildindex.com/glossary/vector-database): A vector database is a data store built to save embeddings, the numeric representations of text, images or audio, and to find the stored items most similar in meaning to a query, which makes it the usual search layer behind RAG systems.
- [Semantic search](https://aibuildindex.com/glossary/semantic-search): Semantic search is search that matches by meaning rather than exact words, typically by comparing embeddings, so a query such as "how do I get my money back" can find a page titled "Refund policy".
- [Retrieval-augmented generation (RAG)](https://aibuildindex.com/glossary/retrieval-augmented-generation): Retrieval-augmented generation is a way of answering questions with a language model that first looks up relevant passages in your own documents, then writes an answer grounded in what it found.
- [Chunking](https://aibuildindex.com/glossary/chunking): Chunking is the step in a retrieval system that splits long documents into smaller passages before they are embedded and indexed, so that a search can return the specific section that answers a question rather than a whole file.
- [Recommendation system](https://aibuildindex.com/glossary/recommendation-system): A recommendation system is software that predicts which products, content or actions a particular user is most likely to want, based on their behaviour, the item's attributes and what similar users chose, and ranks options accordingly.
- [Hybrid search](https://aibuildindex.com/glossary/hybrid-search): Hybrid search combines keyword search and semantic vector search in one query and merges their results, so a system finds both exact matches such as product codes and passages that match by meaning.
