CertBrain
Sign in
← Back to decks
Sign in to save your progress.Sign in

Retrieval Augmented Generation

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…

10 cards

Retrieval Augmented Generation

In this lesson · 5 sections
Show one section at a time

Terms you'll meet

Tap a card to see what it means.

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):

  1. Documents are converted to text and split into chunks.
  2. An embedding model turns each chunk into a vector, a list of numbers that captures its meaning.
  3. The vectors and their text are stored in a vector database.

Answering a question (every request):

  1. The user's question is turned into a vector with the same embedding model.
  2. The vector database returns the chunks whose meaning is closest to the question.
  3. Those chunks are added to the prompt as context.
  4. 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.

CertBrain is an independent study tool. It is not affiliated with, endorsed by, or sponsored by Amazon Web Services, Inc. or Microsoft. Learn more

Quiz me on this
Retrieval Augmented Generation (RAG)
Save
Amazon Bedrock Knowledge Bases
Save
Retrieve vs RetrieveAndGenerate
Save
Reranking model
Save
What RAG doesn't do
Save