What Is an Embedding: A Plain-English Definition
Think of an embedding as a location in a very large map. Each word, sentence, or document gets assigned a specific position in this map based on its meaning. Items with similar meanings end up near each other. 'Dog' and 'puppy' are close together. 'Interest rate' and 'mortgage' are close together. 'Banana' and 'quantum physics' are far apart. The technical mechanism is a neural network trained to produce these vector representations. Text embedding models like OpenAI's text-embedding-3-large or Cohere's embed-v3 take text as input and output a fixed-length array of numbers, typically 768 to 3,072 dimensions depending on the model. These dimensions have no human-interpretable meaning individually, but together they encode rich semantic information that allows mathematical operations to capture meaning. The most important mathematical operation on embeddings is cosine similarity, which measures the angle between two vectors. A cosine similarity of 1.0 means two texts have identical meaning in the embedding space. A cosine similarity close to 0 means they are unrelated. This allows you to find the top-N most semantically similar chunks from a large corpus for any given query, without needing exact keyword matches. Embeddings are not limited to text. Image embedding models can represent photos as vectors, enabling similarity search over image libraries. Multimodal models like OpenAI's CLIP can embed both text and images into the same vector space, so a text query can retrieve visually relevant images.
How Embeddings Work
To use embeddings in a product, the workflow has two phases: indexing and querying. During indexing, you take your source documents, whether they are product descriptions, support articles, legal contracts, or internal knowledge base entries, and split them into chunks. Each chunk is then sent through an embedding model to produce a vector. These vectors are stored in a vector database alongside metadata and the original text. During querying, when a user types a search query or when an LLM needs to retrieve relevant context, the query is also embedded using the same model. The system then performs a nearest-neighbour search in the vector database to find the stored chunks whose vectors are closest to the query vector. Those chunks are the semantically relevant results. Consider a concrete example. A UK HR software startup wants to build an employee handbook search tool. They take their 200-page handbook, split it into 400 chunks of roughly 500 words each, and embed each chunk using text-embedding-3-small. These 400 vectors are stored in Pinecone. When an employee asks 'Can I carry over unused holiday to next year?', the query is embedded and matched against the stored vectors. The three most similar chunks, which contain the firm's holiday carryover policy, are retrieved and passed to an LLM to generate a clear, grounded answer. The quality of the embedding model significantly affects retrieval quality. Newer models like text-embedding-3-large outperform older models like ada-002 on most benchmarks. For non-English content or multilingual products, models like Cohere's embed-multilingual-v3 or OpenAI's multilingual embeddings are required.
Why Embeddings Matter for AI Product Development
Embeddings are what make modern AI products search through meaning rather than keywords. The difference in user experience is significant. Keyword search fails when users phrase things differently from how your documents are written. Semantic search with embeddings finds the right content even when the exact words do not match. For product teams building RAG applications, which is the dominant pattern for knowledge-grounded AI products, embeddings are not optional. They are the core retrieval mechanism. How well your embeddings capture semantic meaning in your specific domain directly affects the quality of your AI product's responses. Embeddings also enable recommendation systems. By representing users and content as vectors, you can find content that is similar to what a user has engaged with. This underlies personalisation features in content platforms, e-commerce sites, and learning applications. Compliance considerations apply in certain scenarios. Embedding personal data, such as customer messages, medical notes, or financial correspondence, and storing the resulting vectors in a vector database constitutes processing of personal data under UK GDPR. The vectors themselves, while not human-readable, can potentially be used to reconstruct approximate versions of the original text. Data minimisation principles apply, and you need appropriate access controls and retention policies on your vector store.
Common Use Cases for Embeddings
Document retrieval is the most common embedding use case. Enterprise knowledge bases, legal document libraries, and customer support article stores all benefit from embedding-powered semantic search. A query like 'what is our refund policy for enterprise customers' correctly retrieves the relevant contract clause even if the exact phrase 'refund policy' never appears in the document. Duplicate detection uses embedding similarity to identify near-identical content. Content moderation systems, fraud detection for repeated support ticket abuse, and deduplication of product catalogs all use this pattern. Classification with few examples is another strong use case. Rather than training a custom classifier, you can embed examples of each class and classify new items by finding which class centroid they are closest to. This is effective for support ticket routing, content categorisation, and lead scoring. Personalisation and recommendation engines use embeddings to represent user preferences as vectors derived from their behaviour. When a user reads three articles about containerisation and one about Kubernetes, their combined embedding profile points toward cloud infrastructure content, enabling accurate recommendations. For UK healthtech teams, embedding clinical notes for retrieval requires careful governance. NHS Digital provides guidance on processing clinical data, and any system embedding patient records needs to address right to erasure requirements under UK GDPR, since deletion from a vector database requires removing both the stored vector and rebuilding any affected index structures.
Related Concepts You Need to Know
Vector databases are the storage layer for embeddings. Once you generate embedding vectors, you need a system that can store them and perform fast nearest-neighbour searches at scale. Options include Pinecone (hosted, production-ready), Weaviate (open-source with a managed option), Qdrant (fast, open-source), and pgvector (a PostgreSQL extension suitable for lower-scale use cases). Choosing the right vector store depends on your scale, latency requirements, and whether you want managed infrastructure or self-hosted control. Semantic search is the application that embeddings most directly enable. Understanding the difference between keyword search, which operates on exact term matching, and semantic search, which operates on meaning, helps you design better search experiences and know when to use each. Retrieval-augmented generation builds on embeddings to give LLMs access to external knowledge. The retrieval step uses embeddings to find relevant chunks; the generation step uses an LLM to synthesise those chunks into a coherent answer. Together, they form the most widely deployed architecture for knowledge-grounded AI products. Transformer architecture is the foundation that makes high-quality embedding models possible. The same attention mechanisms that power LLMs also power embedding models, which is why text embedding models have followed a similar scaling trend toward larger, more capable models. Chunking strategy, the way you split documents before embedding, has a significant effect on retrieval quality. Chunks that are too long lose specificity; chunks that are too short lose context. Typical production systems use chunks of 256-512 tokens with some overlap between adjacent chunks to avoid cutting off relevant context at chunk boundaries.