Fatskills
Practice. Master. Repeat.
Study Guide: Cloud ML - AWS Certified Machine Learning Engineer – Associate (MLA-C01): Amazon Bedrock (Foundation Models, Knowledge Bases, Agents)
Source: https://www.fatskills.com/hesi/chapter/cloud-ml-cert-aws-ml-amazon-bedrock-foundation-models-knowledge-bases-agents

Cloud ML - AWS Certified Machine Learning Engineer – Associate (MLA-C01): Amazon Bedrock (Foundation Models, Knowledge Bases, Agents)

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~7 min read

AWS_ML – Amazon Bedrock (Foundation Models, Knowledge Bases, Agents)


AWS Certified Machine Learning – Specialty: Amazon Bedrock Study Guide

Topic: Amazon Bedrock (Foundation Models, Knowledge Bases, Agents)


What This Is

Amazon Bedrock is AWS’s fully managed service for building generative AI applications using foundation models (FMs) from leading AI providers (Anthropic, Cohere, Meta, Mistral, Stability AI, and Amazon Titan). It simplifies deploying, fine-tuning, and integrating LLMs into production workflows without managing infrastructure. Real-world scenario: A healthcare startup uses Bedrock to power a HIPAA-compliant patient triage chatbot that retrieves answers from internal medical guidelines (via Knowledge Bases) and routes complex cases to human doctors (via Agents). Bedrock handles model hosting, security, and scaling, while the team focuses on prompt engineering and business logic.


Key Terms & Services

  • Amazon Bedrock: AWS’s managed service for accessing, customizing, and deploying foundation models (FMs) via API. Supports inference, fine-tuning, RAG (Retrieval-Augmented Generation), and Agents.
  • Foundation Models (FMs): Pre-trained large language models (LLMs) or multimodal models (e.g., text-to-image) available in Bedrock (e.g., Claude 3, Titan Text, Jurassic-2, Stable Diffusion XL).
  • Knowledge Bases for Amazon Bedrock: A RAG (Retrieval-Augmented Generation) feature that lets FMs query private data (stored in S3 or vector databases like Aurora PostgreSQL with pgvector) to generate grounded responses.
  • Agents for Amazon Bedrock: Autonomous AI workflows that break down tasks into steps, call APIs (e.g., Lambda, DynamoDB), and use FMs to reason and execute actions (e.g., "Book a flight and update my calendar").
  • Provisioned Throughput: A reserved capacity model for Bedrock inference, offering predictable performance (vs. on-demand pricing). Useful for high-volume, low-latency apps.
  • Fine-Tuning in Bedrock: Customizing an FM (e.g., Titan Text) with your domain-specific data (e.g., legal contracts, medical notes) to improve accuracy without training from scratch.
  • Guardrails for Amazon Bedrock: Content filtering and safety controls to block harmful outputs (e.g., hate speech, PII) or enforce custom policies (e.g., "Never recommend competitors").
  • Model Evaluation: Bedrock’s built-in tools to compare FM performance (e.g., accuracy, latency, cost) across tasks (e.g., summarization, Q&A) before deployment.
  • Prompt Engineering: Crafting inputs to FMs to elicit desired outputs (e.g., using few-shot examples, chain-of-thought reasoning, or structured templates).
  • Vector Embeddings: Numerical representations of text/data (generated by FMs) used for semantic search in Knowledge Bases. Stored in Aurora PostgreSQL (pgvector), OpenSearch, or FAISS.
  • Bedrock Studio: A web-based IDE for prototyping Bedrock applications (e.g., testing prompts, building Agents) without writing code.
  • Bedrock API: The InvokeModel (for inference) and InvokeAgent (for Agents) endpoints, secured via IAM and VPC endpoints.


Step-by-Step / Process Flow


1. Deploying a Foundation Model for Inference

Scenario: Build a customer support chatbot using Claude 3 Haiku (fast, cost-effective).
1. Enable the model in the Bedrock console (select Claude 3 Haiku under "Model access").
2. Configure IAM permissions: Grant your app’s role bedrock:InvokeModel on the model ARN (e.g., arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-haiku-20240307-v1:0).
3. Call the model via API:
python
import boto3
bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
response = bedrock.invoke_model(
modelId="anthropic.claude-3-haiku-20240307-v1:0",
body=json.dumps({
"messages": [{"role": "user", "content": "Summarize this support ticket: ..."}],
"max_tokens": 200
})
)
4. Optimize for cost/latency:
- Use Provisioned Throughput if you need guaranteed performance.
- For low-volume apps, stick to on-demand pricing.


2. Building a Knowledge Base for RAG

