Retrieval-Augmented Generation
How RAG gives AI
the right context.
Instead of asking a model to remember everything, RAG first finds the most relevant information, adds it to the prompt, then generates an answer grounded in that evidence.
01 / 07 · Ask
A user asks a question.
The model needs information that may be private, recent, or too specific to rely on memory alone.
“What is our refund policy?”
user query
Knowledge Base PRIVATE DATA
#1 · Refund policy
#2 · Returns
#3 · Exceptions
Augmented Prompt Question + Evidence
User questionWhat is our refund policy?
+
Retrieved context
↓
InstructionAnswer using only the provided context.
LLM
Generate with context
AI Answer Grounded
The refund window is 30 days.
Customers can request a full refund within 30 days of purchase. The product must meet the return conditions listed in the policy. Digital items are handled under a separate exception.
↗ Refund Policy.pdf↗ Returns.md↗ Exceptions.pdf
R · Retrieve→A · Augment→G · Generate
01 / 07
R
Retrieval
Search your knowledge base and fetch only the information most relevant to the user’s question.
A
Augmented
Insert the retrieved evidence into the prompt, so the model sees the right facts at generation time.
G
Generation
Generate the final answer from the question plus the supplied context, making the response more grounded and useful.