Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 21, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 21, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 21, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 21, 2025

      Google DeepMind’s CEO says Gemini’s upgrades could lead to AGI — but he still thinks society isn’t “ready for it”

      May 21, 2025

      Windows 11 is getting AI Actions in File Explorer — here’s how to try them right now

      May 21, 2025

      Is The Alters on Game Pass?

      May 21, 2025

      I asked Copilot’s AI to predict the outcome of the Europa League final, and now I’m just sad

      May 21, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Celebrating GAAD by Committing to Universal Design: Equitable Use

      May 21, 2025
      Recent

      Celebrating GAAD by Committing to Universal Design: Equitable Use

      May 21, 2025

      GAAD and Universal Design in Healthcare – A Deeper Look

      May 21, 2025

      GAAD and Universal Design in Pharmacy – A Deeper Look

      May 21, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Google DeepMind’s CEO says Gemini’s upgrades could lead to AGI — but he still thinks society isn’t “ready for it”

      May 21, 2025
      Recent

      Google DeepMind’s CEO says Gemini’s upgrades could lead to AGI — but he still thinks society isn’t “ready for it”

      May 21, 2025

      Windows 11 is getting AI Actions in File Explorer — here’s how to try them right now

      May 21, 2025

      Is The Alters on Game Pass?

      May 21, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Machine Learning»Integrate Amazon Bedrock Agents with Slack

    Integrate Amazon Bedrock Agents with Slack

    May 21, 2025

    As companies increasingly adopt generative AI applications, AI agents capable of delivering tangible business value have emerged as a crucial component. In this context, integrating custom-built AI agents within chat services such as Slack can be transformative, providing businesses with seamless access to AI assistants powered by sophisticated foundation models (FMs). After an AI agent is developed, the next challenge lies in incorporating it in a way that provides straightforward and efficient use. Organizations have several options: integration into existing web applications, development of custom frontend interfaces, or integration with communication services such as Slack. The third option—integrating custom AI agents with Slack—offers a simpler and quicker implementation path you can follow to summon the AI agent on-demand within your familiar work environment.

    This solution drives team productivity through faster query responses and automated task handling, while minimizing operational overhead. The pay-per-use model optimizes cost as your usage scales, making it particularly attractive for organizations starting their AI journey or expanding their existing capabilities.

    There are numerous practical business use cases for AI agents, each offering measurable benefits and significant time savings compared to traditional approaches. Examples include a knowledge base agent that instantly surfaces company documentation, reducing search time from minutes to seconds. A compliance checker agent that facilitates policy adherence in real time, potentially saving hours of manual review. Sales analytics agents provide immediate insights, alleviating the need for time consuming data compilation and analysis. AI agents for IT support help with common technical issues, often resolving problems faster than human agents.

    These AI-powered solutions enhance user experience through contextual conversations, providing relevant assistance based on the current conversation and query context. This natural interaction model improves the quality of support and helps drive user adoption across the organization. You can follow this implementation approach to provide the solution to your Slack users in use cases where quick access to AI-powered insights would benefit team workflows. By integrating custom AI agents, organizations can track improvements in key performance indicators (KPIs) such as mean time to resolution (MTTR), first-call resolution rates, and overall productivity gains, demonstrating the practical benefits of AI agents powered by large language models (LLMs).

    In this post, we present a solution to incorporate Amazon Bedrock Agents in your Slack workspace. We guide you through configuring a Slack workspace, deploying integration components in Amazon Web Services (AWS), and using this solution.

    Solution overview

    The solution consists of two main components: the Slack to Amazon Bedrock Agents integration infrastructure and either your existing Amazon Bedrock agent or a sample agent we provide for testing. The integration infrastructure handles the communication between Slack and the Amazon Bedrock agent, and the agent processes and responds to the queries.

    The solution uses Amazon API Gateway, AWS Lambda, AWS Secrets Manager, and Amazon Simple Queue Service (Amazon SQS) for a serverless integration. This alleviates the need for always-on infrastructure, helping to reduce overall costs because you only pay for actual usage.

    Amazon Bedrock agents automate workflows and repetitive tasks while securely connecting to your organization’s data sources to provide accurate responses.

    An action group defines actions that the agent can help the user perform. This way, you can integrate business logic with your backend services by having your agent process and manage incoming requests. The agent also maintains context throughout conversations, uses the process of chain of thought, and enables more personalized interactions.

    The following diagram represents the solution architecture, which contains two key sections:

    • Section A – The Amazon Bedrock agent and its components are included in this section. With this part of the solution, you can either connect your existing agent or deploy our sample agent using the provided AWS CloudFormation template
    • Section B – This section contains the integration infrastructure (API Gateway, Secrets Manager, Lambda, and Amazon SQS) that’s deployed by a CloudFormation template.

    Solutions Overview Slack Integration with Amazon Bedrock Agents

    The request flow consists of the following steps:

    1. A user sends a message in Slack to the bot by using @appname.
    2. Slack sends a webhook POST request to the API Gateway endpoint.
    3. The request is forwarded to the verification Lambda function.
    4. The Lambda function retrieves the Slack signing secret and bot token to verify request authenticity.
    5. After verification, the message is sent to a second Lambda function.
    6. Before putting the message in the SQS queue, the Amazon SQS integration Lambda function sends a “🤔 Processing your request…” message to the user in Slack within a thread under the original message.
    7. Messages are sent to the FIFO (First-In-First-Out) queue for processing, using the channel and thread ID to help prevent message duplication.
    8. The SQS queue triggers the Amazon Bedrock integration Lambda function.
    9. The Lambda function invokes the Amazon Bedrock agent with the user’s query, and the agent processes the request and responds with the answer.
    10. The Lambda function updates the initial “🤔 Processing your request…” message in the Slack thread with either the final agent’s response or, if debug mode is enabled, the agent’s reasoning process.

    Prerequisites

    You must have the following in place to complete the solution in this post:

    • An AWS account
    • A Slack account (two options):
      • For company Slack accounts, work with your administrator to create and publish the integration application, or you can use a sandbox organization
      • Alternatively, create your own Slack account and workspace for testing and experimentation
    • Model access in Amazon Bedrock for Anthropic’s Claude 3.5 Sonnet in the same AWS Region where you’ll deploy this solution (if using your own agent, you can skip this requirement)
    • The accompanying CloudFormation templates provided in GitHub repo:
      • Sample Amazon Bedrock agent (virtual-meteorologist)
      • Slack integration to Amazon Bedrock Agents

    Create a Slack application in your workspace

    Creating applications in Slack requires specific permissions that vary by organization. If you don’t have the necessary access, you’ll need to contact your Slack administrator. The screenshots in this walkthrough are from a personal Slack account and are intended to demonstrate the implementation process that can be followed for this solution.

    1. Go to Slack API and choose Create New App

    SlackAPI Create New App

    1. In the Create an app pop-up, choose From scratch

    Create an app from scratch

    1. For App Name, enter virtual-meteorologist
    2. For Pick a workspace to develop your app in, choose the workspace where you want to use this application
    3. Choose Create App

    Name app and choose workspace

    After the application is created, you’ll be taken to the Basic Information page.

    1. In the navigation pane under Features, choose OAuth & Permissions
    2. Navigate to the Scopes section and under Bot Tokens Scopes, add the following scopes by choosing Add an OAuth Scope and entering im:read, im:write, and chat:write

    Slack Scopes

    1. On the OAuth & Permissions page, navigate to the OAuth Tokens section and choose Install to {Workspace}
    2. On the following page, choose Allow to complete the process

    Install App in Slack

    1. On the OAuth & Permissions page, navigate to OAuth Tokens and copy the value for Bot User OAuth Token that has been created. Save this in a notepad to use later when you’re deploying the CloudFormation template.

    Copy OAuthToken

    1. In the navigation pane under Settings, choose Basic Information
    2. Navigate to Signing Secret and choose Show
    3. Copy and save this value to your notepad to use later when you’re deploying the CloudFormation template

    Signing Secret

    Deploy the sample Amazon Bedrock agent resources with AWS CloudFormation

    If you already have an Amazon Bedrock agent configured, you can copy its ID and alias from the agent details. If you don’t, then when you run the CloudFormation template for the sample Amazon Bedrock agent (virtual-meteorologist), the following resources are deployed (costs will be incurred for the AWS resources used):

    • Lambda functions:
      • GeoCoordinates – Converts location names to latitude and longitude coordinates
      • Weather – Retrieves weather information using coordinates
      • DateTime – Gets current date and time for specific time zones
    • AWS Identity and Access Management IAM roles:
      • GeoCoordinatesRole – Role for GeoCoordinates Lambda function
      • WeatherRole – Role for Weather Lambda function
      • DateTimeRole – Role for DateTime Lambda function
      • BedrockAgentExecutionRole – Role for Amazon Bedrock agent execution
    • Lambda permissions:
      • GeoCoordinatesLambdaPermission – Allows Amazon Bedrock to invoke the GeoCoordinates Lambda function
      • WeatherLambdaPermission – Allows Amazon Bedrock to invoke the Weather Lambda function
      • DateTimeLambdaPermission – Allows Amazon Bedrock to invoke the DateTime Lambda function
    • Amazon Bedrock agent:
      • BedrockAgent – Virtual meteorologist agent configured with three action groups
    • Amazon Bedrock agent action groups:
      • obtain-latitude-longitude-from-place-name
      • obtain-weather-information-with-coordinates
      • get-current-date-time-from-timezone

    Choose Launch Stack to deploy the resources:

    cloudformation-launch-stack-slack-bedrockagent-integration

    After deployment is complete, navigate to the Outputs tab and copy the BedrockAgentId and BedrockAgentAliasID values. Save these to a notepad to use later when deploying the Slack integration to Amazon Bedrock Agents CloudFormation template.

    Virtual meteorologist cfn Output

    Deploy the Slack integration to Amazon Bedrock Agents resources with AWS CloudFormation

    When you run the CloudFormation template to integrate Slack with Amazon Bedrock Agents, the following resources are deployed (costs will be incurred for the AWS resources used):

    • API Gateway:
      • SlackAPI – A REST API for Slack interactions
    • Lambda functions:
      • MessageVerificationFunction – Verifies Slack message signatures and tokens
      • SQSIntegrationFunction – Handles message queueing to Amazon SQS
      • BedrockAgentsIntegrationFunction – Processes messages with the Amazon Bedrock agent
    • IAM roles:
      • MessageVerificationFunctionRole – Role for MessageVerificationFunction Lambda function permissions
      • SQSIntegrationFunctionRole – Role for SQSIntegrationFunction Lambda function permissions
      • BedrockAgentsIntegrationFunctionRole – Role for BedrockAgentsIntegrationFunction Lambda function permissions
    • SQS queues:
      • ProcessingQueue – FIFO queue for ordered message processing
      • DeadLetterQueue – FIFO queue for failed message handling
    • Secrets Manager secret:
      • SlackBotTokenSecret – Stores Slack credentials securely

    Choose Launch Stack to deploy these resources:

    cloudformation-launch-stack-slack-bedrockagent-integration

    Provide your preferred stack name. When deploying the CloudFormation template, you’ll need to provide four values: the Slack bot user OAuth token, the signing secret from your Slack configuration, and the BedrockAgentId and BedrockAgentAliasID values saved earlier. If your agent is in draft version, use TSTALIASID as the BedrockAgentAliasID. Although our example uses a draft version, you can use the alias ID of your published version if you’ve already published your agent.

    Slack Integration CFN Deployment

    Keep SendAgentRationaleToSlack set to False by default. However, if you want to troubleshoot or observe how Amazon Bedrock Agents processes your questions, you can set this to True. This way, you can receive detailed processing information in the Slack thread where you invoked the Slack application.

    When deployment is complete, navigate to the Outputs tab and copy the WebhookURL value. Save this to your notepad to use in your Slack configuration in the next step.

    Slack Integration CFN Output

    Integrate Amazon Bedrock Agents with your Slack workspace

    Complete the following steps to integrate Amazon Bedrock Agents with your Slack workspace:

    1. Go to Slack API and choose the virtual-meteorologist application

    Slack Select Your Apps

    1. In the navigation pane, choose Event Subscriptions
    2. On the Event Subscriptions page, turn on Enable Events
    3. Enter your previously copied API Gateway URL for Request URL—verification will happen automatically
    4. For Subscribe to bot events, select Add Bot User Event button and add app_mention and message.im
    5. Choose Save Changes
    6. Choose Reinstall your app and choose Allow on the following page

    Slack Event Subscriptions

    Test the Amazon Bedrock Agents bot application in Slack

    Return to Slack and locate virtual-meteorologist in the Apps section. After you add this application to your channel, you can interact with the Amazon Bedrock agent by using @virtual-meteorologist to get weather information.

    Slack Add App

    Let’s test it with some questions. When we ask about today’s weather in Chicago, the application first sends a “🤔 Processing your request…” message as an initial response. After the Amazon Bedrock agent completes its analysis, this temporary message is replaced with the actual weather information.

    Slack First Question

    You can ask follow-up questions within the same thread, and the Amazon Bedrock agent will maintain the context from your previous conversation. To start a new conversation, use @virtual-meteorologist in the main channel instead of the thread.

    Slack Followup Quesiton

    Clean up

    If you decide to stop using this solution, complete the following steps to remove it and its associated resources deployed using AWS CloudFormation:

    1. Delete the Slack integration CloudFormation stack:
      • On the AWS CloudFormation console, choose Stacks in the navigation pane
      • Locate the stack you created for the Slack integration for Amazon Bedrock Agents during the deployment process (you assigned a name to it)
      • Select the stack and choose Delete
    2. If you deployed the sample Amazon Bedrock agent (virtual-meteorologist), repeat these steps to delete the agent stack

    Considerations

    When designing serverless architectures, separating Lambda functions by purpose offers significant advantages in terms of maintenance and flexibility. This design pattern allows for straightforward behavior modifications and customizations without impacting the overall system logic. Each request involves two Lambda functions: one for token validation and another for SQS payload processing. During high-traffic periods, managing concurrent executions across both functions requires attention to Lambda concurrency limits. For use cases where scaling is a critical concern, combining these functions into a single Lambda function might be an alternative approach, or you could consider using services such as Amazon EventBridge to help manage the event flow between components. Consider your use case and traffic patterns when choosing between these architectural approaches.

    Summary

    This post demonstrated how to integrate Amazon Bedrock Agents with Slack, a widely used enterprise collaboration tool. After creating your specialized Amazon Bedrock Agents, this implementation pattern shows how to quickly integrate them into Slack, making them readily accessible to your users. The integration enables AI-powered solutions that enhance user experience through contextual conversations within Slack, improving the quality of support and driving user adoption. You can follow this implementation approach to provide the solution to your Slack users in use cases where quick access to AI-powered insights would benefit team workflows. By integrating custom AI agents, organizations can track improvements in KPIs such as mean time to resolution (MTTR), first-call resolution rates, and overall productivity gains, showcasing the practical benefits of Amazon Bedrock Agents in enterprise collaboration settings.

    We provided a sample agent to help you test and deploy the complete solution. Organizations can now quickly implement their Amazon Bedrock agents and integrate them into Slack, allowing teams to access powerful generative AI capabilities through a familiar interface they use daily. Get started today by developing your own agent using Amazon Bedrock Agents.

    Additional resources

    To learn more about building Amazon Bedrock Agents, refer to the following resources:

    • Build a FinOps agent using Amazon Bedrock with multi-agent capability and Amazon Nova as the foundation model
    • Building a virtual meteorologist using Amazon Bedrock Agents
    • Build a gen AI–powered financial assistant with Amazon Bedrock multi-agent collaboration

    About the Authors

    Salman AhmedSalman Ahmed is a Senior Technical Account Manager in AWS Enterprise Support. He specializes in guiding customers through the design, implementation, and support of AWS solutions. Combining his networking expertise with a drive to explore new technologies, he helps organizations successfully navigate their cloud journey. Outside of work, he enjoys photography, traveling, and watching his favorite sports teams.

    Sergio BarrazaSergio Barraza is a Senior Technical Account Manager at AWS, helping customers on designing and optimizing cloud solutions. With more than 25 years in software development, he guides customers through AWS services adoption. Outside work, Sergio is a multi-instrument musician playing guitar, piano, and drums, and he also practices Wing Chun Kung Fu.

    Ravi KumarRavi Kumar is a Senior Technical Account Manager in AWS Enterprise Support who helps customers in the travel and hospitality industry to streamline their cloud operations on AWS. He is a results-driven IT professional with over 20 years of experience. In his free time, Ravi enjoys creative activities like painting. He also likes playing cricket and traveling to new places.

    Ankush GoyalAnkush Goyal is a Enterprise Support Lead in AWS Enterprise Support who helps customers streamline their cloud operations on AWS. He is a results-driven IT professional with over 20 years of experience.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleMeta Researchers Introduced J1: A Reinforcement Learning Framework That Trains Language Models to Judge With Reasoned Consistency and Minimal Data
    Next Article Secure distributed logging in scalable multi-account deployments using Amazon Bedrock and LangChain

    Related Posts

    Machine Learning

    This AI Paper Introduces MathCoder-VL and FigCodifier: Advancing Multimodal Mathematical Reasoning with Vision-to-Code Alignment

    May 22, 2025
    Machine Learning

    Technology Innovation Institute TII Releases Falcon-H1: Hybrid Transformer-SSM Language Models for Scalable, Multilingual, and Long-Context Understanding

    May 22, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    LinkedIn Job Scams Are the Latest Cyber Threat – Don’t Fall for Fake Recruiters

    Development

    Build a Full Stack App with Next.js and Strapi

    Development

    Goodnotes Finds Marketplace Success Using MongoDB Atlas

    Databases

    Start a Creative Venture With No Money

    Development

    Highlights

    Development

    Intel Labs Introduce RAG Foundry: An Open-Source Python Framework for Augmenting Large Language Models LLMs for RAG Use Cases

    August 8, 2024

    Open-source libraries facilitated RAG pipeline creation but lacked comprehensive training and evaluation capabilities. Proposed frameworks…

    Irasema Fernandez Leverages Marketing Expertise to Grow Latin America Experience Design Practice

    May 13, 2025

    With KB5055518, Windows 10 finally fixes a basic File Explorer issue

    April 9, 2025

    Some Generative AI Company Employees Pen Letter Wanting ‘Right to Warn’ About Risks

    June 6, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.