Roberto Infante
MANNING
,2 EPILOGUE
RAG Q&A Stage
Chatbot
User question Retriever User question
LLM
User
Retrieved
chunks
1. The retriever transforms Prompt
Question Similar Response
the user question into embeddings chunks
the corresponding
embedding.
3. The vector DB returns
2. The retriever searches text chunks relevant
for relevant chunks to the user question.
using the question 5. The LLM accepts
embedding. Vector
4. The chatbot creates the prompt and
DB a prompt with the synthesizes a
user question and corresponding
the retrieved chunks completion (the
(the context). response).
User question Retrieval Prompt Generation
Retrieval-Augmented Generation (RAG) Q&A stage: retrieval and generation
,AI Agents and Applications
, ii