An embedding is a list of numbers, called a vector, that a model produces from a piece of text. Text with similar meaning gets vectors that sit close together in vector space.
RAG depends on embeddings because retrieval must match on meaning, not exact words. You embed each chunk at index time and the question at query time, then hand the nearest chunks to the LLM that writes the answer. A question about getting money back can reach the refund policy with no word in common.
q = embed("can I get my money back") # one vector, e.g. 1536 floats
hits = index.search(q, k=5) # chunks whose vectors are nearest
The query and the chunks must go through the same embedding model, or the numbers are not comparable. And the vector only carries what the model learned, so rare product names or IDs can be missed.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