A serverless chatbot implementation using Amazon Bedrock and OpenSearch for intelligent querying and data retrieval.
This project demonstrates how to build an intelligent chatbot using Amazon Bedrock's foundation models combined with OpenSearch for efficient data retrieval. The chatbot can understand natural language queries, process them through Amazon Bedrock, and return relevant information from the connected data sources.
The solution includes:
- Amazon Bedrock for natural language processing
- Amazon OpenSearch for vector search and data storage
- AWS Lambda for serverless compute
- Amazon EC2 for Steampipe server
- Amazon S3 for data storage
- Amazon VPC for network isolation
- AWS IAM for security and access control
- AWS Account with access to:
- Amazon Bedrock
- Amazon OpenSearch Service
- AWS Lambda
- Amazon EC2
- Amazon S3
- Amazon VPC
- Python 3.8 or later
- AWS CLI configured with appropriate credentials
- Basic understanding of AWS services and Python programming
- Clone the repository
git clone https://github.com/[your-username]/bedrock-easy-query-chatbot.git
cd bedrock-easy-query-chatbot
- Install required dependencies
pip install -r requirements.txt
- Configure AWS credentials
aws configure
-
Follow the Jupyter notebook for step-by-step deployment:
VPC and networking setup
OpenSearch domain creation
Lambda function deployment
Bedrock agent configuration
EC2 Steampipe server setup
S3 bucket creation and data upload
-
Open the Jupyter notebook in notebooks/main.ipynb
-
Follow the step-by-step instructions to:
Set up infrastructure Configure the chatbot Test queries Monitor performance
To avoid ongoing charges, remember to clean up all created resources:
- Delete OpenSearch domain
- Terminate EC2 instance
- Delete Lambda function
- Remove VPC and related resources
- Empty and delete S3 bucket
- Delete Bedrock agent and knowledge base
- Remove IAM roles and policies Detailed cleanup instructions are provided in the notebook.
All services are deployed within a VPC for network isolation IAM roles follow the principle of least privilege Sensitive data is encrypted at rest and in transit VPC endpoints are used for secure service access
Currently supports only English language queries Requires AWS regions where Bedrock is available Limited to specific data formats for ingestion
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Amazon Bedrock team for the foundation models
AWS Documentation and example code
Community contributors and feedback
For issues and questions, please open an issue in the GitHub repository.
This project is for demonstration purposes and should be properly reviewed and modified before using in a production environment.