Amazon Bedrock Agents: How to Build and Deploy AI Agents

By upGrad

Updated on Oct 06, 2026 | 9 min read | 2.37K+ views

Share:

Key Highlights

  • AWS uses "Bedrock agents" for two services: the original Agents Classic and the newer AgentCore.
  • Classic follows a simple loop where the AI model reads the request and decides what to do, the agent then calls one of your tools or searches your documents, and finally it replies to the user.
  • To set up a Classic agent, you choose a model, write instructions, and connect your tools. Only accounts with recent Bedrock Agents activity can create Classic agents now.
  • AgentCore is built from separate parts you can mix and match, and you pay only for what your agent uses.
  • The harness is the closest match to Classic, while code-defined agents suit custom logic.
  • In this article, you will learn what Amazon Bedrock agents are, how they work, how to build one, their benefits and limits, and which AWS option fits a new project.

Want to build agents on your own? Our agentic AI courses take you from the basics to deploying working AI agents with hands-on projects.

Agentic AI Courses to upskill

Explore Agentic AI Courses for Career Progression

Certification Building AI Agent

360° Career Support

Executive Diploma12 Months

What Are Amazon Bedrock Agents?

Amazon Bedrock agents are AI agents built on AWS that use a foundation model to understand a request, decide what to do, and carry out multi-step tasks through APIs and company data.

These agents not only answer questions but complete the tasks also. For example, a customer types: "Where is my order? Can you move the delivery to Friday?"

Here a basic chatbot can only reply with text, but a Bedrock agent can go further:

  • Understand what the customer is asking for
  • Look up the order in your system
  • Change the delivery date
  • Reply in plain language

All of this happens inside one chat by following these three main parts: 

  • An AI model that reads the request and decides what to do next
  • Instructions that tell the agent what its job is and how to behave
  • Tools and data, such as your APIs for taking actions and your documents for finding answers

AWS uses "Bedrock agents" for two different services. Here is how they differ.

 

Agents Classic

AgentCore

What it is The original service, launched in November 2023 The newer platform for building and running agents
How you build You set up the agent with instructions and settings You use separate building blocks, such as Runtime, Memory, Gateway, and Identity
Flexibility Works inside Bedrock Works with any framework and any model

Bedrock Agents Classic has not been open to new customers since July 30, 2026, and the service is in maintenance mode. Existing Bedrock models, Knowledge Bases, and Guardrails are not affected. 

AWS recommends that you evaluate AgentCore for new agent development, as no new features will be added to Classic. The rest of this guide explains how Classic works, since many teams still run it, and then shows what AgentCore offers and how the two compare.

Amazon Bedrock Agent workflow showing a user request passing through a foundation model and agent orchestration, with instructions, action groups, and a knowledge base supporting the agent before a response is returned.

Also read: AWS Agentic AI: A Beginner’s Guide

How Do Amazon Bedrock Agents Work?

Every agent follows the same loop. A request comes in, the agent does the planning, takes action, and replies. Below is the detailed explanation of how bedrock agents work.

Step 1: User Input

It starts when a user sends a message like "What is the status of order 421?" Your app passes this message to the agent through the InvokeAgent API. Each call is one "turn". Calls that share the same session ID belong to the same conversation, so the agents remember what was said earlier.

An optional pre-processing step can run first. It helps the agent sort the request and can check that the input is valid.

Step 2: Foundation Model

The foundation model is the "brain" of the agent. It is the AI model you choose when you set up the agent, and it does the thinking. When a message comes in, it reads that message together with your instructions and works out what to do next. Sometimes that means calling one of your APIs. Sometimes it means searching a knowledge base, or asking the user for a detail that's missing, like an order number.

This happens in a loop called orchestration. At each round, the model picks the next API call or knowledge base search. It repeats this until it has what it needs.

Step 3: Action Groups

Action groups are the things your agent can do. You define each action in one of two ways:

  1. An OpenAPI schema, which describes each action as an API operation
  2. Function details, a simpler option where you list the details the agent should ask the user for, such as hotel name and length of stay

Step 4: Knowledge Bases

Some questions don't need an action at all. The agent just has to know the answer. For that, you attach a knowledge base, which is a set of your own documents, such as a returns policy or a product manual. The agent searches it when a question needs it.

