Current Section

Overview

0%

← Back to Tutorials
AWS · Enterprise AI

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.

Beginner to IntermediateAWS18–22 min readLast reviewed: July 2026

What you will learn

✓What Amazon Bedrock manages and what your application still owns
✓How to call a model using boto3 and the Converse API
✓How Knowledge Bases implement managed RAG workflows
✓Where AgentCore fits into modern agentic applications
✓How Guardrails, Prompt Management, Flows, and evaluation fit
✓How to design IAM, security, monitoring, cost, and production architecture

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.

Model + Knowledge + Tools + Guardrails + IAM + Evaluation + Monitoring = Production AI on AWS

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

S3 and data
Lambda and APIs
IAM and identity
CloudWatch
AWS applications

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
Managed model infrastructure does not remove your responsibility for application security, data permissions, evaluation, cost, reliability, and user experience.

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

01

Authenticate

The application uses an AWS identity with permission to invoke the selected Bedrock resource.

02

Select

Choose a model or inference profile that supports the workload and required Region.

03

Construct

Build system instructions, user messages, inference settings, and optional guardrail configuration.

04

Invoke

Send the request through Bedrock Runtime using Converse or another supported inference operation.

05

Validate

Inspect the response, stop reason, usage information, errors, and application-specific quality checks.

06

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 boto3

Configure 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)
The selected model must support the API and Region you use. Confirm current compatibility in the Bedrock model catalogue before running the example.

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

Documents or supported data sources
↓
Parse and clean
↓
Split into chunks
↓
Create embeddings
↓
Store vectors and metadata
↓
Bedrock Knowledge Base

Query pipeline

User question
↓
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.

Read the complete RAG guide →

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.

Build your first AI agent →

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

Guardrails are one protection layer. They do not replace IAM, user permissions, data filtering, secure tool design, output validation, encryption, monitoring, or human approval.

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 areaDirect provider APIAmazon Bedrock
Initial setupOften faster for a small provider-specific prototypeRequires AWS identity, permissions, Region, and service configuration
Model accessModels offered by that providerMultiple supported model families through AWS
AuthenticationProvider API credentialsAWS IAM, roles, policies, and related controls
AWS integrationCustom integration is usually requiredFits naturally with AWS applications and services
RAGBuild it yourself or use provider-specific servicesKnowledge Bases and AWS-native data integrations are available
AgentsUse provider SDKs or your own orchestrationUse AgentCore or your preferred agent framework on AWS
Prompt lifecycleUsually managed inside application code or external toolingPrompt Management supports reusable, testable, versioned prompts
Best fitFocused products and rapid experimentsAWS-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

✓Define the user, business outcome, and measurable success criteria.
✓Choose the AWS Region and review data-residency requirements.
✓Test several appropriate models using representative evaluation prompts.
✓Keep model IDs, inference profiles, and important settings configurable.
✓Design IAM policies using least privilege.
✓Decide whether the application needs RAG, tools, agents, or a fixed workflow.
✓Apply user and document permissions before content reaches the model.
✓Use Guardrails where they address a defined risk.
✓Validate generated outputs and proposed tool arguments.
✓Add timeouts, retries, iteration limits, and fallback behaviour.
✓Record model usage, latency, errors, retrieval results, and business outcomes.
✓Track cost by application, team, environment, model, and workflow.
✓Create evaluation datasets before changing prompts or models.
✓Deploy through a reviewed infrastructure and software delivery pipeline.

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