Building autonomous agents using Amazon Bedrock
Generative AI at AWS re:Invent 2023
Last year I had the opportunity to attend AWS re:Invent 2023 in Las Vegas and some of the key announcements for generative AI included the general availability of Agents for Amazon Bedrock on 28 November 2023 .
Like me you may have experience working with data in contact centres in government, wealth management, funds management and even insurance claims. AI agents present a new opportunity to help us move from chatbots to orchestration with multi-step tasks. We need human input and our own data.
Lesson Objectives
In this short post you will learn how to:
What are AI agents?
AI agents in Amazon Bedrock allows you to automate tasks and configure conversation agents into your business applications in the real-world.
This autonomous agent can help a business user to complete actions based on :
What are the benefits to the business user?
Developers can save time to ship generative AI business applications.
You do not need to manage any cloud infrastructure or write any code.
What are the key features?
The AI agent will orchestrate interactions between third-party foundation models e.g. Llama, enterprise data sources, software applications, and user conversations .
How do we use an AI agent?
As per the Amazon Bedrock User Guide, the agent performs the following tasks :
What are the common use cases?
AI agents may be applied across different business applications and industries such as:
How do I get started?
To create an agent we need to:
The foundation models used by Amazon Bedrock agents include the below:
You may create or configure an agent using the console, API, SDK or CLI.
In Preview
Working Draft
This a draft that you can use to make iterations once the agent is built. Use this working draft to test and troubleshoot agent behaviour.
Customize the AI agent
You may customize the behaviour of the agent for your use case with:
Tutorial: Build an Amazon Bedrock Travel Agent
3. Navigate to the left and select Agent. Next select Create Agent.
4. Select a base model i.e. foundation model on the left-handside and request model access.
I selected Anthropic's Claude 3 Haiku foundation model.
5. Submit request to access Anthropic's Claude 3 Haiku foundation model.
Read the terms and conditions and then select Submit.
In a few seconds, model access is granted.
6. Provide a name for your agent e.g. Travel. You may optionally provide a description for the agent.
Save the agent.
7. The agent is created.
8. Under Agent resource role, select an appropriate option. E.g. Create an use a new service role.
Under Select Model, provide the instructions for the Agent i.e. the specific actions the agent can perform.
9. Create Action Group by creating a Lambda function.
领英推荐
Select Create.
10. Select Create a knowledge base.
11. Provide a name for the knowledge base. e.g. Macau
12. Select the data source for the knowledge base as Web crawler - Preview. ImageNext.
Provide the URL for the website Flight Centre click Next.
13. Select an embeddings model e.g. Cohere's Embed English V3. Leave the default selection for Vector database and select Next.
An AWS OpenSearch Serverless vector store will be created on my behalf by Amazon Web Services.
14. Review your settings and select Create knowledge base.
The knowledge base has successfully been created.
15. Request model access for Anthropic's Claude 3 Haiku and add the existing knowledge base for Macau.
Enter instructions in the knowledge base.
16. The Action Group and Knowledge Base were both added successfully.
17. Test the agent by asking a few questions with query and search with prompt engineering.
Do I need a visa to travel from Sydney to Hong Kong?
What is the best way to travel from Hong Kong to Macau?
What are the tourist attractions in Hong Kong for a 1 day trip?
What are the tourist attractions in Macau?
Do I need to pay for a visa from Sydney to Macau?
18. Delete your Agent after you end your session. Enter the word 'Delete' in the field provided.
19. Delete your Knowledge Base if you no longer require use after your session has ended.
20. Navigate to Model Access to remove access after you have ended your session. This will ensure that you will not have any surprise monthly bills.
Click Submit.
Conclusion
You may quickly build an AI agent to perform actions based on your knowledge base that could include your enterprise data or data that is crawled from public websites in preview.
You also provide instructions for the knowledge base and agent to perform based on your given use case or business application to solve real-world problems.
AWS re: Invent 2023
If you would like to learn more about Agents on Amazon Bedrock you may watch the following presentations:
AWS re: Invent 2023 - Simplify generative AI app development with Agents for Amazon Bedrock (AIM353)
AWS re:Invent 2023: AWS On Air ft. Agents for Amazon Bedrock
AWS re:Invent 2023 - Building an AWS solutions architect agent with Amazon Bedrock (BOA306)
This Month
AWS Innovate - 26 September 2024
You are invited this later month to join us for AWS Innovate in APJ to learn how to modernize your applications and also implement generative AI solutions for your industry.
You may register at this link .
Until the next update, Happy Learning ! ??