Amazon Bedrock Agents help you build generative AI assistants that break down user requests into multiple steps. They use developer-provided instructions to create a coordination plan and then execute it by calling APIs and accessing Knowledge Bases to provide a final response to the end user.
In this module, we’ll create an AWS Solutions Architect Agent that uses our Knowledge Base to answer AWS-related questions. We’ll also create an action to read records from a database. Since LLMs are not designed for data analysis, it’s better to build a dedicated tool (Lambda) that the agent can call.
Go to the Agents Console, then click Create Agent.
Fill in the following:
Name: Agent-AWS
Description: Agent AWS is an automated, AI-powered agent that helps customers with knowledge of AWS by querying the AWS Well-Architected Framework
Leave other settings as default and click Create.
Select Amazon Nova Pro as the model.
Provide the following instruction:
You are an expert AWS Certified Solutions Architect. Your role is to help customers understand best practices on building on AWS.
Click Save at the top.
An Action is a task the agent can execute automatically by calling a Lambda function. A set of actions is defined in an Action Group, and an OpenAPI schema defines all the APIs in the group. In this exercise, we will use a predefined action that reads records from a database.
To create it:
data-processing
Actions to process data
Define with API schemas
data_process_action
openapibucket
in its nameagent_bedrock_schema.json
Now we’ll add the Knowledge Base we created earlier.
Click Add in the Knowledge Base section.
Select the Knowledge Base created earlier.
Use this instruction:
Query the AWS Well-Architected Framework to answer the customer's question
Click Add to finish.
To test the Agent in the console:
For example:
What can you tell me about S3 buckets?
Once the Agent replies, click Show trace to see the steps it followed to generate the answer.
You can also test the record-reading action by asking:
Can you help with the data processing task of getting the number of records in the production database?
️ It looks like we hit an error. No worries—this was intentional, and we’ll fix it in the next section using Amazon Q to debug the function.