Skip to content

Skill 2.1.5: Select Retrieval Augmented Generation (RAG) architecture patterns based on use case requirements


Question Answer & Explanation
### Question 1 - Managed RAG vs. Custom Orchestration

An AI engineering team at a financial institution needs to build a Q&A assistant over a repository of internal investment strategy PDFs. The solution must be deployed in the least amount of time with the lowest operational overhead, minimizing the need to manage infrastructure or custom parsing scripts.

Which AWS service should the team use to implement this RAG architecture? (Select ONE)

- A) Deploy a custom LangChain application on Amazon EC2 instances, using a self-hosted open-source vector database.
- B) Use Amazon Bedrock Knowledge Bases to ingest the PDFs, automatically generate embeddings, and store them in a managed vector store.
- C) Set up an AWS Lambda function triggered by S3 events to parse PDFs, call the Titan embedding model, and write to an Amazon RDS PostgreSQL database.
- D) Train a custom NLP summarization model on the PDFs using Amazon SageMaker AI to answer questions directly without retrieval.
Correct Answer: B

Correct Answer Analysis:
Amazon Bedrock Knowledge Bases provides a fully managed RAG workflow. It automates document parsing, chunking, embedding generation, vector store syncing, and contextual retrieval. This satisfies the "least operational overhead" and "fastest deployment" constraints perfectly.

Distractor Analysis:
- A is Incorrect: Deploying custom LangChain on EC2 with a self-hosted vector database introduces massive operational overhead (OS patching, scaling, database maintenance).
- C is Incorrect: Building a custom Lambda pipeline with RDS introduces unnecessary development effort and operational overhead compared to a managed solution.
- D is Incorrect: Training a custom NLP model from scratch ignores the "capability is already in the model" principle and requires heavy ML engineering, violating the time-to-deploy constraint.

> Exam Tip: When a scenario demands "least operational overhead" or "fastest deployment" for RAG, always choose Amazon Bedrock Knowledge Bases over custom orchestration.
### Question 2 - Source Citation and Grounding

A legal tech company is building a contract analysis assistant. The compliance department mandates that every response generated by the LLM must explicitly cite the exact document, page number, and section it used to formulate the answer. The team is using an Amazon Bedrock foundation model.

Which TWO approaches can fulfill these source citation requirements? (Select TWO)

- A) Use Amazon Bedrock Knowledge Bases, which natively returns source metadata alongside the generated response.
- B) Fine-tune the foundation model on the corpus of contracts so it memorizes the page numbers.
- C) Configure a custom orchestration layer that retrieves document chunks with metadata and injects the source information into the model's prompt instructions.
- D) Enable Amazon Bedrock Guardrails to automatically generate citations for any generic foundation model invocation without providing a data source.
- E) Use Amazon Textract to extract text, then directly invoke the Bedrock model without storing it in a vector database or passing metadata.
Correct Answers: A and C

Correct Answer Analysis:
- A is Correct: Bedrock Knowledge Bases natively supports returning source metadata (document title, location, snippet) with the model's response, allowing for built-in citations.
- C is Correct: If building a custom RAG pipeline, you can explicitly instruct the model to cite sources by injecting the retrieved text along with its metadata (page number, section) directly into the prompt template.

Distractor Analysis:
- B is Incorrect: Fine-tuning is for behavior/style adaptation, not memorizing and citing specific page numbers from dynamic documents. It cannot provide reliable source attribution.
- D is Incorrect: Bedrock Guardrails can evaluate if a response is grounded (Contextual Grounding check), but it does not automatically generate or append source citations to generic prompts.
- E is Incorrect: Without passing metadata or using a metadata-aware retrieval system, the model has no way of knowing the page numbers or sections to cite.

> Exam Tip: RAG keeps content outside the model weights, allowing responses to point at exact sources. Fine-tuning bakes behavior in, losing the ability to cite exact sources.
### Question 3 - Whole-Document Synthesis vs. Chunk Retrieval

A research institute has a corpus of 40-page scientific papers. Researchers need an AI assistant to summarize the entire methodology and conclusion of a single selected paper holistically, rather than answering specific questions about scattered paragraphs. The foundation model selected has a context window large enough to fit a whole paper.

Which RAG architecture pattern is MOST appropriate for this use case? (Select ONE)