Scenario: Create a legal document assistant that answers questions using a firm’s internal case files.
1. Prepare your data:
- Store documents in S3 (e.g., s3://legal-docs/briefs/).
- Ensure files are chunked (e.g., 1,000-token segments) for efficient retrieval.
2. Create a Knowledge Base:
- In the Bedrock console, select Knowledge BasesCreate Knowledge Base.
- Choose a data source (S3) and a vector store (e.g., Aurora PostgreSQL with pgvector or OpenSearch Serverless).
3. Sync data:
- Bedrock automatically ingests, chunks, and embeds your data using the selected FM (e.g., Titan Embeddings).
4. Query the Knowledge Base:
python
response = bedrock.retrieve_and_generate(
input={"text": "What was the ruling in Smith v. Jones (2023)?"},
retrieveAndGenerateConfiguration={
"type": "KNOWLEDGE_BASE",
"knowledgeBaseConfiguration": {
"knowledgeBaseId": "KB12345678",
"modelArn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v1"
}
}
)
5. Monitor performance:
- Use CloudWatch to track latency, token usage, and retrieval accuracy.


3. Creating an Agent for Multi-Step Workflows

Scenario: Build a travel booking Agent that checks flight availability, books hotels, and updates a calendar.
1. Define the Agent:
- In the Bedrock console, select AgentsCreate Agent.
- Choose an FM (e.g., Claude 3 Sonnet) and provide a description (e.g., "Book travel and update calendar").
2. Add Actions:
- Define API integrations (e.g., Lambda functions for flight/hotel APIs, DynamoDB for user preferences).
- Example action:
json
{
"name": "book_flight",
"description": "Books a flight using the Amadeus API",
"apiSchema": {
"type": "awsLambda",
"lambdaArn": "arn:aws:lambda:us-east-1:123456789012:function:book-flight"
}
}
3. Test the Agent:
- Use Bedrock Studio to simulate conversations (e.g., "Book a flight to Paris for next week").
- The Agent will break the task into steps, call APIs, and use the FM to reason.
4. Deploy the Agent:
- Expose it via API Gateway or integrate with Amazon Connect for a call center.


Common Mistakes

Mistake Correction
Assuming all FMs support fine-tuning Only select models (e.g., Titan Text, Jurassic-2) support fine-tuning in Bedrock. Check the model documentation before planning customization.
Using Knowledge Bases without chunking data Large documents (e.g., 100-page PDFs) must be split into smaller chunks (e.g., 1,000 tokens) for efficient retrieval. Use AWS Glue or Lambda to pre-process data.
Ignoring Guardrails for compliance Always enable Guardrails to filter PII, hate speech, or custom terms (e.g., "Never mention competitors"). Test with adversarial prompts (e.g., "How do I hack a system?").
Overlooking Provisioned Throughput for production On-demand inference is cheaper for testing but can suffer from cold starts and throttling. Use Provisioned Throughput for high-volume apps (e.g., chatbots, Agents).
Storing vectors in S3 instead of a vector database S3 is not a vector database—it’s for raw data. Use Aurora PostgreSQL (pgvector), OpenSearch, or FAISS for low-latency similarity searches.


Certification Exam Insights

  1. Service Selection Traps:
  2. Bedrock vs. SageMaker: Bedrock is for generative AI (LLMs, Agents, RAG), while SageMaker is for traditional ML (training, hosting custom models). If the question mentions foundation models, Agents, or Knowledge Bases, pick Bedrock.
  3. Knowledge Bases vs. OpenSearch: Knowledge Bases are managed RAG solutions with built-in embeddings and retrieval. OpenSearch is a search engine—use it if you need custom ranking or hybrid search.

  4. Key Constraints:

  5. Fine-tuning limits: Bedrock fine-tuning requires at least 1,000 examples and supports only specific models (e.g., Titan Text, Jurassic-2).
  6. Agent limitations: Agents can’t modify their own code or learn from interactions (they’re stateless). Use DynamoDB or S3 to persist state.

  7. Tricky Scenarios:

  8. HIPAA/GDPR compliance: Bedrock is HIPAA-eligible and supports VPC endpoints for private connectivity. Use Guardrails to redact PII.
  9. Cost optimization: For low-latency, high-volume apps, use Provisioned Throughput. For sporadic usage, stick to on-demand.

  10. Which Service?:

  11. Need to build a chatbot with private data?Bedrock + Knowledge Bases.
  12. Need to train a custom model from scratch?SageMaker.
  13. Need to deploy a fine-tuned LLM?Bedrock (if supported) or SageMaker.

Quick Check Questions

  1. A fintech company wants to build a chatbot that answers customer questions using internal compliance documents. The solution must be HIPAA-compliant and scale to thousands of users. Which AWS services should they use?
  2. Answer: Amazon Bedrock (Knowledge Bases) + Aurora PostgreSQL (pgvector) + Guardrails.
    Explanation: Bedrock Knowledge Bases provide RAG with private data, Aurora supports HIPAA, and Guardrails enforce compliance.

  3. A startup is prototyping a travel booking Agent that calls external APIs (e.g., Expedia, Google Calendar). They want to minimize infrastructure management. Which AWS service should they use?

  4. Answer: Agents for Amazon Bedrock.
    Explanation: Bedrock Agents handle multi-step workflows, API integrations, and FM reasoning without managing servers.

  5. A data scientist needs to fine-tune an LLM for a legal document classification task. They have 5,000 labeled examples. Which AWS service should they use?

  6. Answer: Amazon Bedrock (if the model supports fine-tuning) or SageMaker (for custom training).
    Explanation: Bedrock supports fine-tuning for select models (e.g., Titan Text), while SageMaker is for full custom training.

Last-Minute Cram Sheet

  1. Bedrock is for generative AI (LLMs, Agents, RAG); SageMaker is for traditional ML.
  2. Knowledge Bases = RAG (retrieval-augmented generation) with private data (S3 + vector DB).
  3. Agents = autonomous workflows that break tasks into steps and call APIs.
  4. Provisioned Throughput = reserved capacity for high-volume, low-latency apps.
  5. Guardrails = content filtering (PII, hate speech, custom terms).
  6. Fine-tuning requires 1,000+ examples and is model-specific (check docs).
  7. Vector stores for RAG: Aurora PostgreSQL (pgvector), OpenSearch, or FAISS.
  8. ⚠️ Bedrock is not for training models from scratch—use SageMaker for that.
  9. ⚠️ Knowledge Bases need chunked data (e.g., 1,000-token segments).
  10. ⚠️ Agents are stateless—persist data in DynamoDB or S3.