liveBook · Manning

Embedding

As explained in Enterprise RAG

An embedding process converts textual or other source content into numerical vector representations.

An embedding converts text into a numerical vector that represents its meaning. In retrieval-augmented generation (RAG), embeddings let a question retrieve related content even when its wording differs from the stored text. A vector database or search index compares the query vector with vectors for stored content, then returns the closest matches as context for a language model. section 1.0 section 1.1

Production retrieval creates embeddings during ingestion as well as at query time. Split source documents into meaningful chunks, attach metadata such as product, topic, and page number, and embed each chunk. Metadata narrows the search space while vectors supply semantic matching; retrieved chunks can also retain links back to their source. section 1.5

Figure 1.8 Enterprise RAG system architecture showing ingestion, retrieval, and generation steps. Raw data is preprocessed, embedded, and searched to deliver accurate, context-aware answers.

This architecture places embedding between preprocessing and retrieval: prepared source data becomes searchable vectors, while an incoming question is matched against them before answer generation. section 1.5

Embedding dimensions must match the vector field configured in the search index. One implementation uses the text-embedding-3-small model with 1,536 dimensions, selected as a cost-and-accuracy trade-off. A mismatched dimension makes vectors incompatible with the index. section 3.2.3

Use embeddings as one retrieval signal, not the entire search strategy:

  • Embed the user query and retrieve its nearest vectors to catch conceptually related phrasing. section 3.2.7
  • Combine vector similarity with plain-text keyword search to retain exact phrases and improve the merged result set. section 3.2.7
  • Keep the index synchronized by updating changed records and removing deleted ones so embeddings represent current data. section 3.4

Hybrid search for “Dubious Parenting Advice”

Create an embedding for the query, pass it to a VectorizedQuery configured for three nearest neighbors in the vector field, and submit the original query as search text too. This can retrieve “Dubious Parenting Tips” through semantic similarity while preserving keyword matching in the same request. section 3.2.7

In an agent-driven search flow, an asynchronous function can embed the user query before an executor searches the Azure AI Search index. The query text remains available alongside its vector, broadening text search rather than replacing it. section 4.2.1

How Enterprise RAG covers it

How deep it goes
Works through chunk ingestion, dimension compatibility, query embedding, and hybrid retrieval without embedding-level derivations.
Examples
Demonstrates embedded manual chunks, 1,536-dimensional record summaries, and a “Dubious Parenting Advice” hybrid query.
What it assumes
Assumes a configured search index and API client while showing functions that create record and query embeddings.
What you can do after
Apply it via Azure AI Search and an embedding API to index records and run hybrid searches.
How it connects
Connects embeddings with RAG, vector search, metadata, Azure AI Search, keyword search, and language models.

Also explained in

Compare how 72 books explain embedding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Enterprise RAG. The section links point to the parts of the book it draws on.