RAG

Retrieval-Augmented Generation — grounding model answers in relevant retrieved documents.

Retrieval-Augmented Generation (RAG) is a pattern where an application first retrieves relevant documents from an external data source, then passes those documents as context alongside the user’s query to a foundation model, letting the model generate answers grounded in current, private information rather than relying solely on its training data. Amazon Bedrock Knowledge Bases implements managed RAG, handling the full pipeline: ingesting documents into a vector store, chunking and embedding them, and performing semantic retrieval at inference time.

The key exam distinction is that RAG augments the model’s context window at runtime, while fine-tuning permanently adjusts model weights through additional training. RAG is preferred when data changes frequently or when knowledge is proprietary, because updating the data source requires no retraining.

PlayPrepHQ study notes are written and reviewed against primary exam sources. How we create & review content →

Related terms

Back to Applications of Foundation Models