Welcome to this repository on building Generative AI Agents using Amazon Bedrock!
In fast-paced technical roles like Solutions Architects and Cloud Engineers, we often face repetitive, time-consuming tasks that take us away from more impactful work. In this tutorial we weill help a fictional company SwissBox to build analytics solution.
SwissBox is a tech company providing file-sharing services, approaches us for technical guidance on integrating analytics into their app, but the process can be tedious! We need to research their application architecture, security requirements, and AWS best practices, all while navigating over 200+ AWS services to find the right solution. This back-and-forth process consumes valuable time, delaying critical business outcomes.
Imagine if we could automate these tasks using AI agents? Instead of spending days gathering information and building prototypes, AI agents could retrieve relevant data, generate infrastructure as code, and even provide cost estimates in seconds.
This repository demonstrates how to build such AI agents using Amazon Bedrock, empowering you to streamline your workflow and focus on strategic work that drives business results.
-
Tool 1 - Q&A ChatBot utilizing Knowledge Bases for Amazon Bedrock
- Build a Solutions Architect Q&A assistant to quickly retrieve relevant information from custom data sources like documentation, code repositories, and configurations.
-
Tool 2 - Generate IaC using Claude 3.5 Sonnet
- Create a DevOps assistant that generates Infrastructure as Code (IaC) using Claude 3.5, allowing for rapid deployment of cloud infrastructure.
-
Tool 3 - Estimate costs using InfraCost
- Develop a Financial Analyst assistant to estimate the costs of your proposed cloud solutions, helping you make informed financial decisions.
-
Integrate Tools - Build AI Agent using Amazon Bedrock
- Combine the capabilities of all three tools into a single AI agent that can query enterprise documentation, suggest AWS solutions, generate IaC, and estimate AWS costs in one seamless workflow.
By the end of this tutorial, you will learn how to create an Amazon Bedrock Agent that assists with querying your enterprise documentation, suggesting and explaining AWS solutions, generating IaC, and estimating the monthly costs to run a solution on AWS.
🖼️ Accompanying slides can be found here
Prerequisites:
- Basic Python coding skills
- Experience with the AWS Console
- Familiarity with core AWS services (Lambda, IAM, S3 )
This workshop assumes you are working in an environment with access to Python 3.9 and Docker.
- Clone the Repository: Start by cloning the provided repository which contains the code for our agent.
git clone https://github.com/viktoriasemaan/sa-ai-agent.git
cd sa-ai-agent
- Install Dependencies: Run the appropriate pip install command to download necessary packages.
pip install -r requirements.txt
This tool demonstrates how quickly a Knowledge Base or Retrieval Augmented Generation (RAG) system can be set up. It enriches user queries with new information from an uploaded knowledge base.
🎥 You can find the demo with detailed steps Video 1 - Tool 1
We will use a custom knowledge base that includes data from both a web crawler and S3 data sources:
- Web Crawler: This example crawls a custom GitHub repository containing information about the SwissBox app. Feel free to replace this with your own data sources. Learn more about setting up web crawlers here.
- S3 Data Source: Any additional documentation about your application can be added to S3. Learn more about the supported formats here.
By using these sources, the tool will provide answers about the SwissBox app that foundational models might not have. This enables you to retrieve relevant information about your application within seconds.
RAG optimizes the output of a large language model by referencing a custom knowledge base. It compares embeddings of user queries with the knowledge library vectors, then appends relevant information to the original prompt to generate a more informed response.
Navigate to the Amazon Bedrock service. Under Builder Tools, select Knowledge Bases and create a new one.
< 8000 div class="markdown-heading" dir="auto">