- A) Chunk the documents into small paragraphs and retrieve the top 5 most relevant chunks for the prompt.
- B) Bypass the vector embedding and retrieval step, and pass the entire document text directly into the foundation model's prompt.
- C) Use Amazon Bedrock Knowledge Bases with its default semantic chunking strategy.
- D) Use a keyword-based search engine to retrieve the document, then chunk it before sending to the model.
Correct Answer: B

Correct Answer Analysis:
Retrieval (chunking) is a weaker fit when a request needs whole-document synthesis. If the model's context window is large enough to hold the entire document, the best approach is to bypass retrieval and pass the whole document directly to the model to maintain holistic context.

Distractor Analysis:
- A is Incorrect: Chunking and retrieving only the top 5 paragraphs will lose the holistic context of the methodology and conclusion, resulting in a fragmented summary.
- C is Incorrect: Bedrock Knowledge Bases natively chunks documents. This is counterproductive for whole-document synthesis when the context window permits the full text.
- D is Incorrect: Retrieving and chunking still breaks the document apart, losing the end-to-end narrative required for a holistic summary.

> Exam Tip: Only use RAG chunking when you need to retrieve specific relevant passages from a large corpus. Use a large context window directly for whole-document synthesis.
### Question 4 - Managed Hybrid Data Retrieval (Amazon Q Business)

A retail company is building a customer service bot. The bot must retrieve real-time inventory data from an internal SQL database and also retrieve unstructured PDF return policy documents. The architecture must be managed and minimize custom integration code.

Which AWS service best meets these requirements? (Select ONE)

- A) Use Amazon Bedrock Knowledge Bases, configuring an OpenSearch Serverless collection to index both CSV exports of the SQL database and the PDF documents.
- B) Use Amazon Q Business, which natively connects to both structured data sources (via pre-built JDBC connectors) and unstructured document repositories.
- C) Train a custom model on both the SQL database and the PDF documents to unify the knowledge base.
- D) Use Amazon Comprehend to extract entities from the PDFs and write them to the SQL database, then query the SQL database using standard SQL.
Correct Answer: B

Correct Answer Analysis:
Amazon Q Business is a fully managed, turnkey generative AI assistant that natively connects to a wide variety of enterprise data sources—including structured databases (via JDBC connectors) and unstructured repositories (SharePoint, S3, etc.)—with minimal code required.

Distractor Analysis:
- A is Incorrect: While Bedrock KBs can ingest some structured data, syncing real-time inventory from a SQL database by exporting to CSVs is not real-time and requires heavy custom orchestration.
- C is Incorrect: Training a custom model on mixed structured/unstructured data is highly complex, doesn't provide real-time SQL querying, and violates the "minimal custom code" constraint.
- D is Incorrect: Converting unstructured PDFs into SQL rows via entity extraction loses the semantic context of the policy documents and requires heavy custom ETL.

> Exam Tip: For turnkey enterprise assistants that need pre-built connectors to structured and unstructured data with zero code, Amazon Q Business is the preferred choice over Bedrock Knowledge Bases.
### Question 5 - Vector Store Selection for Compliance

An enterprise is using Amazon Bedrock Knowledge Bases to ingest highly sensitive customer data. Security policies mandate that the vector store used must support network isolation via VPC endpoints and allow the use of customer-managed KMS keys. The team wants to use a fully managed vector store natively supported by Bedrock.

Which vector store should they choose for the Bedrock Knowledge Base? (Select ONE)

- A) Amazon RDS for PostgreSQL with the pgvector extension
- B) Pinecone (External SaaS vector database)
- C) Amazon OpenSearch Serverless
- D) Amazon DynamoDB
Correct Answer: C

Correct Answer Analysis:
Amazon OpenSearch Serverless is a natively supported vector store for Bedrock Knowledge Bases. It supports network isolation via VPC endpoints and allows encryption at rest using customer-managed KMS keys, satisfying all security and compliance constraints.

Distractor Analysis:
- A is Incorrect: While RDS for PostgreSQL is supported by Bedrock KBs, it requires managing database instances and does not offer the same serverless, auto-scaling VPC endpoint isolation out-of-the-box as OpenSearch Serverless.
- B is Incorrect: Pinecone is an external SaaS solution and does not natively run inside the customer's VPC, making VPC endpoint isolation impossible without complex networking setups.
- D is Incorrect: Amazon DynamoDB is not supported as a native vector store backend for Amazon Bedrock Knowledge Bases.

