Amazon Q Business is a fully managed, generative AI-powered assistant that you can configure to answer questions, provide summaries, generate content, and complete tasks based on your enterprise data. Amazon Q Business offers over 40 built-in connectors to popular enterprise applications and document repositories, including Amazon Simple Storage Service (Amazon S3), Salesforce, Google Drive, Microsoft 365, ServiceNow, Gmail, Slack, Atlassian, and Zendesk and can help you create your generative AI solution with minimal configuration.
Nearly 100 thousand organizations use Slack to bring the right people together to securely collaborate with each other. A Slack workspace captures invaluable organizational knowledge in the form of the information that flows through it as the users communicate on it. Hence, it is valuable to make this knowledge quickly and securely available to the users.
In this post, we will demonstrate how to set up Slack connector for Amazon Q Business to sync communications from both public and private channels, reflective of user permissions. We will also guide you through the configurations needed on your Slack workspace. Additionally, you will learn how to configure the Amazon Q Business application and enable user authentication through AWS IAM Identity Center, which is a recommended service for managing a workforce’s access to AWS applications.
Amazon Q Business uses large language models (LLMs) to build a unified solution that connects multiple data sources. Typically, you’d need to use a natural language processing (NLP) technique called Retrieval Augmented Generation (RAG) for this. With RAG, generative AI enhances its responses by incorporating relevant information retrieved from a curated dataset. Amazon Q Business has a built-in managed RAG capability designed to reduce the undifferentiated heavy lifting involved in creating these systems. Typical of a RAG model, Amazon Q Business has two components: A retrieval component that retrieves relevant documents for the user query and a generation component that takes the query and the retrieved documents and then generates an answer to the query using an LLM.
A Slack workspace has multiple elements. It has public channels where workspace users can participate and private channels where only channel members can communicate with each other. Individuals can also directly communicate with each other in one-on-one conversations and in user groups. This communication is in the form of messages and threads of replies, with optional document attachments. Slack workspaces of active organizations are highly dynamic, with the content and collaboration evolving and growing in volume continuously.
The preceding figure shows the process flow of the solution. When you connect Amazon Q Business to a data source (in this case, Slack), what Amazon Q considers and crawls as a document varies by connector. For the Amazon Q Business Slack connector, each message, message attachment and channel post is considered a single document, However, Slack conversation threads that help you create organized discussions around specific messages are also considered and ingested as a single document, regardless of the number of participants or messages they contain.
Amazon Q Business crawls access control list (ACL) information attached to a document (user and group information) from your Slack instance. This information can be used to filter chat responses to the user’s document access level. The Slack connector supports token-based authentication. This could be a Slack bot user OAuth token or Slack user OAuth token. See the Slack connector overview to get the list of entities that are extracted, supported filters, sync modes, and file types.
User IDs (_user_id
) exist in Slack on messages and channels where there are set access permissions. They are mapped from the user emails as the IDs in Slack.
To connect your data source connector to Amazon Q Business, you must give Amazon Q Business an IAM role that has the following permissions:
BatchPutDocument
and BatchDeleteDocument
operations to ingest documents.In this solution, we will show you how to create a Slack workspace with users who perform various roles within the organization. We will then show you how to configure this workspace to define a set of scopes that are required by the Amazon Q Business Slack connector to index the user communication. This will be followed by the configuration of the Amazon Q Business application and a Slack data source. Based on the configuration, when the data source is synchronized, the connector either crawls and indexes the content from the workspace that was created on or before a specific date. The connector also collects and ingests ACL information for each indexed message and document. Thus, the search results of a query made by a user includes results only from those documents that the user is authorized to read.
To build the Amazon Q Business connector for Slack, you need the following:
In Slack:
https://app.slack.com/client/T0123456789/...
where T0123456789
is the team ID.In your AWS account:
You will create one user for each of the following roles: Administrator, Data scientist, Database administrator, Solutions architect and Generic.
User name | Role |
arnav_desai | Admin |
jane_doe | Data Scientist |
pat_candella | DB Admin |
mary_major | Solutions Architect |
john_stiles | Generic User |
To showcase the ACL propagation, you will create three public channels, #general
, #customerwork
, and #random
, that any member can access including the Generic user. Also, one private channel, #anydepartment-project-private
, that can be accessed only by the users arnav_desai
, john_stiles
, mary_major
, and pat_candella
.
To create a Slack app:
Note: You can configure two types of scopes in a Slack workspace:
For this example, so you can search on the conversations between users, you will use the user token scope.
In this section, you will create an Amazon Q Business application using the console.
my-slack-workspace
. Leave the Service access as the default value, and select AWS IAM Identity Center for Access Management . Enter a new Tag value as required and choose Create to the Amazon Q Business Application.Now, you’re ready to make a few queries in Amazon Q Business.
#customerwork
Slack channel is being used to communicate about an upcoming customer engagement, as shown in the following figure.Note that the response includes citations that refer to the conversation as well as the content of the PDF that was attached to the conversation.
Next, you will create a private channel called #anydepartment-project-private with four out of the five users—arnav_desai
, john_stiles
, mary_major
and pat_candella
—and verify that the messages exchanged in a private channel are not available to non-members like jane_doe
. Note that after you create a new private channel, you need to manually re-run the sync on the data source.
The below screenshot shows the private slack channel with four out of five users and the slack conversation.
Slack organizes conversations into threads, which can involve multiple users and messages. The Amazon Q Business Slack connector treats each thread as a single document, regardless of the number of participants or messages it contains. This approach allows Amazon Q Business to ingest entire conversation threads as individual units, maximizing the amount of data that can be processed within a single index unit. As a result, you can efficiently incorporate more comprehensive conversational context into your Amazon Q Business system.
The figure that follows shows a conversation between pat_candella
and jane_doe
that includes six messages in a thread. The Slack connector aggregates this message thread as a single message, thus maximizing the use of an index unit.
Because the conversation thread is aggregated as a single document within the Amazon Q Business index, you can ask questions that pertain to a single conversation thread as shown in the following figure.
If you aren’t getting answers to your questions from Amazon Q Business, verify the following:
See Troubleshooting Amazon Q Business identity and access to diagnose and fix common issues that you might encounter when working with Amazon Q and IAM.
Amazon Q Business supports crawling ACLs for document security by default. Turning off ACLs and identity crawling are no longer supported. If you want to index documents without ACLs, ensure that the documents are marked as public in your data source. Please refer to the official documentation, How Amazon Q Business connector for crawls Slack ACLs.
Amazon Q Business provides visibility into the data sync operations. Learn more about this feature in the AWS Machine Learning blog.
Additionally, as the sync process runs, you can monitor progress or debug failures by monitoring the Amazon CloudWatch logs that can be accessed from the Details section of the Sync run history.
A sample query to determine which documents or messages were indexed from a specific slack channel, C12AB34578
, and logStream
of SYNC_RUN_HISTORY_REPORT/xxxxxxxxxxxxxxxxxxxxxxxx
would look like the following:
Choosing Run query displays the list of messages as the Amazon Q Business Index sync runs, as shown in the following figure.
To delete an Amazon Q Business application, you can use the console or the DeleteApplication API operation.
To delete an Amazon Q Business application using the console
Delete
to confirm deletion, and then choose Delete.To delete the IAM Identity Center instance, see Delete your IAM Identity Center instance.
This blog post provides a step-by-step guide on setting up the Slack connector for Amazon Q Business, enabling you to seamlessly integrate data from your Slack workspace. Moreover, we highlighted the importance of data privacy and security, demonstrating how the connector adheres to the ACLs within your Slack workspace. This feature helps ensure that private channel conversations remain confidential and inaccessible to individuals who aren’t members of those channels. By following these steps and understanding the built-in security measures, you can use the power of Amazon Q Business while maintaining the integrity and privacy of your Slack workspace.
To learn more about the Amazon Q Business connector for Slack, see Connecting Slack to Amazon Q Business. You can automate all the showcased console operations through Amazon Q Business API’s, the AWS CLI and other applicable AWS SDKs.
If you choose to converse with Amazon Q Business using Slack direct messages (DMs) to ask questions and get answers based on company data or to get help creating new content such as email drafts, summarize attached files, and perform tasks, see Deploy a Slack gateway for Amazon Q, your business expert for information about how to bring Amazon Q, your business expert, to users in Slack.
TL;DR A conversation with 4o about the potential demise of companies like Anthropic. As artificial…
Whether a company begins with a proof-of-concept or live deployment, they should start small, test…
Digital tools are not always superior. Here are some WIRED-tested agendas and notebooks to keep…
Machine learning (ML) models are built upon data.
Editor’s note: This is the second post in a series that explores a range of…
David J. Berg*, David Casler^, Romain Cledat*, Qian Huang*, Rui Lin*, Nissan Pow*, Nurcan Sonmez*,…