
๐ Domain 1: From Foundation Models to RAG
Prepare for AIP-C01 Domain 1 with notes on model selection, data pipelines, vector stores, RAG, prompts, and compliance.
Series: Come Prepare with Me: AWS Certified Generative AI Developer โ Professional (4 articles)
- 2๐ Domain 1: From Foundation Models to RAG This article
๐ Domain 1: From Foundation Models to RAG
An employee asks your AI assistant:
โWhat is the remote work policy for California employees?โ
A useful answer requires more than a good model. The assistant needs the correct policy, its latest version, the right retrieval process, and permission to show that information.
That is where Domain 1: Foundation Model Integration, Data Management, and Compliance comes in.
This domain accounts for 31% of the scored content in the AWS Certified Generative AI Developer โ Professional (AIP-C01) exam.
In this article, weโll cover the theory. In the next, weโll build our Company Policy RAG Assistant and apply the concepts. ๐ ๏ธ
๐บ๏ธ Our Domain 1 Roadmap
Task | What we need to understand |
|---|---|
1.1 โ Solution design | Requirements, architecture, proof of concept, reusable components |
1.2 โ Foundation models | Selection, configuration, integration, resilience, customization |
1.3 โ Data preparation | Validation, processing, input formatting, quality improvement |
1.4 โ Vector stores | Architecture, metadata, scaling, source integration, maintenance |
1.5 โ Retrieval | Chunking, embeddings, search, reranking, query handling |
1.6 โ Prompts | Instructions, conversation context, governance, testing, workflows |
๐๏ธ 1. Start with Requirements, Not Services
Before choosing a model, define what the application must achieve.
For our policy assistant, we need to know:
- Business outcome: What problem are we solving, and how will we measure value?
- Users and permissions: Who can ask questions, and which documents can they access?
- Data: What sources, formats, languages, and update frequencies are involved?
- Quality: What counts as a correct, useful, and properly sourced answer?
- Constraints: What are the latency, cost, availability, and compliance requirements?
Validate the Idea with a POC
A proof of concept (POC) tests feasibility with a small implementation.
Start with sample documents and representative questions. Compare answer quality, response time, retrieval performance, and cost before committing to a larger architecture.
Create reusable components for model access, authentication, logging, and deployment. Use the AWS Well-Architected Framework and Generative AI Lens to review design decisions.
๐ก Exam note: When a scenario asks for the best architecture, identify its requirements and constraints before selecting services.
๐ง 2. Select and Configure Foundation Models
A foundation model (FM) is trained on broad data and can support different tasks. A large language model (LLM) is a type of foundation model focused on language.
Inference means sending input to a model and receiving its output.
Model Selection Checklist
Evaluate candidates using the same representative examples.
Consideration | What to check |
|---|---|
Capability | Summarization, classification, reasoning, code, or other required tasks |
Modality | Supported text, image, audio, or other inputs and outputs |
Quality | Accuracy, relevance, consistency, and known limitations |
Performance | Response time and expected request volume |
Cost | Input/output usage and the selected deployment approach |
Context | Input capacity, conversation history, retrieved context, and output limits |
Availability | Region, access requirements, and supported features |
Compliance | Data handling, processing location, and organizational requirements |
A larger context window means a model can accept more information; it does not guarantee better answers.
Inference Settings
Setting | Meaning |
|---|---|
Temperature | Influences randomness and response variation |
Top P | Influences the set of likely tokens considered |
Maximum output tokens | Caps the generated response length |
Stop sequences | Stop supported models when specified text is generated |
A token is a unit processed by a model, not necessarily a complete word. Supported parameters and their behavior vary by model.
๐ก Exam note: Lower temperature can improve consistency, but it does not eliminate hallucinations.
Integration and Model Switching
Amazon Bedrock provides managed access to foundation models. Amazon SageMaker AI supports scenarios that need greater control over model deployment and serving.
For supported Bedrock models:
- Converse: Provides a consistent message interface.
- ConverseStream: Streams a response.
- InvokeModel: Uses the selected modelโs request format.
Keep model selection in configuration where practical. AWS AppConfig, Lambda, and API Gateway can support configurable access patterns. A shared API simplifies switching, but model capabilities still need validation.
Resilience
Design for throttling, timeouts, and service disruptions:
- Retry transient failures with backoff and jitter.
- Set timeouts and use circuit breakers to avoid repeated failing calls.
- Use a tested fallback model when requirements allow.
- Degrade gracefullyโfor example, show retrieved passages if generation fails.
- Consider supported cross-Region inference or deployments where data-location rules permit.
Customization and Lifecycle
Approach | Main purpose |
|---|---|
Prompt engineering | Improve instructions and examples |
RAG | Supply relevant external information at request time |
Fine-tuning | Adapt a supported modelโs task performance or behavior |
LoRA/adapters | Adapt a subset of parameters rather than updating the entire model |
Customization also requires versioning, evaluation, approval, deployment, rollback, and eventual retirement. Understand the role of deployment pipelines and tools such as SageMaker Model Registry.
๐ก Exam note: Frequently changing policies usually point toward retrieval and synchronization. Fine-tuning is not a substitute for a current document repository.
๐งน 3. Validate and Process Data
A model cannot reliably compensate for missing, corrupted, outdated, or poorly formatted input.
Check:
- Required fields, supported formats, and readable content.
- Completeness, consistency, duplicates, and document versions.
- Sensitive information and access classification.
- Input-size limits and model-specific requirements.
Processing Different Data Types
Input | Example preparation |
|---|---|
Text | Extract content, normalize formatting, remove duplication |
Scanned documents | Use OCR or an appropriate parser |
Images | Prepare supported formats for a multimodal model |
Audio | Transcribe or use a model that supports the required audio task |
Tables | Preserve headers and relationships between values |
Relevant tools include AWS Glue Data Quality, SageMaker Data Wrangler, SageMaker Processing, Amazon Transcribe, Amazon Comprehend, and custom Lambda functions.
Format API requests correctly: JSON structure, message roles, content blocks, and endpoint schemas matter. Use quality metrics and monitoring to identify rejected records or processing failures.
๐ก Exam note: If ingestion succeeds but answers are poor, inspect parsing and data quality before changing the generation model.
๐๏ธ 4. Design the Vector Store
An embedding represents content as a numerical vector. A vector search system compares these representations to find related content.
For example, โwork from homeโ and โremote workโ can be related even without identical wording.
A retrieval system typically stores:
- The embedding.
- The associated content or a reference to it.
- Metadata and source identifiers.
Choosing an Architecture
Options include Amazon OpenSearch Service, OpenSearch Serverless, and Aurora PostgreSQL with pgvector, depending on supported integrations and requirements.
Consider vector dimensions, filtering, scale, latency, operational overhead, existing infrastructure, and cost. A source repository such as S3, a metadata database, and a vector index may play different roles in one architecture.
Metadata and Source Integration
Useful metadata includes document title, author, department, Region, effective date, version, and source location.
It supports filtering, traceability, and citations. Connect approved repositories, internal wikis, or document systems through supported connectors or custom ingestion components.
Metadata must be ingested and mapped into searchable fields; adding an S3 tag alone does not automatically make it a retrieval filter.
Scaling and Maintenance
At scale, understand sharding, specialized indexes, domain-based separation, and hierarchical organization.
Keep the store current using incremental updates, change detection, scheduled refreshes, and deletion handling. Monitor synchronization failures and preserve links to source versions.
๐ก Exam note: A source-document update does not automatically mean its indexed representation has been refreshed.
๐ 5. Design Effective Retrieval
Retrieval Augmented Generation (RAG) supplies retrieved information to a model when generating an answer.
There are two main workflows:
Ingestion: Parse documents โ Create chunks โ Generate embeddings โ Store and index.
Question answering: Process question โ Retrieve passages โ Filter/rerank โ Build prompt โ Generate answer with source references.
Amazon Bedrock Knowledge Bases manages many parts of this workflow. RAG does not retrain the generation model, and it does not guarantee correctness.
Chunking
Strategy | How it works |
|---|---|
Fixed-size | Splits using a target size, often with overlap |
Hierarchical | Uses smaller child chunks and larger parent context |
Semantic | Splits around changes in meaning |
Structure-aware/custom | Uses headings, sections, or application-specific boundaries |
Small chunks may lose context; large chunks may add noise. Overlap preserves boundary information but can increase duplication.
Embedding Selection
Compare language and domain fit, supported content, dimensions, input limits, quality, latency, and cost. Amazon Titan Embeddings is one option.
Document and query embeddings must be compatible. Changing the model or dimensions may require re-embedding and rebuilding the index. Batch processing can improve ingestion efficiency, with appropriate rate-limit handling.
Search and Ranking
Technique | Best understood as |
|---|---|
Keyword search | Matching exact terms, identifiers, or error codes |
Semantic search | Matching meaning |
Hybrid search | Combining keyword and semantic approaches |
Metadata filtering | Restricting results using document attributes |
Reranking | Reordering retrieved candidates by relevance |
Tune the number of retrieved results and the final context size. More results can increase recall, but also add irrelevant content, latency, and cost.
Query Handling and Access
- Rewriting: Clarify the search wording.
- Expansion: Add related terms.
- Decomposition: Break a complex question into smaller searches.
- Clarification: Ask the user when ambiguity affects the answer.
Expose retrieval through a consistent API, tool/function interface, or supported Model Context Protocol (MCP) integration. Enforce authorization before content reaches the model.
๐ก Exam note: Diagnose the failing stage. Missing passages suggest retrieval or ingestion issues; correct passages with poor answers suggest prompt or generation issues.
โ๏ธ 6. Engineer and Govern Prompts
A useful prompt defines the role, task, context, constraints, and output format.
For our assistant:
Answer the question using the supplied policy excerpts. If the excerpts do not contain the answer, say that you have insufficient information. Reference the supplied sources.Context: ย{retrieved_context}ยQuestion: ย{user_question}ย
Retrieved documents are information to evaluate, not trusted instructions. Prompt boundaries help, but access controls and other safeguards remain necessary.
Prompting and Conversation Techniques
Technique | Purpose |
|---|---|
Zero-shot | Give instructions without examples |
Few-shot | Demonstrate expected behavior through examples |
Structured output | Request a defined response schema |
Task decomposition/reasoning instructions | Break complex work into manageable steps |
Prompt chaining | Pass results through connected stages |
Feedback loops | Refine prompts using observed failures and evaluations |
The exam guide includes chain-of-thought instruction patterns. Understand the concept of encouraging deliberate problem solving; asking for a modelโs internal reasoning is not proof of correctness. Validate answers, evidence, and intermediate outputs where appropriate.
For follow-up questions, preserve relevant conversation history and session identity. Use clarification workflows when needed, and manage token budgets, retention, and privacy. DynamoDB, Comprehend, and Step Functions can support history, intent recognition, and workflow logic.
Governance and Quality Assurance
Use Amazon Bedrock Prompt Management for reusable templates, variables, variants, and versions. Add organizational approval workflows and controlled deployment.
Test normal requests, missing information, ambiguous input, unsafe instructions, and formatting failures. Validate structured output in application code.
Use:
- CloudTrail for supported API auditing.
- CloudWatch for configured logs, metrics, and alarms.
- Lambda or workflow logic for validation and automated tests.
- Amazon Bedrock Flows for reusable prompt stages, conditions, and processing steps.
- Bedrock Guardrails for supported safety controls.
Logging and regression tests must be configured; monitoring services do not create those tests automatically.
๐ก๏ธ Compliance Across the Design
For every component, consider:
- Least-privilege access and document-level authorization.
- Encryption in transit and at rest.
- Sensitive-data minimization and redaction.
- Processing location and cross-Region routing.
- Source, prompt, conversation, and log retention.
- Auditability and version traceability.
A citation improves traceability; it does not prove that the answer accurately reflects the source.
๐ง Exam Scenario Notes
Scenario clue | What to investigate |
|---|---|
Company knowledge changes frequently | RAG plus reliable synchronization |
Exact identifiers and paraphrased questions both matter | Hybrid search |
Relevant passages rank too low | Reranking |
Retrieval misses surrounding information | Chunking and context strategy |
Answers use obsolete policies | Version filtering, updates, and deletion handling |
Quality drops after an embedding change | Compatibility and re-indexing |
A model provider must be replaceable | Configuration and shared integration interfaces |
Model calls repeatedly fail | Backoff, circuit breakers, fallback, graceful degradation |
Prompts differ across teams | Central templates, versions, review, and regression tests |
Users receive restricted information | Authorization before retrieval/context delivery |
These clues guide investigation; the full scenario determines the best answer.
โ Before Moving to the Project
You should be able to explain how to:
- Turn requirements into an architecture and measurable POC.
- Select, integrate, configure, and manage models.
- Validate and prepare multimodal inputs.
- Design and maintain vector stores and metadata.
- Improve retrieval through chunking, embeddings, search, and query handling.
- Manage prompts, conversations, workflows, and quality checks.
- Apply compliance requirements throughout the solution.
๐ Next: Build the Company Policy RAG Assistant
In the next article, weโll upload sample policies, configure a knowledge base, test questions, inspect retrieved passages and citations, and experiment with metadata filtering.
Weโll also troubleshoot failures and clean up the resources.
The project will demonstrate selected Domain 1 skills. Topics such as custom-model deployment and large-scale index architecture will remain part of our theory preparation.
Letโs turn these notes into a working application! ๐ ๏ธ
๐ AWS References
Series: Come Prepare with Me: AWS Certified Generative AI Developer โ Professional (4 articles)
- 2๐ Domain 1: From Foundation Models to RAG This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article