While learning about RAG (Retrieval-Augmented Generation), I came across an interesting question:
If vector search can find the right information using embeddings, why do we still need to store the original text? Can't we simply convert those embeddings back into words and send them to the LLM?
It sounds like a reasonable idea, but there is something important we need to understand about embeddings.
1. What exactly is an embedding?
An embedding is a list of numbers generated from text by an embedding model. These numbers represent the meaning of the text in a way that computers can understand and compare.
For example, consider this sentence:
"A car needs fuel to run."
An embedding model converts it into something like:
[0.21, 0.85, -0.34, 0.67, 0.12, -0.45, ...]
These numbers represent the meaning of the sentence.
Now, consider another sentence:
"Vehicles require petrol to operate."
Although the words are different, the meaning is almost the same.…