RAG (Retrieval-Augmented Generation) combines an LLM with a retrieval system — fetching relevant information from a knowledge base and providing it to the LLM as context to generate accurate, grounded answers. It's a key technique for building LLM applications over custom data.
What RAG does
RAG → augment an LLM's generation with RETRIEVED relevant information:
1. RETRIEVE → search a knowledge base (your documents/data) for info relevant to the query
2. AUGMENT → add the retrieved info to the LLM's prompt as CONTEXT
3. GENERATE → the LLM answers using the provided context (grounded in your data)
→ gives the LLM relevant, up-to-date, specific knowledge it wasn't trained on
