Skip to content

RAG (Retrieval-Augmented Generation)

LLM & Language Models

A technique that improves AI accuracy by first retrieving relevant documents from a knowledge base, then using them as context when generating a response.

RAG is one of the most important practical techniques in AI. Instead of relying solely on what the model learned during training (which may be outdated or incomplete), RAG retrieves relevant documents from an external knowledge base and includes them in the prompt.

The RAG pipeline works in three steps: (1) your question is converted to an embedding, (2) that embedding is used to search a vector database for relevant documents, (3) the retrieved documents are injected into the prompt alongside your question, giving the LLM accurate, specific context to generate from.

RAG is how enterprises make AI work with their own data without fine-tuning. A legal firm can RAG over their case database. A support team can RAG over their documentation. Perplexity essentially RAGs over the entire internet. It dramatically reduces hallucination because the model generates from retrieved facts, not just its training.

Real-World Example

Perplexity is RAG at internet scale — for every query it retrieves relevant web pages first and then generates an answer grounded in those sources. That's why it cites everything.

Related Terms

More in LLM & Language Models

FAQ

What is RAG (Retrieval-Augmented Generation)?

A technique that improves AI accuracy by first retrieving relevant documents from a knowledge base, then using them as context when generating a response.

How is RAG (Retrieval-Augmented Generation) used in practice?

Perplexity is RAG at internet scale — for every query it retrieves relevant web pages first and then generates an answer grounded in those sources. That's why it cites everything.

What concepts are related to RAG (Retrieval-Augmented Generation)?

Key related concepts include Embedding, Vector Database, Hallucination, Grounding. Understanding these together gives a more complete picture of how RAG (Retrieval-Augmented Generation) fits into the AI landscape.