Definition
Retrieval-Augmented Generation (RAG) is an architectural pattern that retrieves relevant factual knowledge from external vectorized databases and injects it into an LLM's prompt context prior to response synthesis.
Purpose
Prevents factual hallucinations and delivers up-to-date domain expertise without the massive computational expense of continuous model retraining.
Key Concepts
How It Works
User queries are embedded into vector space, matched against document databases via cosine similarity, and top chunks are prepended to the prompt context.
Related Terms
Sources
- Patrick Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, Meta AI / NeurIPS
- Pinecone System Architecture