← Back to glossary
R

AI CONCEPTS

RAG

Also known as: Retrieval-Augmented Generation

Definition

RAG (Retrieval-Augmented Generation) is an architecture that enhances LLMs by retrieving relevant information from external knowledge bases before generating a response. This allows LLMs to answer questions about data they weren't trained on.

Simple Explanation

A plain LLM only knows what it learned during training. RAG gives it 'reading glasses.' When you ask a question, RAG first searches your document library, finds the most relevant passages, and feeds those to the LLM along with your question. The LLM then answers using both its general knowledge and the specific retrieved context.

Real-World Use Case

A legal AI assistant needs to answer questions about a company's internal contracts. RAG retrieves the specific contract clauses, the LLM analyzes them and provides a cited answer.

Examples

Vector search + LLMPinecone + GPTNotion AIChat with PDF systems

Related Terms

Learn More

  • Pinecone RAG Guide
  • LangChain RAG Tutorial