> Exam Tip: Amazon OpenSearch Serverless is the go-to vector store for Bedrock KBs when strict enterprise security (VPC isolation, KMS CMK) is required.
### Question 6 - Data Freshness vs. Customization

A company's internal HR Q&A application uses Amazon Bedrock Knowledge Bases. The HR policies were recently updated, and the changes must be reflected in the assistant's answers within 10 minutes. The team wants to avoid any model retraining or heavy compute jobs.

How can the engineer update the knowledge base to reflect the new policies with the least operational overhead? (Select ONE)

- A) Fine-tune the underlying foundation model on the newly updated HR policies.
- B) Manually compute the vector embeddings for the changed documents using an AWS Lambda function and update the OpenSearch index.
- C) Trigger a new ingestion job (StartIngestionJob) in Amazon Bedrock Knowledge Bases after updating the documents in the S3 data source.
- D) Delete the existing OpenSearch Serverless collection and recreate it with the new policies.
Correct Answer: C

Correct Answer Analysis:
In a RAG architecture, content lives outside the model weights. To update the knowledge, you simply update the source files in S3 and trigger a new ingestion job in Bedrock Knowledge Bases. The service will automatically re-embed the updated documents and sync the vector index within minutes.

Distractor Analysis:
- A is Incorrect: Fine-tuning bakes knowledge into the model weights, which takes hours, is expensive, and is completely unnecessary for updating factual content in a RAG system.
- B is Incorrect: Writing a custom Lambda function to compute embeddings violates the "least operational overhead" constraint, as Bedrock KB handles this automatically.
- D is Incorrect: Deleting and recreating the entire collection is an anti-pattern that causes downtime and unnecessary re-processing of unchanged documents.

> Exam Tip: RAG allows near real-time knowledge updates by simply re-ingesting the source documents, avoiding the heavy compute of model retraining.
### Question 7 - Addressing Tone and Style Gaps

A machine learning engineer is designing an AI assistant. The foundation model already possesses strong general reasoning capabilities, but it consistently uses a casual tone. The company requires the model to strictly adhere to a formal corporate tone. Prompt engineering and few-shot examples have been tried but fail to consistently enforce the tone across all interactions.

Which approach is the MOST appropriate next step? (Select ONE)

- A) Use Amazon Bedrock Knowledge Bases to retrieve examples of formal tone.
- B) Fine-tune the foundation model on a dataset of prompt-response pairs that demonstrate the formal corporate tone.
- C) Apply Amazon Bedrock Guardrails to automatically rewrite the model's output into a formal tone.
- D) Switch to a smaller, less capable foundation model that is easier to control.
Correct Answer: B

Correct Answer Analysis:
The standard progression for adapting FM behavior is: Prompt Engineering -> Fine-Tuning. When prompt instructions and few-shot examples consistently fail to enforce a specific style, tone, or formatting requirement, supervised fine-tuning on labeled examples is the correct approach to update the model's internal weights.

Distractor Analysis:
- A is Incorrect: RAG is for retrieving external factual knowledge, not for modifying the model's inherent generative tone or style.
- C is Incorrect: Bedrock Guardrails are designed for blocking harmful content, filtering PII, and checking contextual grounding; they do not rewrite the stylistic tone of the output.
- D is Incorrect: Smaller models generally have weaker instruction-following capabilities, making tone control even harder, not easier.

> Exam Tip: Use RAG for external facts; use Fine-tuning for consistent style, tone, or formatting behavior that prompting alone cannot fix.
### Question 8 - Data Privacy and Redaction in RAG

A healthcare startup is building a medical chatbot using Amazon Bedrock. They are retrieving patient education leaflets using Bedrock Knowledge Bases. To comply with privacy regulations, they must ensure that Protected Health Information (PHI) inadvertently included in the user's prompt or the retrieved context is redacted before the foundation model generates a response.

Which AWS feature should they implement to fulfill this requirement? (Select ONE)

- A) Use Amazon Bedrock Guardrails to configure a sensitive information filter (PII redaction) on the user input and model output.
- B) Train a custom Named Entity Recognition (NER) model on Amazon SageMaker AI to redact PHI.
- C) Use Amazon Macie to scan the S3 bucket containing the PDFs and mask the data before ingestion.
- D) Enable AWS Shield Advanced to inspect the payload between the vector store and the Bedrock endpoint.
Correct Answer: A

