An embedding is a piece of content — a sentence, a document, an image — converted into a vector: a list of hundreds or thousands of numbers. The trick is where things land in that number space: an embedding model is trained so that similar meanings get similar vectors. “How do I reset my password?” and “I can’t log into my account” share almost no words, but their embeddings sit close together — which is exactly what keyword search misses and semantic search catches.
What “close together” buys you
Once meaning is geometry, search becomes math. Embed your documents once, store the vectors, embed the query at ask-time, and find the nearest neighbors — that’s semantic search, and it’s the retrieval step inside every serious RAG system. The same mechanics power recommendations (“users who liked this vector also liked…”), deduplication, clustering and classification. A vector database (Pinecone, pgvector, Qdrant and kin) is just a store optimized for the nearest-neighbor part at scale.
Where embeddings come from
Embedding models are trained on pairs that should match — a question and its answer, a caption and its image — pulling matching pairs together in the vector space and pushing mismatches apart. They’re separate, much smaller models than chat LLMs, priced accordingly (fractions of a cent per million tokens). Multimodal embedding models like CLIP’s descendants map text and images into one shared space, which is how “photo of a red bicycle” retrieves the actual photo.
What to watch out for
Embeddings compress meaning lossily. Long documents squeezed into one vector blur their details — which is why RAG pipelines chunk text before embedding. Vectors from different models don’t mix: switch embedding models and you re-embed everything. And similarity is what the training data says it is — an embedding model tuned on web text may consider “Java” the island and “Java” the language neighbors until a domain-tuned model separates them. When retrieval quality plateaus, teams usually add a reranker — a second model that re-scores the top hits with full attention — rather than hunting for a magic embedding.