AWS Bedrock Practical Guide for Beginners
Learn how Amazon Bedrock provides managed access to foundation models and helps teams build RAG applications, agents, guarded AI experiences, reusable prompts, workflows, and production AI systems inside AWS.
What you will learn
30-second explanation
Amazon Bedrock is the AWS platform around foundation models and generative AI applications.
It gives applications managed model inference plus capabilities for enterprise knowledge, agents, safety controls, prompt lifecycle, workflows, and evaluation—while integrating with AWS identity, data, networking, logging, and deployment patterns.
Understand
Bedrock is more than a model endpoint
The model produces intelligent output. Bedrock provides managed platform capabilities around that model so teams can integrate it into complete AWS applications.
Your application
User experience and business logic
Amazon Bedrock Platform Core
Models
Generate and understand
Knowledge
Retrieve enterprise facts
Agents
Use tools and workflows
Guardrails
Apply configured safeguards
Compare
Bedrock vs hosting a model yourself
Self-managed model infrastructure
- • Provision and operate inference infrastructure
- • Select instance types and scaling strategy
- • Deploy and upgrade serving software
- • Manage availability and capacity
- • Monitor GPU or accelerator utilisation
- • Own more of the complete model-serving stack
Amazon Bedrock
- ✓ Call supported models using managed AWS APIs
- ✓ Avoid operating the underlying model servers
- ✓ Integrate inference with AWS applications
- ✓ Use managed RAG, safety, prompt, and workflow features
- ✓ Apply IAM permissions to Bedrock operations
- ✓ Focus more engineering effort on the application
Platform map
Core Amazon Bedrock capabilities
Expand each layer to understand which problem it solves.
IntelligenceFoundation models+
Access supported text, image, embedding, and multimodal models through AWS-managed APIs.
Example
Choose a model for summarisation, coding, extraction, chat, embeddings, or multimodal analysis.
RuntimeModel inference+
Send prompts and messages to a model using operations such as Converse, ConverseStream, or model-specific inference APIs.
Example
Call a text model from Lambda, ECS, EKS, EC2, or a backend application.
Enterprise knowledgeKnowledge Bases+
Retrieve relevant information from approved data sources and use it to ground model responses.
Example
Answer an employee question using the latest approved HR policies.
Agentic systemsAgentCore+
Build, deploy, secure, operate, and observe agents that use models, tools, memory, identity, and enterprise services.
Example
Deploy a support agent that retrieves knowledge, calls approved APIs, and escalates difficult cases.
SafetyGuardrails+
Apply configurable checks to user inputs and model outputs to support consistent safety and privacy controls.
Example
Block prohibited content, detect sensitive information, and reduce prompt-attack risk.
Prompt lifecyclePrompt Management+
Create reusable prompts, variables, model configurations, variants, and versions for controlled application use.
Example
Version the production prompt used by a customer-support assistant.
OrchestrationBedrock Flows+
Connect prompts, models, Knowledge Bases, conditions, Lambda functions, and other nodes into managed workflows.
Example
Retrieve a policy, classify the request, call a Lambda function, and generate a final response.
QualityEvaluation+
Evaluate model behaviour, retrieval quality, generated responses, and RAG performance using representative datasets.
Example
Compare two models on accuracy, helpfulness, robustness, latency, and cost.
SDK clients
Bedrock client vs Bedrock Runtime client
bedrock
Control-plane operations
client = boto3.client("bedrock")- • Discover and inspect foundation models
- • Manage selected Bedrock resources
- • Perform administrative operations
- • Not normally used for the actual chat response
bedrock-runtime
Inference operations
client = boto3.client("bedrock-runtime")- ✓ Invoke supported foundation models
- ✓ Use Converse and ConverseStream
- ✓ Send prompts, messages, and inference settings
- ✓ Receive generated model output
Inference flow
How a Bedrock request works
Authenticate
The application uses an AWS identity with permission to invoke the selected Bedrock resource.
Select
Choose a model or inference profile that supports the workload and required Region.
Construct
Build system instructions, user messages, inference settings, and optional guardrail configuration.
Invoke
Send the request through Bedrock Runtime using Converse or another supported inference operation.
Validate
Inspect the response, stop reason, usage information, errors, and application-specific quality checks.
Observe
Track latency, token usage, failures, quality, cost, and business outcomes.
Python example
Call Amazon Bedrock using boto3
The example uses environment variables for the Region and model ID so you can choose a model currently available for your AWS account and location.
python -m venv .venv
source .venv/bin/activate
pip install --upgrade boto3Configure AWS credentials using an approved AWS profile, role, workload identity, or other standard credential mechanism. Do not place long-term credentials directly in source code.
export AWS_REGION="eu-west-1"
export BEDROCK_MODEL_ID="your-supported-model-or-inference-profile-id"
# Optional when using a named local AWS profile:
export AWS_PROFILE="your-profile-name"import os
import boto3
from botocore.exceptions import BotoCoreError, ClientError
AWS_REGION = os.getenv("AWS_REGION", "us-east-1")
MODEL_ID = os.environ["BEDROCK_MODEL_ID"]
client = boto3.client(
"bedrock-runtime",
region_name=AWS_REGION,
)
def ask_bedrock(question: str) -> str:
"""Send one question to a Bedrock model using Converse."""
cleaned_question = question.strip()
if not cleaned_question:
raise ValueError("question cannot be empty")
try:
response = client.converse(
modelId=MODEL_ID,
system=[
{
"text": (
"You are a practical AWS assistant. "
"Give clear, accurate, concise answers. "
"State when important information is missing."
)
}
],
messages=[
{
"role": "user",
"content": [
{
"text": cleaned_question,
}
],
}
],
inferenceConfig={
"maxTokens": 500,
"temperature": 0.2,
},
)
except ClientError as exc:
error = exc.response.get("Error", {})
code = error.get("Code", "UnknownError")
message = error.get("Message", str(exc))
raise RuntimeError(
f"Amazon Bedrock request failed: {code}: {message}"
) from exc
except BotoCoreError as exc:
raise RuntimeError(
f"AWS SDK request failed: {exc}"
) from exc
content = response["output"]["message"]["content"]
text_blocks = [
block["text"]
for block in content
if "text" in block
]
if not text_blocks:
raise RuntimeError(
"Amazon Bedrock returned no text content"
)
return "\n".join(text_blocks)
if __name__ == "__main__":
answer = ask_bedrock(
"Explain Amazon Bedrock in simple terms."
)
print(answer)Code breakdown
What each part does
MODEL_ID
Selects the model or inference profile used for the request.
system
Defines persistent behaviour and response expectations for this interaction.
messages
Contains the conversational input sent to the model.
inferenceConfig
Controls supported generation settings such as output length and temperature.
response output
Contains the model’s generated message and content blocks.
error handling
Converts AWS SDK and service failures into clear application-level errors.
Model selection
Do not choose a model by popularity alone
The best model is the one that meets your workload’s quality, latency, cost, modality, Region, and governance requirements.
Task quality
Test the model using representative prompts from the real workload rather than relying on a general benchmark.
Modality
Confirm whether the workload requires text, images, video, audio, embeddings, or multiple modalities.
Region
Check whether the model and required inference option are available in an acceptable AWS Region or geography.
Latency
Measure both time to first output and total response time under realistic load.
Cost
Consider input, output, retrieval, guardrail, reranking, storage, and surrounding infrastructure costs.
Context
Verify that the model can process the required prompt, conversation history, and retrieved knowledge.
Governance
Review access controls, contractual requirements, data location, logging, and operational ownership.
Lifecycle
Monitor model status and plan for upgrades, regression testing, and possible end-of-life transitions.
Knowledge Bases
Connect models to enterprise knowledge
A Knowledge Base prepares approved data for retrieval and supplies relevant evidence to a model when a user asks a question.
Ingestion pipeline
↓
Parse and clean
↓
Split into chunks
↓
Create embeddings
↓
Store vectors and metadata
↓
Bedrock Knowledge Base
Query pipeline
↓
Knowledge Base retrieval
↓
Relevant source chunks
↓
Prompt and foundation model
↓
Grounded response and sources
Chunk carefully
Preserve useful document boundaries and meaning.
Store metadata
Include source, version, date, language, and permissions.
Filter access
Retrieve only information the current user may see.
Evaluate retrieval
Confirm the required evidence appears in the candidates.
Agentic AI
Where Amazon Bedrock AgentCore fits
AgentCore provides modular capabilities for deploying and operating agents that use models, tools, memory, identity, policy, secure runtime environments, and production observability.
User goal
Requested outcome
Agent
Plans next step
Identity
Authenticates access
Policy
Checks authority
Tools
Use APIs and data
Runtime
Executes agent
Observability
Trace and monitor
AgentCore does not require one specific agent framework or model.
Teams can bring their preferred orchestration approach while using selected AgentCore capabilities for runtime, tools, memory, identity, policy, and observability.
Safety layer
How Bedrock Guardrails fits
Guardrails can evaluate both the information entering an AI workflow and the response produced by the model.
User input
Prompt and context
Input checks
Evaluate configured risks
Model
Generate response
Output checks
Evaluate generated content
Application
Return, block, or handle
Prompt lifecycle
Prompt Management
Production prompts should be treated like versioned application assets rather than text copied between files.
Create
Define the prompt
Variables
Add reusable inputs
Configure
Choose model settings
Test
Compare variants
Version
Preserve approved state
Use
Integrate into workflow
Workflow orchestration
Amazon Bedrock Flows
Flows allows teams to connect supported Bedrock and AWS components into a defined execution path.
Input
Receive request
Prompt
Construct instruction
Knowledge
Retrieve context
Condition
Choose path
Lambda
Run application logic
Model
Generate result
Output
Return response
Evaluation
Evaluate before changing prompts or models
Build a representative dataset and compare behaviour using repeatable criteria rather than personal impressions.
Dataset
Representative tasks
Resource
Model or RAG system
Results
Generated outputs
Metrics
Quality and performance
Decision
Compare and improve
Correctness
Does the result reach the expected conclusion?
Groundedness
Are claims supported by supplied evidence?
Robustness
Does quality remain stable when wording changes?
Efficiency
Are latency and cost acceptable for the value?
Enterprise architecture
A production Bedrock application
Bedrock normally sits inside a larger AWS architecture containing authentication, application compute, data access, monitoring, and response validation.
User
Web or application
Identity
Authenticate and authorise
Application
Lambda, ECS, or EKS
Bedrock
Models and AI services
Knowledge
S3, search, or database
Validation
Check and control
Observability
Logs, metrics, and traces
IAM
Grant only the minimum Bedrock, data-source, logging, encryption, and tool permissions required.
Application identity
Authenticate the person or service making the request and preserve that identity through the workflow.
Data permissions
Filter retrieved documents and tool access using the requesting user’s authorised scope.
Encryption
Protect data in transit and at rest using appropriate AWS-managed or customer-managed controls.
Guardrails
Evaluate inputs and outputs for configured safety, privacy, sensitive-data, and content requirements.
Validation
Treat generated text and proposed tool arguments as untrusted until the application validates them.
Auditability
Record model requests, retrieval decisions, tool calls, approvals, failures, and important outcomes.
Human approval
Require confirmation before financial, destructive, external, or legally important actions.
Cost and performance
Measure the whole workflow
Optimise
- ✓ Use the smallest model that meets quality requirements
- ✓ Retrieve only relevant knowledge
- ✓ Control prompt and output size
- ✓ Cache stable reusable results where appropriate
- ✓ Limit agent steps and retries
- ✓ Measure cost by business workflow
Include every layer
- • Input and output inference
- • Embeddings and vector storage
- • Retrieval and reranking
- • Guardrail checks
- • Agent tool calls and repeated rounds
- • Application compute, networking, and logs
Platform decision
Direct model API vs Amazon Bedrock
| Decision area | Direct provider API | Amazon Bedrock |
|---|---|---|
| Initial setup | Often faster for a small provider-specific prototype | Requires AWS identity, permissions, Region, and service configuration |
| Model access | Models offered by that provider | Multiple supported model families through AWS |
| Authentication | Provider API credentials | AWS IAM, roles, policies, and related controls |
| AWS integration | Custom integration is usually required | Fits naturally with AWS applications and services |
| RAG | Build it yourself or use provider-specific services | Knowledge Bases and AWS-native data integrations are available |
| Agents | Use provider SDKs or your own orchestration | Use AgentCore or your preferred agent framework on AWS |
| Prompt lifecycle | Usually managed inside application code or external tooling | Prompt Management supports reusable, testable, versioned prompts |
| Best fit | Focused products and rapid experiments | AWS-centred applications requiring managed enterprise capabilities |
Bedrock is a strong fit when
- ✓ Your organisation already operates heavily on AWS.
- ✓ IAM and AWS governance are important requirements.
- ✓ You want access to supported model families through AWS.
- ✓ The application needs managed RAG capabilities.
- ✓ Agents must integrate with AWS and enterprise services.
- ✓ You need a production platform rather than only a chat demo.
Consider a simpler start when
- • You only need a temporary personal experiment.
- • Your team has no AWS environment or expertise.
- • A consumer AI product already solves the requirement.
- • One direct API meets the full application need.
- • Cloud architecture would add more work than value.
- • You have not yet validated the business use case.
Use cases
Enterprise applications built with Bedrock
Internal knowledge assistant
Answer employee questions using approved policies, procedures, architecture documents, and internal knowledge.
Customer-support copilot
Retrieve product guidance and customer context, recommend a resolution, and prepare a response for review.
Document intelligence
Extract, classify, summarise, compare, and validate contracts, reports, claims, forms, and technical documents.
Software-engineering assistant
Explain code, review changes, generate tests, summarise incidents, and retrieve internal engineering standards.
Risk and compliance assistant
Retrieve controls and regulations, analyse evidence, identify gaps, and prepare traceable summaries.
Agentic workflow
Combine models, tools, memory, APIs, identity, policy, and observability to execute controlled multi-step work.
Avoid
Common Amazon Bedrock mistakes
Choosing the model first
Define the business outcome, quality criteria, data, latency, and operating constraints before selecting a model.
Hard-coding one model ID
Model availability, lifecycle, and regional support change. Keep model selection configurable and regression-tested.
Ignoring IAM design
A successful model call does not prove that the production permission model is safe or maintainable.
Treating Guardrails as complete security
Guardrails complement IAM, data permissions, application validation, encryption, and human controls; they do not replace them.
Building RAG without evaluation
A visually convincing answer does not prove that the system retrieved the correct evidence consistently.
No cost controls
Large prompts, long outputs, retrieval, reranking, repeated agent steps, and retries can increase cost quickly.
No failure strategy
Production systems need timeouts, retries, fallback behaviour, abstention, escalation, and clear user messaging.
Assuming managed means finished
Bedrock manages important platform capabilities, but your team still owns application quality, architecture, data, security, and operations.
Production checklist
Before launching a Bedrock application
AI for Real Work
Bedrock manages the AI platform. You still design the system.
Successful enterprise AI requires much more than sending a prompt to a capable model. It requires controlled data access, reliable retrieval, safe tools, evaluation, IAM, monitoring, cost ownership, and clear human accountability.
Select
Choose the right model
Ground
Use approved knowledge
Control
Apply identity and policy
Evaluate
Measure real quality
Operate
Monitor cost and reliability
Key takeaway
Amazon Bedrock is not the intelligence itself. It is the AWS platform around the intelligence.
It gives AWS applications managed access to supported foundation models and provides capabilities for knowledge retrieval, agents, guardrails, reusable prompts, workflows, and evaluation.
Remember the production pattern:
Authenticate → select the model → provide trusted context → invoke Bedrock → validate the output → monitor quality, cost, and reliability.
Continue learning
Build complete AI systems on AWS
Knowledge
RAG Explained
Learn chunking, embeddings, retrieval, reranking, permissions, citations, and production RAG architecture.
Agents
Build Your First AI Agent
Build a controlled Python agent using models, tools, validation, memory, and an execution loop.
Prompting
Prompt Engineering for Real Work
Design practical instructions, context, constraints, formats, and evaluation criteria.