Correct Answer Analysis:
Amazon Bedrock Guardrails includes a Sensitive Information Filter (PII redaction) that can automatically detect and mask/redact PII or PHI in the user input, retrieved context, and model output. This is a native, managed feature that satisfies the compliance constraint.

Distractor Analysis:
- B is Incorrect: Training a custom NER model on SageMaker introduces high operational overhead and custom integration logic, which is unnecessary given Bedrock's native Guardrails.
- C is Incorrect: Amazon Macie scans S3 buckets at rest for data classification, but it does not dynamically redact text in real-time prompts or generative outputs.
- D is Incorrect: AWS Shield Advanced is a DDoS protection service, not a data privacy or content redaction tool.

> Exam Tip: For real-time PII/PHI redaction in GenAI applications, use Amazon Bedrock Guardrails' Sensitive Information Filter rather than building custom NLP pipelines.
### Question 9 - Hybrid Search Architecture

A news aggregation company wants to build a semantic search engine over millions of articles. Users often search for concepts (e.g., "economic downturn") rather than exact keywords. However, the system must still allow exact keyword matching for specific proper nouns (e.g., "Inflation Reduction Act"). The team is using Amazon OpenSearch Service as their vector store.

Which retrieval pattern should they implement? (Select ONE)

- A) Use sparse vector embeddings exclusively to capture exact keyword frequencies.
- B) Use dense vector embeddings exclusively to capture semantic meaning.
- C) Use a hybrid search approach, combining dense vector embeddings for semantic meaning and keyword search (BM25) for exact matches.
- D) Use Amazon Comprehend to extract key phrases and search using only the extracted phrases.
Correct Answer: C

Correct Answer Analysis:
Hybrid search combines dense vector embeddings (which capture semantic meaning like "economic downturn") with traditional keyword search like BM25 (which excels at exact proper noun matches like "Inflation Reduction Act"). OpenSearch natively supports hybrid search queries.

Distractor Analysis:
- A is Incorrect: Sparse vectors (like SPLADE) or pure keyword search cannot capture the semantic meaning of a concept like "economic downturn."
- B is Incorrect: Dense vectors alone often struggle with exact matches for specific proper nouns or unique identifiers.
- D is Incorrect: Using Amazon Comprehend for key phrase extraction adds unnecessary latency and compute overhead; OpenSearch's hybrid query handles this natively at query time.

> Exam Tip: When a use case requires both conceptual semantic matching AND exact keyword matching, use Hybrid Search (Dense Vectors + BM25).
### Question 10 - Embedding Model Selection for Latency

A mobile application developer is building an offline-first RAG system using a smaller foundation model. The embeddings must be generated via a highly latency-sensitive API endpoint. The developer wants to use the most lightweight model available in Amazon Bedrock for embedding generation to reduce cost and latency, while still maintaining good semantic search quality for short text queries.

Which Amazon Bedrock embedding model is MOST appropriate? (Select ONE)

- A) Titan Multimodal Embeddings G1
- B) Titan Text Embeddings v2 (configurable to lower dimensions)
- C) Anthropic Claude 3 Haiku
- D) Cohere Command R+
Correct Answer: B

Correct Answer Analysis:
Amazon Titan Text Embeddings v2 is specifically optimized for text embeddings and allows configuration of vector dimensions. Lowering the dimension size (e.g., to 256 or 512) drastically reduces storage costs in the vector database and improves nearest-neighbor search latency, making it ideal for latency-sensitive applications.

Distractor Analysis:
- A is Incorrect: Titan Multimodal Embeddings G1 is designed for both text and images. If the use case is strictly text, this model introduces unnecessary overhead and larger default dimensions.
- C is Incorrect: Anthropic Claude 3 Haiku is a text generation LLM, not an embedding model. It cannot be used to generate vector embeddings for a vector database.
- D is Incorrect: Cohere Command R+ is a text generation LLM, not an embedding model.

> Exam Tip: Choose the right model type for the job: LLMs (Claude, Command) for generation, Embedding models (Titan Text Embeddings) for vectorization. Use Titan v2 for configurable dimension sizes to optimize latency.