Great question — answering as the UphillTech team:
Yes, you're thinking about it right. When a user asks a question, you use the same model you used to store your documents in the first place to turn that question into an embedding. The vector database then determines which text passages are the most similar by comparing that query embedding to the ones that are stored. That's what we're looking for. Since LLMs comprehend text and not number vectors, you then send the LLM the actual text, not the embeddings. So the straightforward flow is: Question → Embedding → Locate related stored text → Forward that text and question to LLM → Receive response You only have to make embeddings for your documents once. The goal of RAG is to keep things...
Full answer by Aradhya: https://stackoverflow.stackexchange.com/a/79889294 (CC BY-SA 4.0).
Need it done for your business? UphillTech.