Retrieval Augmented Generation (RAG) gives a foundation model access to your own information at the moment it answers. Instead of retraining the model, the application looks up relevant passages from your documents and adds them to the prompt, so the answer is based on current, company-specific facts. RAG is one of the most tested designs on the exam because it solves a very common business problem cheaply.
The Problem RAG Solves
A foundation model only knows what was in its training data, and that data stops at a cutoff date. It has never seen your price list, your HR policies or last week's product update. Asked about them, it may guess and produce a confident but wrong answer, a hallucination. Retraining the model every time a document changes would be slow and very expensive. RAG keeps the model as it is and brings the right facts to it on each request.
How RAG Works
RAG has two phases.
Preparing the data (done once, then refreshed):
- Documents are converted to text and split into chunks.
- An embedding model turns each chunk into a vector, a list of numbers that captures its meaning.
- The vectors and their text are stored in a vector database.
Answering a question (every request):
- The user's question is turned into a vector with the same embedding model.
- The vector database returns the chunks whose meaning is closest to the question.
- Those chunks are added to the prompt as context.
- The model writes an answer using that context.
When a document changes, you update its chunks and vectors. The model itself never changes.
Amazon Bedrock Knowledge Bases
Building this pipeline by hand takes real work. Amazon Bedrock Knowledge Bases provides it as a managed feature. You point it at a data source, such as documents in Amazon S3, choose an embedding model and a vector store, and it handles chunking, embedding and storage. At query time you can use:
- RetrieveAndGenerate: runs the whole RAG flow and returns a generated answer with citations pointing to the source chunks.
- Retrieve: returns only the most relevant chunks, so your own code decides what to do with them.
A reranking model can also be applied to re-order retrieved chunks by relevance before they reach the model.
Business Applications
RAG fits wherever answers must come from a specific, changing body of knowledge:
- Employee assistants that answer questions from HR policies and internal wikis.
- Customer support bots grounded in product manuals and help articles.
- Legal, compliance or medical research tools where users need cited sources they can check.
Because answers can include citations, users can verify where a claim came from, which builds trust in the system.
On the Exam
When a scenario says the model must answer from company documents, stay current as documents change, cite sources, or avoid the cost of retraining, the answer is usually RAG, and on AWS that usually means Amazon Bedrock Knowledge Bases. RAG adds knowledge; it doesn't change the model's style or teach it a new skill.