> ## Content Index
> Fetch the complete content index at: https://www.taivo.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# Retrieval-augmented generation
- URL: https://www.taivo.ai/__retrieval-augmented-generation/
- Published: 2023-09-21T10:31:22.000Z
- Updated: 2024-01-23T12:42:43.000Z
- Author: Taivo Pungas
- Tags: Systems, stream

Retrieval-augmented generation, or RAG, is a fancy term hiding a simple idea:

**Problem**: **LLM*s can reason, but they don't have the most relevant facts about your situation. They don't know the location of your user, or the most relevant passage from the knowledge base, or what the current list of customers is in their CRM. Whatever your application, you need to add **Context*.

**Solution**: just add this information into the context window!

**Problem 2**: but the context window is finite (and small), and you probably can't fit in your company's whole handbook, or a technical manual, or a customer's usage logs.

**Solution 2**: gather up all the potentially-relevant things for your query, index them in advance, and at runtime try to **retrieve* the most relevant ones for the LLM to use in the *generation* step.