Back to glossary

Term

Embedding

An embedding is a numeric representation (vector) of text, an image, or other data in which semantically similar content sits close together in space.

Embedding — explained in more detail

An embedding converts content into a vector with typically several hundred to several thousand dimensions. These vectors are trained so that geometric proximity reflects semantic similarity — the distance between “dog” and “puppy” is small, while the distance between “dog” and “stock price” is large. This property powers semantic search, clustering, classification, and especially retrieval-augmented generation.

Example / Practical context

In a typical RAG setup, documents are split into chunks; each chunk is turned into a vector by an embedding model (such as OpenAI’s text-embedding-3-large, BGE, or a local model) and stored in a vector database like pgvector, Qdrant, or Chroma. At query time the question itself is embedded, and the database returns the nearest vectors — i.e. the most relevant passages.

Embeddings are not a full-text index or a keyword list — they operate on meaning rather than exact word matches. They are also not the language model itself: the embedding model produces vectors for retrieval, and the LLM then composes the answer from the retrieved passages.

Entdecke mehr