Day 11: Hands-On Build - RAG App with Guardrails (Part 1)
Learning Objectives
- - Create a Bedrock Knowledge Base with OpenSearch Serverless
- - Configure chunking strategies and compare results
- - Create a Bedrock Guardrail with content filters, PII, denied topics
- - Test retrieval quality via the console
Tasks
Tasks
0/3 completed- Read30m
Bedrock Knowledge Base Tutorial
Step-by-step guide to creating a Knowledge Base in the console.
- Blog25m
Guardrails Content Filters, PII, and Streaming
Follow this as a practical guide for setting up guardrails.
- Hands-on120m
Build: RAG App with Guardrails (Steps 1-5)
1) Create S3 bucket + upload PDF, 2) Create KB with OpenSearch + Titan Embeddings, 3) Configure chunking, 4) Test retrieval, 5) Create Guardrail with content filters, PII, contextual grounding.
Exam Skills
Write your understanding, then reveal the reference answer.
Hands-On Lab
Build real muscle memory with these activities.
Create a Knowledge Base with Different Chunking Strategies
Build the first half of the RAG app by creating the KB and testing chunking options.
- 1 Create an S3 bucket called 'rag-build-data' and upload 3-5 PDF documents
- 2 Create a Bedrock Knowledge Base with OpenSearch Serverless and Titan Embeddings v2
- 3 Set chunking to 'Fixed size' with 300 tokens and 20% overlap
- 4 Sync the data source and test retrieval with 3 queries in the console
- 5 Note the chunk relevance scores for comparison later
Create a Guardrail with Content Filters and PII Detection
Configure a comprehensive Bedrock Guardrail with multiple filter types.
- 1 Open Bedrock → Guardrails → Create guardrail
- 2 Add content filters: set HATE, INSULTS, SEXUAL, VIOLENCE, MISCONDUCT to HIGH strength
- 3 Add PII detection: enable SSN, credit card, email with ANONYMIZE action
- 4 Add a denied topic: 'competitor product comparisons'
- 5 Enable contextual grounding with threshold 0.7 for grounding and 0.5 for relevance
Practice Questions
18 questions across 3 difficulty levels.
Further Reading
Go deeper into today's topics.
Bedrock Knowledge Base Tutorial
Step-by-step guide to creating a Knowledge Base in the Bedrock console.
AI Safety Controls at Scale with Bedrock Guardrails
Production guardrails patterns: content moderation, PII redaction, ApplyGuardrail API.
Build Responsible AI Applications with Guardrails
End-to-end responsible AI: content filters + PII + grounding checks + topic denial in one guardrail.
End-to-End RAG with Bedrock KB and CloudFormation
Automate full RAG deployment: S3 data source, OpenSearch vector store, embedding model, KB creation via IaC.