https://github.com/awslabs/amazon-bedrock-agent-samples
Example Jupyter notebooks 📓 and code scripts 💻 for using Amazon Bedrock Agents 🤖 and its functionalities
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
â—‹CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
â—‹DOI references
-
â—‹Academic publication links
-
â—‹Academic email domains
-
â—‹Institutional organization owner
-
â—‹JOSS paper metadata
-
â—‹Scientific vocabulary similarity
Low similarity (9.8%) to scientific vocabulary
Keywords
Repository
Example Jupyter notebooks 📓 and code scripts 💻 for using Amazon Bedrock Agents 🤖 and its functionalities
Basic Info
- Host: GitHub
- Owner: awslabs
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://aws.amazon.com/bedrock/agents/
- Size: 78.9 MB
Statistics
- Stars: 716
- Watchers: 23
- Forks: 237
- Open Issues: 35
- Releases: 0
Topics
Metadata Files
README.md
Front-End Implementation - Integrating Amazon Bedrock Agent with a Ready-to-Use Data Analyst Assistant Application
This tutorial guides you through setting up a React Web application that integrates with your Amazon Bedrock Agent, creating a Data Analyst Assistant for Video Game Sales.
Overview
By the end of this tutorial, you'll have a fully functional Generative AI web application that allows users to interact with a Data Analyst Assistant interface.
The application consists of:
- React Web Application: Delivers the user interface for the assistant
- The application invokes the Amazon Bedrock Agent for interacting with the assistant
- For chart generation, the application directly invokes the Claude 3.5 Sonnet model
[!IMPORTANT] This sample application is for demonstration purposes only and is not production-ready. Please validate the code against your organization's security best practices.
Prerequisites
Before you begin, ensure you have:
- An Alias created for your Amazon Bedrock Agent from the Generative AI Application - Data Source and Amazon Bedrock Agent Deployment tutorial
- Node.js version 18+
- React Scripts installed:
bash npm install react-scripts
Set Up the Front-End Application
Navigate to the React application folder (amplify-video-games-sales-assistant-bedrock-agent/) and install the Reac application dependencies:
bash
npm install
Configure IAM User Access for Front-End Permissions
- Create an IAM user
- Create Access key and Secret access key for programmatic access
- Add an inline policy to this user with the following JSON (replace placeholder values with your actual ARNs).
Update the values with your
json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "InvokeBedrockAgent",
"Effect": "Allow",
"Action": [
"bedrock:InvokeAgent"
],
"Resource": [
"<agent_arn>",
"arn:aws:bedrock:*:<account_id>:agent-alias/<agent_id>/*"
]
},
{
"Sid": "InvokeBedrockModel",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel"
],
"Resource": [
"arn:aws:bedrock:*:<account_id>:inference-profile/us.anthropic.claude-3-5-sonnet-20241022-v2:0",
"arn:aws:bedrock:us-east-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
"arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0",
"arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0"
]
},
{
"Sid": "DynamoDB",
"Effect": "Allow",
"Action": [
"dynamodb:Query"
],
"Resource": "<question_answers_table_arn>"
}
]
}
Configure Environment Variables
Rename the file src/sample.env.js to src/env.js and update the following environment variables:
- AWS Credentials and Region:
- ACCESSKEYID
- SECRETACCESSKEY
- AWS_REGION
- Agent and table information that you can find in the CloudFormation Outputs from the SAM project:
- AGENT_ID
- AGENTALIASID
- QUESTIONANSWERSTABLE_NAME
- Also, you can update the general application description:
- APP_NAME
- APP_SUBJECT
- WELCOME_MESSAGE
- AWS Credentials and Region:
Test Your Data Analyst Assistant
Start the application locally:
bash
npm start
Try these sample questions to test the assistant:
- Hello!
- How can you help me?
- What is the structure of the data?
- Which developers tend to get the best reviews?
- What were the total sales for each region between 2000 and 2010? Give me the data in percentages.
- What were the best-selling games in the last 10 years?
- What are the best-selling video game genres?
- Give me the top 3 game publishers.
- Give me the top 3 video games with the best reviews and the best sales.
- Which is the year with the highest number of games released?
- Which are the most popular consoles and why?
- Give me a short summary and conclusion of our conversation.
[!TIP] 🚀 For production deployment, consider using AWS Amplify Hosting and integrate Amazon Cognito or another identity provider for proper authentication and authorization instead of using IAM user credentials.
Application Features
Congratulations! Your Data Analyst Assistant can provide you with the following conversational experience:

- Conversational interface with an agent responding to user questions

- Detailed answers including the rationale behind SQL query generation

- Raw query results displayed in tabular format

- Chart visualization generated from the agent's answer and the data query results (created using Apexcharts).

- Summary and conclusion derived from the data analysis conversation

Thank You
License
This project is licensed under the Apache-2.0 License.
Owner
- Name: Amazon Web Services - Labs
- Login: awslabs
- Kind: organization
- Location: Seattle, WA
- Website: http://amazon.com/aws/
- Repositories: 914
- Profile: https://github.com/awslabs
AWS Labs
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 22
- Total pull requests: 117
- Average time to close issues: 16 days
- Average time to close pull requests: 6 days
- Total issue authors: 19
- Total pull request authors: 46
- Average comments per issue: 0.23
- Average comments per pull request: 0.39
- Merged pull requests: 61
- Bot issues: 1
- Bot pull requests: 10
Past Year
- Issues: 22
- Pull requests: 117
- Average time to close issues: 16 days
- Average time to close pull requests: 6 days
- Issue authors: 19
- Pull request authors: 46
- Average comments per issue: 0.23
- Average comments per pull request: 0.39
- Merged pull requests: 61
- Bot issues: 1
- Bot pull requests: 10
Top Authors
Issue Authors
- EashanKaushik (3)
- rostcheck (2)
- vikramelango (1)
- robbieowens15 (1)
- tloth-phx (1)
- bignellrp (1)
- amotl (1)
- xiehust (1)
- jayasimhag1reddy (1)
- wesmorishita (1)
- manbearshark (1)
- MartinR-L (1)
- gmansilla (1)
- LucaiB (1)
- hasanp87 (1)
Pull Request Authors
- aurbac (16)
- EashanKaushik (11)
- omrsamer (10)
- dependabot[bot] (9)
- aidan-ricci (6)
- isingh09 (4)
- LucaiB (4)
- rchandra20 (3)
- mttanke (3)
- johanneslanger (3)
- rostcheck (3)
- niklas-palm (2)
- aarora79 (2)
- eercanayar (2)
- tsanti (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- opensearch-py *
- requests-aws4auth *
- aws-cdk-lib ==2.147.0
- boto3 *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- numpy * development
- pandas * development
- requests * development
- boto3 * development
- botocore * development
- dash-core-components ==2.0.0 development
- dash-html-components ==2.0.0 development
- dash-table ==5.0.0 development
- opensearch-py * development
- retrying * development
- requests * development
- boto3 * development
- botocore * development
- dash-core-components ==2.0.0 development
- dash-html-components ==2.0.0 development
- dash-table ==5.0.0 development
- opensearch-py * development
- retrying * development
- boto3 * development
- botocore * development
- opensearch-py * development
- retrying * development
- boto3 * development
- botocore * development
- opensearch-py * development
- retrying * development
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- rich *
- termcolor *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- rich *
- termcolor *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- rich *
- termcolor *
- awscli *
- boto3 *
- botocore *
- opensearch-py *
- retrying *
- rich *
- termcolor *
- black ==24.10.0
- boto3 *
- botocore *
- ipython ==8.29.0
- matplotlib ==3.9.2
- opensearch-py ==2.7.1
- pydantic ==2.10.2
- rich ==13.9.4
- termcolor ==2.5.0