liveBook · Manning

Embedding

As explained in Effective Conversational AI

A text embedding is a numerical vector representation that encodes semantic or contextual properties of text.

An embedding turns a word, phrase, or document chunk into a numerical vector. Similar meanings occupy nearby positions in a high-dimensional vector space, while dissimilar meanings are farther apart, making semantic search more useful than keyword matching. section 6.3.2

A retrieval pipeline uses embeddings to connect user questions with relevant content:

  • Preprocess documents by converting files, adding metadata, and dividing text into coherent semantic chunks. section 6.3.2
  • Generate an embedding for each chunk and store the vectors in a vector database. section 6.3.2
  • Embed the user’s question, compare vectors with cosine similarity or another method, and retrieve the closest matches. section 6.3.2
  • Benchmark embedding and indexing combinations against accuracy, relevance, latency, throughput, and resource-use goals. section 6.5.4

Embedding a healthcare chatbot’s knowledge

For PharmaBot, medical articles, research papers, and health guidelines are chunked and embedded, then indexed with a selected solution such as FAISS or Elasticsearch. Queries such as “Can I take ibuprofen with my blood pressure medication?” are tested with embedding models including BERT, Sentence-BERT, or GPT-3 embeddings. The configurations are compared using measures such as recall, precision, F1 score, relevance, and latency. section 6.5.4

Figure 6.9 RAG uses a vector database during build time and run time.
figure

Use the RAG architecture figure to see how vector databases support embedding and retrieval during build time and run time. section 6.3.2

How Effective Conversational AI covers it

How deep it goes
Explains preprocessing, chunking, vector generation, storage, similarity search, and benchmarking without detailing embedding-model internals.
Examples
Uses document chunks, user questions, PharmaBot medical queries, vector databases, and alternative embedding-model configurations.
What it assumes
Assumes searchable documents and representative user queries, while defining how preprocessing prepares both for retrieval.
What you can do after
Evaluate embedding and indexing choices by generating vectors, running queries, and measuring retrieval and operational performance.
How it connects
Connects embeddings with RAG, chunking, vector databases, cosine similarity, indexing, and information-retrieval metrics.

Also explained in

Compare how 47 books explain embedding →

Related concepts

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