A shopper who types "can I send back something I bought on sale?" gets an answer taken from your actual policy. The model isn't left to guess from its training data.

Step 5: Response Generation

Here the agent writes the reply. It combines the action results and any knowledge base findings into one clear answer. There is also an optional post-processing step to format the final response. It is turned off by default.

Want to see how the agent reached its answer? Turn on trace. It shows the agent's reasoning step by step, which helps a lot when you are testing.

Also read: What Is AWS Bedrock? How It Works, Uses and Bedrock vs SageMaker

Key Components of Amazon Bedrock Agents

Think of an agent as a small team. Each part has its own job. Some parts are required. Others are optional extras that make the agent safer or smarter.

The core parts that you need to build an agent are:

Component

What it does

Foundation model The AI model that reads requests, plans the steps, and writes replies
Instructions Plain-language rules that tell the agent its job, such as "You are a support agent for an online store"
Action groups The tasks the agent can perform, defined through an OpenAPI schema or function details and run by Lambda functions
Knowledge bases The documents and data the agent can search to find answers

Also read: AWS Architecture Explained: Function, Components, Deployment Models & Advantages

How to Create an Amazon Bedrock Agent

A process to create an Amazon bedrock agents is as follows:

1. Create a Lambda Function

The Lambda function is usually called by an agent to get the date and time. Here are the steps to create one:

  1. Open the Lambda console and choose the Create function.
  2. Select Author from scratch.
  3. Enter a name, such as DateTimeFunction, and choose a Python runtime.
  4. Under permissions, choose Create a new role with basic Lambda permissions.
  5. Choose Create function, then copy the function ARN shown in the overview.
  6. Add code that returns the current date and time. AWS gives sample code in its tutorial. Then choose Deploy.
  7. Add a permission so Bedrock can call the function. Use bedrock.amazonaws.com as the principal, lambda:InvokeFunction as the action, and arn:aws:bedrock:region:account-ID:agent/* as the source ARN.

Don't skip the last step. Without it, the agent can't run your function.

2. Create and Configure an Amazon Bedrock Agent

Now you build the agent itself.

  1. In the Amazon Bedrock console, choose Create agent and give it a name.
  2. For the agent resource role, choose Create and use a new service role. Bedrock sets up the permissions for you.
  3. Select a foundation model. AWS says you can create agents with any foundation model.
  4. Write the instructions, for example: "You are a friendly assistant that tells users the current date and time."
  5. Add an action group and name it, for example TimeActions.
  6. For the action group type, choose Define with API schemas.
  7. For invocation, choose Select an existing Lambda function, then pick the one you just made.
  8. For the schema, choose Define via in-line schema editor and describe your date and time action using an OpenAPI schema.
  9. Review the settings and choose Create.

Last, open the agent's IAM service role from the Permissions section. Check that its permissions point to your Lambda function's ARN.

3. Test the Agent

Time to see if it works.

  1. Open your agent in the Bedrock console and choose Test.
  2. In the Alias dropdown, select TestAlias: Working draft.
  3. Type a question, such as "What time is it?" or "Can you tell me today's date?"
  4. Read the reply. The agent should call your Lambda function and answer in plain language.
  5. Choose Show trace to see the agent's reasoning, including why it chose to call the function.

If you change anything later, choose Prepare again so the agent picks up your changes. AWS says you must do this every time you update the working draft.

4. Deploy the Agent With an Alias

The test alias is only for testing. To use the agent in a real app, you must deploy it with an alias. AWS requires this before an agent can be used in an application.

  1. Open your agent and go to the Aliases section.
  2. Choose Create alias and enter a name.
  3. Choose Create a new version and associate it to this alias. You can also pick an existing version.
  4. Choose Create alias.
  5. Copy the agent ID and the alias ID. You need both in the next step.

Each alias points to a version of your agent. That means you can keep updating the draft without breaking the live version.

5. Call the Agent Using Python

Now call your agent from code. You use the AWS SDK for Python (boto3) and the InvokeAgent operation.

  1. Install and set up boto3, with your AWS credentials configured.
  2. Create a client for the bedrock-agent-runtime service.
  3. Call invoke_agent with your agent ID, alias ID, a session ID, and your question.
  4. Read the reply, which arrives in chunks.
import boto3
import uuid

client = boto3.client("bedrock-agent-runtime", region_name="your-region")

response = client.invoke_agent(
    agentId="YOUR_AGENT_ID",
    agentAliasId="YOUR_ALIAS_ID",
    sessionId=str(uuid.uuid4()),
    inputText="What time is it?",
)

answer = ""
for event in response["completion"]:
    chunk = event.get("chunk")
    if chunk:
        answer += chunk["bytes"].decode("utf-8")

print(answer)

Reuse the same session ID for follow-up questions, so the agent remembers the conversation. If you turn on streaming, the agent's role also needs the bedrock:InvokeModelWithResponseStream permission.

6. Clean Up AWS Resources

When you're done, delete what you built so you don't pay for things you no longer use.

  1. Delete the agent. In the Bedrock console, select your agent, choose Delete, and confirm.
  2. Delete the Lambda function. In the Lambda console, select the function, choose Actions, then Delete, and confirm.
  3. Delete the IAM roles. In the IAM console, go to Roles, select the agent service role, and delete it. Then do the same for the Lambda execution role.

Want to lead AI projects without writing code? The IIM Kozhikode Strategic AI for Business Professionals programme helps you apply AI in your domain and make strategic decisions that drive measurable business outcomes.

Amazon Bedrock Agents Classic vs Amazon Bedrock AgentCore

Both services build AI agents on AWS, but they work very differently. Classic is a fixed, settings-based service in maintenance mode. AgentCore is a flexible platform that AWS keeps adding to.

Here is how they compare, row by row.

 

Agents Classic

AgentCore

Setup Fill in settings for the model, instructions, and tools Use a config-based harness, or write your own agent code and run it on AgentCore
Models Bedrock models. The list has been frozen since July 30, 2026 The full Bedrock catalog, plus OpenAI, Gemini, and any OpenAI-compatible model. New models arrive here
Actions Action groups, defined by an OpenAPI or function schema, with an optional Lambda function Tools exposed through Gateway, wrapping REST APIs, Lambda functions, or code
Knowledge bases Attached directly to the agent Connected through Gateway, or through a retrieval tool in code
Memory Session and memory settings on the agent AgentCore Memory, short and long term, with different strategies
Prompt control Override prompts at four stages One system prompt on the harness. Stage-by-stage overrides are not directly copied, but code-defined agents allow them
Guardrails Attached to the agent Set in Bedrock, with enforcement on Gateway
Code execution Built-in code interpreter action group AgentCore Code Interpreter
Multi-agent Supervisor and routing roles are built in Limited on the harness. You can use an agent-as-tool pattern. Full multi-agent needs custom framework code
Tracing Trace window and APIs Persistent, end-to-end tracing of all agent actions
Cost No charge for Classic itself. You pay for model use and related resources Consumption-based pricing. No separate harness orchestration charge
Future Maintenance mode, with no new features Active development

Which One Should You Use?

  1. You already run Classic agents: keep them running. AWS says existing agents continue to work, and there is no migration deadline or planned end date.
  2. You're starting a new project: use AgentCore. New accounts can't create Classic agents anyway.
  3. You want something close to Classic: start with the AgentCore harness. AWS calls it the closest match.
  4. You need custom logic or full multi-agent control: use code-defined agents on AgentCore with a framework such as Strands or LangChain.

Also read: What is RAG in AI and How Retrieval-Augmented Generation Works

Benefits of Amazon Bedrock Agents

Classic agents save teams a lot of setup work. Here is where they help most.

  1. Fast to set up. AWS says you can create an agent in a few steps. You pick a model, write instructions, and connect your tools.
  2. Less plumbing to build. Amazon Bedrock manages prompt setup, memory, monitoring, encryption, permissions, and API calls. Your team writes none of that code.
  3. Works with your own systems. Action groups let the agent call your APIs through Lambda functions. Knowledge bases let it search your documents. One agent can do both.
  4. Easy to test. The console has a built-in test window. Turn on trace, and you can see the agent's reasoning step by step.
  5. Safe to update. You deploy with aliases that point to versions. You can keep editing the draft without breaking the version that users rely on.

Also read: Understanding Multi Agent Systems: A Complete Beginner Guide

Limitations of Amazon Bedrock Agents

Classic is still useful, but it has clear limits. The biggest one is its future.

  1. Closed to most new accounts. Since July 30, 2026, only accounts with Bedrock Agents activity in the past 12 months can create agents. Other accounts get an access-denied error. AWS says there is no exception process.
  2. No new features. The service is in maintenance mode, so AWS doesn't plan to add anything.
  3. Frozen model list. Models released after July 30, 2026 won't come to Classic. They arrive through AgentCore instead.
  4. Not every model works. The console shows a "Bedrock Agents optimized" filter, and you must clear it to see all supported models. Before you plan around a model, check the supported Regions and models page.
  5. Short memory by default. If a user doesn't reply for 30 minutes, the agent stops keeping the conversation history. You can change this setting.
  6. Less control over the loop. You can override prompts at set stages, but the overall orchestration follows Classic's fixed design. A custom orchestrator or fully custom logic needs more than settings, which is where AgentCore comes in.

Must read: Agentic AI Learning Path: A Complete Guide for Developers and AI Professionals

Conclusion

Amazon Bedrock agents are AI helpers that do more than chat. They plan, call your tools, search your data, and finish tasks.

The original service, now called Agents Classic, is quick to set up and still works well for teams that use it. But it's in maintenance mode. New accounts can't create Classic agents, and AWS isn't adding features. Existing agents keep running, and there's no migration deadline.

For new projects, use Amazon Bedrock AgentCore. It works with any model and framework. Whichever route you take, the basics stay the same: give the agent a clear job, the right tools, and good data, then test it before you go live.

Not sure which course fits your goals? Book a free consultation and get personalized guidance on choosing between Generative AI and Agentic AI. 

Frequently Asked Question (FAQs)

1. Is Amazon Bedrock itself being discontinued?

No. Amazon Bedrock is fully supported, and it keeps getting new models. Only the Agents Classic service is closed to new accounts. Your models, knowledge bases, and guardrails are not affected.

2. What error do I get if my account can't create a Classic agent?

You'll see an AccessDeniedException with HTTP status 403 when you call CreateAgent or InvokeInlineAgent. The message says Bedrock Agents is in maintenance mode. AWS says there is no exception process, so the fix is to use AgentCore.

3. Did the rename change API names, SDK clients, or IAM permissions?

No. AWS calls it a naming update only. The bedrock-agent API namespace, SDK clients, CloudFormation resource types, and IAM action prefixes stay the same.

4. Will my CloudFormation, CDK, or Terraform templates still work?

Yes, for accounts that are still allowed to use Classic. In a new account without prior usage, AWS says to use AgentCore resources in your templates instead.

5. What happens to my knowledge bases and guardrails if I move to AgentCore?

Your knowledge bases stay as they are. You connect them to your AgentCore agent through Gateway. Guardrails set on the Bedrock model still apply when the model runs through AgentCore. For agent-level enforcement, you use Gateway policies.

6. Can I reuse my existing Lambda action groups on AgentCore?

Yes. You connect them through Gateway, which turns REST APIs and Lambda functions into tools your agent can call. This is usually the main migration task. You redeploy your action groups behind Gateway.

7. How long does it take to migrate from Classic to AgentCore?

AWS says a straightforward agent, with a model, action groups, and a knowledge base, takes hours. Agents with custom orchestrators or multi-agent setups need more code work.

8. Is there a tool that migrates a Classic agent for me?

Yes. AWS offers an amazon-bedrock skill in its agent toolkit for AWS. It checks your agent, builds a migration plan, and uses the AgentCore CLI to deploy the harness. It pauses for your approval first and never changes your original agent.

9. Is AgentCore available in every AWS Region?

No. AWS publishes a list of supported Regions, so check it before you plan. If your Classic agents run in a Region without AgentCore, you can keep using them there and build new projects in a supported Region.

10. Can I switch the AI model without redeploying my agent?

On the AgentCore harness, yes. AWS says you can switch between model providers mid-session without redeploying. You can also override the model on a single invocation.

11. Can AgentCore keep each user's memory separate?

Yes. Memory is on by default in the harness. If you pass an actor ID with each request, every actor gets isolated memory, and long-term memory is scoped to that actor.

upGrad

1141 articles published

We are an online education platform providing industry-relevant programs for professionals, designed and delivered in collaboration with world-class faculty and businesses. Merging the latest technolo...

Speak with AI & ML expert

+91

By submitting, I accept the T&C and
Privacy Policy