
Cost Optim Slack Chatbot with AWS Bedrock Agent
Introducing the Cost Optimization Slack Chatbot powered by AWS Bedrock Generative AI
Amar Meriche
Amazon Employee
Published Jan 21, 2025
This project provides an Slack-based chatbot that can answer questions about AWS cost optimization and provide links to relevant QuickSight dashboards.
The chatbot is powered by a Bedrock Claude Agent and a customized knowledge base using AWS Titan Text Embeddings running on OpenSearch Serverless (Vector).
- Slack integration - Users can interact with the chatbot directly through Slack.
- Generative AI-powered responses - The Bedrock Claude Agent provides human-like responses to cost optimization questions.
- Embedded dashboards - The chatbot can provide links to AWS QuickSight dashboards to help visualize cost optimization data.
- Customized knowledge base - The knowledge base is populated with content from the AWS CFM Tips website to provide specialized cost optimization information.
- API Gateway and Lambda functions enable the integration between Slack and the Bedrock Agent.
- Amazon OpenSearch Serverless is used to store the Titan Text Embeddings.
- IAM roles and policies provide the necessary permissions for the various components.

- Create a Slack app and obtain an OAuth token.
- Deploy the OpenSearch Serverless and main chatbot CloudFormation stacks.
- Run the web crawler to populate the knowledge base.
- Configure the Slack event subscription with the API Gateway URL.
You can use the following Github aws-samples code sample to install the solutions (Cloudformation + Python): https://github.com/aws-samples/cost-optim-slack-chatbot-genai-agent
The AWS Cost Optimization Slack Chatbot is a powerful tool that combines the convenience of Slack, the intelligence of generative AI, and the expertise of AWS cost optimization best practices. This solution can help AWS customers optimize their cloud spend and make more informed decisions about their resource usage. They can easily customize this solution to answer other requirements (use Teams or Google Chat instead of Slack, use other sources/urls for the Knowledge Base, use the Bedrock Agent for a different purpose…)
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.