Retrieval-Augmented Generation (RAG)
medium 12 minA retrieval-augmented system maintains a searchable collection and consults it for each question.
Trace the example
Follow the evidence through each stage, then test a change in the case.
Which refund policy reached the answer?
Policy collection
Policy v7 · 30 days
A revised policy extends the return period. Give its passages stable identifiers and retire superseded entries when the new index is published.
The answer says 14 days and the prompt contains only v6. Where should you investigate first?
Try a retrieval query
See it work
- Query“How do refunds work?”
- EmbeddingsConvert to a vector
- Vector indexSimilarity search over your data
- Retrieve (top-k)Keep the most relevant chunks
- LLMAnswer using the retrieved evidence
Chunks in the index
- Refund timing
- Refund policy
- Exceptions
- Shipping
- Returns label
- Warranty
1/7
Step 1 of 7 — the user asks a question
Why it matters: everything downstream depends on what the question actually says.