{"id":1968,"date":"2022-03-15T19:54:47","date_gmt":"2022-03-15T19:54:47","guid":{"rendered":"https:\/\/salarydistribution.com\/machine-learning\/2022\/03\/15\/unravel-the-knowledge-in-slack-workspaces-with-intelligent-search-using-the-amazon-kendra-slack-connector\/"},"modified":"2022-03-15T19:54:47","modified_gmt":"2022-03-15T19:54:47","slug":"unravel-the-knowledge-in-slack-workspaces-with-intelligent-search-using-the-amazon-kendra-slack-connector","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2022\/03\/15\/unravel-the-knowledge-in-slack-workspaces-with-intelligent-search-using-the-amazon-kendra-slack-connector\/","title":{"rendered":"Unravel the knowledge in Slack workspaces with intelligent search using the Amazon Kendra Slack connector"},"content":{"rendered":"<div id=\"\">\n<p>Organizations use messaging platforms like <a href=\"https:\/\/slack.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Slack<\/a> to bring the right people together to securely communicate with each other and collaborate to get work done. A Slack workspace captures invaluable organizational knowledge in the form of the information that flows through it as the users collaborate. However, making this knowledge easily and securely available to users is challenging due to the fragmented structure of Slack workspaces. Additionally, the conversational nature of Slack communication renders a traditional keyword-based approach to search ineffective.<\/p>\n<p>You can now use the <a href=\"https:\/\/aws.amazon.com\/kendra\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Kendra<\/a> Slack connector to index Slack messages and documents, and search this content using intelligent search in Amazon Kendra, powered by machine learning (ML).<\/p>\n<p>This post shows how to configure the Amazon Kendra Slack connector and take advantage of the service\u2019s intelligent search capabilities. We use an example of an illustrative Slack workspace used by members to discuss technical topics related to AWS.<\/p>\n<h2>Solution overview<\/h2>\n<p>Slack workspaces include public channels where any workspace user can participate, and private channels where only those users who are members of these channels can communicate with each other. Furthermore, individuals can directly communicate with one another in one-on-one and ad hoc groups. This communication is in the form of messages and threads of replies, with optional document attachments. Slack workspaces of active organizations are dynamic, with its content and collaboration evolving continuously.<\/p>\n<p>In our solution, we configure a Slack workspace as a data source to an Amazon Kendra search index using the Amazon Kendra Slack connector. Based on the configuration, when the data source is synchronized, the connector either crawls and indexes all the content from the workspace that was created on or before a specific date, or can optionally be based on a look back parameter in a change log mode. The look back parameter lets you crawl the date back a number of days since the last time you synced your data source. The connector also collects and ingests Access Control List (ACL) information for each indexed message and document. When access control or user context filtering is enabled, the search results of a query made by a user includes results only from those documents that the user is authorized to read.<\/p>\n<h2>Prerequisites<\/h2>\n<p>To try out the Amazon Kendra connector for Slack using this post as a reference, you need the following:<\/p>\n<h2>Configure your Slack workspace<\/h2>\n<p>The following screenshot shows our example Slack workspace:<br \/><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image001.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34031\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image001.jpg\" alt=\"\" width=\"1021\" height=\"823\"><\/a><\/p>\n<p>The workspace has five users as members: Workspace Admin, Generic User, DB Solutions Architect, ML Solutions Architect, and Solutions Architect. There are three public channels, #general, #random, and #test-slack-workspace, which any member can access. Regarding the secure channels, #databases has Workspace Admin and DB Solutions Architect as members, #machine-learning has Workspace Admin and ML Solutions Architect as members, and #security and #well-architected secure channels have Solutions Architect, DB Solutions Architect, ML Solutions Architect, and Workspace Admin as members. The <code>connector-test<\/code> app is configured in the Slack workspace in order to create a user OAuth token to be used in configuring the Amazon Kendra connector for Slack.<\/p>\n<p>The following screenshot shows the configuration details of the <code>connector-test<\/code> app OAuth tokens for the Slack workspace. We use the user OAuth token in configuring the Amazon Kendra connector for Slack.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image003.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34032\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image003.jpg\" alt=\"\" width=\"1100\" height=\"931\"><\/a><\/p>\n<p>In the <strong>User Token Scopes<\/strong> section, we configure the <code>connector-test<\/code> app for the Slack workspace.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image005.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34033\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image005.jpg\" alt=\"\" width=\"742\" height=\"936\"><\/a><\/p>\n<h2>Configure the data source using the Amazon Kendra connector for Slack<\/h2>\n<p>To add a data source to your Amazon Kendra index using the Slack connector, you can use an existing Amazon Kendra index, or <a href=\"https:\/\/docs.aws.amazon.com\/kendra\/latest\/dg\/create-index.html\" target=\"_blank\" rel=\"noopener noreferrer\">create a new Amazon Kendra index<\/a>. Then complete the steps below. For more information on this topic, please refer to the section on <a href=\"https:\/\/docs.aws.amazon.com\/kendra\/latest\/dg\/data-source-slack.html\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Kendra connector for Slack<\/a> in the <a href=\"https:\/\/docs.aws.amazon.com\/kendra\/latest\/dg\/what-is-kendra.html\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Kendra Developer Guide<\/a>.<\/p>\n<ol>\n<li>On the Amazon Kendra console, open the index and choose <strong>Data sources<\/strong> in the navigation pane.<\/li>\n<li>Under <strong>Slack<\/strong>, choose <strong>Add data source<\/strong>.<\/li>\n<li>Choose <strong>Add connector<\/strong>.<br \/><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image007.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34034\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image007.jpg\" alt=\"\" width=\"676\" height=\"729\"><\/a><\/li>\n<li>In the <strong>Specify data source details<\/strong> section, enter the details of your data source and choose <strong>Next<\/strong>.<\/li>\n<li>In the <strong>Define access and security<\/strong> section, for <strong>Slack workspace team ID<\/strong>, enter the ID for your workspace.<\/li>\n<li>Under <strong>Authentication<\/strong>, you can either choose <strong>Create <\/strong>to add a new secret using the user OAuth token created for the <code>connector-app<\/code>, or use an existing <a href=\"https:\/\/aws.amazon.com\/secrets-manager\/\" target=\"_blank\" rel=\"noopener noreferrer\">AWS Secrets Manager<\/a> secret that has the user OAuth token for the workspace that you want the connector to access.<\/li>\n<li>For <strong>IAM role<\/strong>, you can choose <strong>Create a new role<\/strong> or choose an existing IAM role configured with appropriate IAM policies to access the Secrets Manager secret, Amazon Kendra index, and data source.<\/li>\n<li>Choose <strong>Next<\/strong>.<br \/><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image009.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34035\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image009.jpg\" alt=\"\" width=\"1166\" height=\"827\"><\/a><\/li>\n<li>In the <strong>Configure sync settings<\/strong> section, provide information regarding your sync scope and run schedule.<\/li>\n<li>Choose <strong>Next<\/strong>.<br \/><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image011.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34036\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image011.jpg\" alt=\"\" width=\"1161\" height=\"742\"><\/a><\/li>\n<li>In the <strong>Set field mappings<\/strong> section, you can optionally configure the field mappings, or how the Slack field names are mapped to Amazon Kendra attributes or facets.<\/li>\n<li>Choose <strong>Next<\/strong>.<\/li>\n<li>Review your settings and confirm to add the data source.<\/li>\n<\/ol>\n<p>When the data source sync is complete, the <strong>User access control<\/strong> tab for the Amazon Kendra index is enabled. Note that in order to use the ACLs for Slack connector, it\u2019s not necessary to enable <strong>User-group lookup through AWS SSO integration<\/strong>, though it is enabled in the following screenshot.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image013.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34037\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image013.jpg\" alt=\"\" width=\"1171\" height=\"255\"><\/a><\/p>\n<p>While making search queries, we want to interact with facets such as the channels of the workspace, category of the document, and the authors.<\/p>\n<ol start=\"14\">\n<li>Choose <strong>Facet definition<\/strong> in the navigation pane.<\/li>\n<li>Select the checkbox in the <strong>Facetable <\/strong>column for the facets <code>_authors<\/code>, <code>_category<\/code>, <code>sl_doc_channel_name<\/code>, and <code>sl_msg_channel_name<\/code>.<br \/><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image015.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34038\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image015.jpg\" alt=\"\" width=\"1156\" height=\"770\"><\/a><\/li>\n<\/ol>\n<h2>Search with Amazon Kendra<\/h2>\n<p>Now we\u2019re ready to make a few queries on the Amazon Kendra search console by choosing <strong>Search indexed content<\/strong> in the navigation pane.<\/p>\n<p>In the first query, the user name is set to the email address of Generic User. The following screenshot shows the query response. Note that we get an answer from the aws-overview.pdf document posted in #general channel, followed by a few results from relevant documents or messages. The facets show the categories of the results to be <code>MESSAGE<\/code> and <code>FILE<\/code>. The <code>sl_doc_channel_name<\/code> facet includes the information that the document is from #general channel, the <code>sl_msg_channel_name<\/code> includes the information that there are results from all the open channels (namely #random, #general, and #test-slack-workspace), and the <code>authors<\/code> facet includes the names of the authors of the messages.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image019.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34040\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image019.jpg\" alt=\"\" width=\"733\" height=\"762\"><\/a><\/p>\n<p>Now let\u2019s set the user name to be the email address corresponding to the user Solutions Architect. The following screenshot shows the query response. In addition to the public channels, the results also include secure channels #security and #well-architected.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image017.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34039\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image017.jpg\" alt=\"\" width=\"721\" height=\"739\"><\/a><\/p>\n<p>In the next query, we set the user name to be the email address of the ML Solutions Architect. In this case, the results contain the category of <code>THREAD_REPLY<\/code> in addition to <code>MESSAGE<\/code> and <code>FILE<\/code>. Also, ML Solutions Architect can access the secure channel of #machine-learning.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image021.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34041\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image021.jpg\" alt=\"\" width=\"711\" height=\"811\"><\/a><\/p>\n<p>Now for the same query, to review what people have replied to the question, select the <code>THREAD_REPLY<\/code> category on the left to refine the results. The response now contains only those results that are of the <code>THREAD_REPLY<\/code> category.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image023.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34042\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image023.jpg\" alt=\"\" width=\"710\" height=\"812\"><\/a><\/p>\n<p>The results from the response include the URL to the Slack message. When you choose the suggested answer result in the response, the URL asks for Slack workspace credentials, and opens the thread reply being referenced.<\/p>\n<p><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image025.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34043\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/09\/ML-8533-image025.jpg\" alt=\"\" width=\"1437\" height=\"948\"><\/a><\/p>\n<h2>Clean up<\/h2>\n<p>To avoid incurring future costs, clean up the resources you created as part of this solution. If you created a new Amazon Kendra index while testing this solution, delete it. If you only added a new data source using the Amazon Kendra connector for Slack, delete that data source.<\/p>\n<h2>Conclusion<\/h2>\n<p>Using the Amazon Kendra Slack connector organizations can make invaluable information trapped in their Slack workspaces available to their users securely using intelligent search powered by Amazon Kendra. Additionally, the connector provides facets for Slack workspace attributes such as channels, authors, and categories for the users to interactively refine the search results based on what they\u2019re looking for.<\/p>\n<p>To learn more about the Amazon Kendra connector for Slack, please refer to the section on <a href=\"https:\/\/docs.aws.amazon.com\/kendra\/latest\/dg\/data-source-slack.html\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Kendra connector for Slack<\/a> in the <a href=\"https:\/\/docs.aws.amazon.com\/kendra\/latest\/dg\/what-is-kendra.html\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Kendra Developer Guide<\/a>.<\/p>\n<p>For more information on how you can create, modify, or delete metadata and content when ingesting your data from the Slack workspace, refer to <a href=\"https:\/\/docs.aws.amazon.com\/kendra\/latest\/dg\/custom-document-enrichment.html\" target=\"_blank\" rel=\"noopener noreferrer\">Customizing document metadata during the ingestion process<\/a> and <a href=\"https:\/\/aws.amazon.com\/blogs\/machine-learning\/enrich-your-content-and-metadata-to-enhance-your-search-experience-with-custom-document-enrichment-in-amazon-kendra\/\" target=\"_blank\" rel=\"noopener noreferrer\">Enrich your content and metadata to enhance your search experience with custom document enrichment in Amazon Kendra<\/a>.<\/p>\n<hr>\n<h3>About the Author<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-20223 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2020\/12\/24\/Abhinav-Jawadekar.jpg\" alt=\"Abhinav Jawadekar\" width=\"100\" height=\"133\"><strong>Abhinav Jawadekar<\/strong> is a Senior Partner Solutions Architect at Amazon Web Services. Abhinav works with AWS Partners to help them in their cloud journey.<\/p>\n<p>       <!-- '\"` -->\n      <\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/aws.amazon.com\/blogs\/machine-learning\/unravel-the-knowledge-in-slack-workspaces-with-intelligent-search-using-the-amazon-kendra-slack-connector\/<\/p>\n","protected":false},"author":0,"featured_media":1969,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1968"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=1968"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/1968\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/1969"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=1968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=1968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=1968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}