Quick answer
RAG is a way to ground an LLM in your own data. It searches your docs for relevant parts, then uses those as context for the answer.
What it is
RAG adds a search step before the LLM answers. It searches your docs for relevant parts and passes them to the LLM as context. The LLM answers from those parts only.
Why it matters
RAG keeps LLM answers accurate on your data. It cuts hallucination and lets you cite sources.
How to use it
- Break your knowledge base into small passages.
- Convert each passage to numbers and store it.
- At query time, convert the question to numbers, find the closest passages, and pass them to the LLM.
- Ask the LLM to answer from those passages and cite its sources.
Examples
- A support bot grounded in product docs answers with citations.