ClarityAI LogoClarityAI
Other/rag

RAG

A method that gives an AI access to external documents before it generates a response.

What it actually means

RAG stands for Retrieval-Augmented Generation. Instead of relying purely on what a model learned during training, RAG first searches a database of documents for relevant information, then passes that information to the model as context before generating a response. The model answers based on what it retrieved.

Real-world analogy

Think of an open-book exam versus a closed-book one. A standard LLM is closed-book — it can only use what it memorised during training. RAG gives the model an open book — it can look things up before answering. The answer is still generated by the model, but it's grounded in retrieved facts.

Common misconception

RAG doesn't eliminate hallucination. If the retrieved documents are wrong, outdated, or irrelevant, the model can still produce inaccurate answers. The quality of the retrieval step is just as important as the quality of the model itself.