Agents for Amazon Bedrock helps you accelerate the development of GenAI applications by orchestrating multistep tasks. Agents uses the reasoning capability of foundation models (FMs) to break down user-requested tasks into steps. Agents for Amazon Bedrock can perform the following tasks:
- Breakdown user requests into multiple smaller steps
- Collect additional information from a user through natural conversation
- Decide which APIs to call and provide the necessary parameters for calling the APIs
- Take actions to fulfill a customer's request calling provided APIs
- Augment performance and accuracy by querying integrated Knowledge Bases
An agent consists of the following components:
-
Foundation model – You choose a foundation model that the agent invokes to interpret user input and subsequent prompts in its orchestration process, and to generate responses and follow-up steps in its process
-
Instructions – You author instructions that describe what the agent is designed to do
- (Optional) With Advanced Prompts you can further customize instructions for the agent at every step of orchestration
- With customized Lambda Parser functions you can parse the output of each orchestration step
-
(Optional) Action groups – You define the actions that the agent should carry out by providing the available APIs with
- Function Definition where you specify functions and define parameters as JSON objects that will be associated to the action group invocation or,
- API Schema file that defines the APIs that the agent can invoke to carry out its tasks resources
Additionally, you can define a Lambda function to execute API calls with the selected parameters
-
(Optional) Knowledge bases – Associate knowledge bases with an agent to allow it to retrieve context to augment response generation and input into orchestration steps
This repository contains examples and use-cases to get you started with Agents for Amazon Bedrock and its capabilities. It is organized in the following folders:
- Use case examples: examples of Agents in specific use cases, including:
- Retail Agent with Bedrock Agents - Agent designed to help with retail transactions
- Insurance Claim Lifecycle Automation Agent - Agent desided to help insurance employees working with claims
- Text to SQL Agent - Agent designed to generate and execute SQL queries using natural language
- Text to SQL Agent CDK Enhanced - Agent designed to generate and execute SQL queries using natural language. This repository enhances the original Text to SQL Bedrock Agent with improvment on: using CDK, works with any dataset, wroks with super large answers.
- Customer Relationship Management Agent - Agent designed to help sales employees work with their customers
- [HR Vacation Agent] - Agent to manage employee vacation time
- Feature examples: examples of how to use specific features of Agents for Bedrock
- Create Agent with Function Definition: Example of how to create an HR assistant agent defining the Action Group function and parameters as JSON object that is associated with the Action Group invocation. It connects with an AWS Lambda function to execute the actions
- Create Agent with API Schema: Example of how to create an Insurance Claim's handler agent using an API schema for the functions and parameters definition. The API schema follows the OpenAPI Specificiation format and connects with an AWS Lambda function for the actions exection.
- Create Agent with Return of Control: Example of how to create an HR assistant agent defining the Action Group function and parameters as JSON object that is associated with the Action Group invocation. It skips the AWS Lambda function definition to return the control to the user's application.
- Create Agent with a Single Knowledge: Example of how to create a restaurant assistant agent that connects with a single Knowledge Base for Amazon Bedrock to find informations on the menus for adults and children.
- Create Agent with Knowledge Base and Action Group: Example of how to create extend the Insurance Claim's handler to connect to a Knowledge Base and get the requirements for missing documents.
- Using Agent's Prompt and Session Parameters: Example of how to pass prompt and session parameters to an agent invocation in order to extend the agent's knowledge.
- Changing Agent's Advanced Prompts and creating custom Lambda Parsers: Example of how to change an Agent's advanced prompt and how to create a custom lambda parser for advanced agents use cases
- Securing Bedrock Agents using session attributes and Amazon Verified Permissions: Example of how to use session parameters and use Amazon Verified Permissions to implement fine grained permissions
We welcome community contributions! Please ensure your sample aligns with AWS best practices, and please update the Contents section of this README file with a link to your sample, along with a description.
We welcome community contributions! Please ensure your sample aligns with AWS best practices, and please update the Contents section of this README file with a link to your sample, along with a description.