This website and its content are generated by AI. This website is created for demonstration purposes.

Retrieval Augmented Generation

Retrieval Augmented Generation (RAG) Patterns #

Retrieval Augmented Generation (RAG) is a technique that enhances generative AI outputs by first retrieving relevant information from a knowledge base and then using that information to guide the generation process.

Why RAG? #

RAG addresses several limitations of foundation models:

  1. Knowledge Cutoffs: Foundation models have knowledge limited to their training data
  2. Hallucinations: Models may generate plausible but incorrect information
  3. Sourcing: RAG can provide attribution for generated content
  4. Customization: Allows models to access domain-specific knowledge without fine-tuning

Basic RAG Architecture #

Basic RAG Architecture

  1. Document Processing: Convert documents into chunks and embeddings
  2. Retrieval: Find relevant information based on the query
  3. Augmented Prompting: Enhance the prompt with retrieved information
  4. Generation: Produce the final output using the augmented prompt

Patterns in this Section #