Glossary Entry

What is Embeddings?

Embeddings are numeric vectors that capture the meaning of text, images, or audio. Learn how vector search over embeddings supports RAG and hybrid search.

Written by Alex Merced

Embeddings are lists of numbers (vectors) that represent the meaning of a piece of content, such as a sentence, a document chunk, an image, or a product, so that items with similar meaning end up close together in vector space. A model trained for the purpose produces them: two support tickets that describe the same problem in different words get vectors that point in nearly the same direction, while an unrelated ticket lands far away. That property lets software search, cluster, and compare content by meaning rather than by exact keywords.

How It Works

  1. Choose an embedding model. Text models, image models, and multimodal models each map their inputs into a vector of fixed length. The length (the dimension) is set by the model, commonly several hundred to a few thousand values.
  2. Prepare the content. Long documents are split into chunks so each vector represents a focused passage.
  3. Generate vectors. Each chunk is passed through the model, and the output vector is stored along with the original text and metadata such as source, date, and access labels.
  4. Embed the query. At search time, the user’s question is embedded with the same model.
  5. Compare. The system finds stored vectors closest to the query vector, typically with cosine similarity, dot product, or Euclidean distance.

Exact comparison against every stored vector is slow for large collections, so vector databases and search engines use approximate nearest neighbor indexes such as HNSW to find close matches quickly. The vector similarity metrics entry covers the distance functions in more detail.

Vectors from different models are not compatible. If you change the embedding model, every stored vector has to be regenerated.

AspectKeyword (lexical) searchEmbedding (semantic) search
Matches onShared words and termsSimilar meaning
Handles synonyms and paraphrasePoorly without extra configurationWell
Exact codes, IDs, rare termsWellCan miss them
ExplainabilityEasy to see why a result matchedHarder to explain
IndexInverted indexVector index

Because each approach covers the other’s weak spots, many systems combine them in hybrid search.

Embeddings in the Lakehouse

Embeddings are central to retrieval-augmented generation, where an AI assistant retrieves relevant passages before answering. In a lakehouse, the source content and its metadata usually live in governed tables, and the embeddings are derived data that need the same care as any other pipeline output:

  • Generation. A batch or streaming job reads new or changed rows from Apache Iceberg tables, chunks the text, calls the embedding model, and writes vectors back to a table or a vector store.
  • Storage. Vectors can sit in a dedicated vector database or in lakehouse tables as fixed-length float arrays. DuckDB’s vss extension, for example, can build HNSW indexes on fixed-size float array columns, though the DuckDB docs mark the extension experimental.
  • Governance. The access rules on the source tables should carry over to the vectors and their text, or a semantic search can surface content a user is not allowed to read.
  • Freshness. Iceberg snapshots and change data make it possible to re-embed only the rows that changed.

The Hub post on vector search over Iceberg tables walks through these patterns, and the vector embeddings entry covers the math behind them.

Summary

Embeddings turn content into vectors whose distances reflect meaning. They power semantic search, recommendations, clustering, and RAG, and in a lakehouse they are best treated as governed, versioned derived data generated from the tables they describe.

Learn More

To learn more about the Data Lakehouse, read The Lakehouse Built for Everyone by Alex Merced. You can find this and other books by Alex Merced at books.alexmerced.com.

Related Terms

What is a Vector Database?

A vector database stores embeddings and finds items by semantic similarity, covering HNSW and IVF indexes, metadata filtering, and hybrid search for AI apps.

What is Hybrid Search?

Hybrid search combines semantic vector search with keyword search and merges the rankings, so retrieval matches both meaning and exact terms in AI applications.

What is Vector Similarity Metrics?

Vector similarity metrics measure how close two embeddings are, comparing cosine similarity, Euclidean distance, and dot product and their impact on RAG search.

What is Semantic Search?

Semantic search finds results by meaning instead of exact keywords, using vector embeddings and nearest neighbor similarity, and hybrid search mixes both.

What are Vector Embeddings?

Vector embeddings are numeric arrays that represent the meaning of text, images, or audio so AI models can compare them, and how they fit into a data lakehouse.

What is Retrieval-Augmented Generation (RAG)?

Retrieval-augmented generation (RAG) grounds an LLM's answers in documents retrieved at query time. See how chunking, embeddings, and vector search fit in.

What is Graph Neural Networks (GNNs)?

Graph neural networks (GNNs) are deep learning models for graph data that learn by passing messages between connected nodes. See their core tasks and uses.

Lance File Format: How It Compares to Parquet and Apache Iceberg for AI Data

Lance is an open columnar format for AI data with fast random access and built-in vector indexes. See how it compares to Parquet and where it fits with Iceberg.

What is Semantic Caching?

Semantic caching stores LLM responses and reuses one when a new prompt means the same as an earlier one, matched by embedding similarity, to cut model calls.

Work with Alex