This page describes how to connect Slack to Agentspace Enterprise. The connector supports both data ingestion and federated search. See the section for the approach you plan to use:
Connect Slack (data ingestion)
After you set up your data source and import data the first time, the data store syncs data from that source at a frequency that you select during setup.
Before you begin
Before setting up your connection:
Set up access control for your data source. For information about setting up access control, see Use data source access control.
To follow the steps in Configure your Slack app, you must have the permissions to install new apps in your workspace, that's included in the Workspace Owner role. Contact your Workspace Primary Owner to be assigned as a Workspace Owner.
Understand that by default, Slack restricts crawling and syncing content from private channels, group messages, and direct messages.
Configure the Slack app
The Slack connector requires an access token to be able to ingest documents from your Slack workspace. To obtain an access token to allow Agentspace Enterprise to ingest documents from your Slack workspace.
For more information, see [Quickstart][slack-quickstart] and [How to quickly get and use a Slack API token][slack-token] in the Slack documentation.
There are two different types of tokens you can use:
- Bot token
- Benefits:
- It's not tied to a specific user.
- It can have a more secure access to private Slack channels, instant messages (IM), and multi-person instant messages (MPIM). The members involved in those channels and messages can invite the bot.
- The bot can also be invited to public channels. When configuring the
bot token, you can add the
channels:join
permission for the crawler to automatically attempt to join all public channels.
- Limitations:
- When the bot attempts to join public channels, a join message is sent to the channel.
- Benefits:
- User token
- Benefits:
- It can access all public channels without the need to join them beforehand.
- Limitations:
- It's tied to a specific user.
- With user token, users can't crawl private channels, IMs, and MPIMs that they're not a part of.
- Benefits:
Configure bot token
The following steps show you how to configure a bot token:
- Sign in to Slack API Apps.
- Click Create new app.
Create new app in Slack App - Select From scratch. This option lets you configure the app's
information, scopes, settings, and features.
Start creating the app from scratch - Enter a name for your app. The name you select is visible to all Slack users.
- Select the workspace for integration.
Because you can't change an app's workspace later, ensure that you select the
correct workspace.
Enter a name and select the correct workspace - Click Create app.
- In the sidebar, select OAuth & permissions.
OAuth & Permissions in the Slack app's sidebar - Under Bot token scopes, add the following required scopes:
#general
and#random
channels.Select the scopes for the bot token
By default, the bot reads from the - To enable the bot to crawl the channels, do the following:
- For public channels, do one of the following:
- Invite the bot manually.
- Grant the
channels:join
scope to allow the bot to attempt join automatically.
- For private channels, invite the bot manually.
- For public channels, do one of the following:
- On the same page, click Install to WORKSPACE_NAME.
Install the app in your workspace - Follow the on-screen instructions to install the app and after the app is
installed, copy and note the bot's OAuth token.
Copy the bot's OAuth token
Configure a user token
The following steps show you how to configure a bot token:
- Sign in to Slack API Apps.
- Click Create new app.
Create new app in Slack App - Select From scratch. This option lets you configure the app's
information, scopes, settings, and features.
Start creating the app from scratch - Enter a name for your app. The name you select is visible to all Slack users.
- Select the workspace for integration.
Because you can't change an app's workspace later, ensure that you select the
correct workspace.
Enter a name and select the correct workspace - Click Create app.
- In the sidebar, select OAuth & permissions.
OAuth & Permissions in the Slack app's sidebar - Under User token scopes, add the following required scopes:
Select the scopes for the user token - On the same page, click Install to WORKSPACE_NAME.
Install the app in your workspace - Follow the on-screen instructions to install the app and after the app is
installed, copy and note your user OAuth token.
Copy the user's OAuth token
Create a Slack Cloud connector
Console
To use the Google Cloud console to sync data from Slack to Agentspace Enterprise, follow these steps:
In the Google Cloud console, go to the Agentspace page.
In the navigation menu, click Data stores.
Click
Create data store.In the Google Cloud console, create a data store On the Select a data source page, scroll or search for Slack to connect your third-party source.
Enter your Slack authentication information.
- Instance ID (Workspace ID):
- To obtain your workspace ID, sign in to your Slack workspace using a web browser. Don't use the Slack app. For more information, see [Specify the Slack source for your data store][slack-workspace-id].
- In the URL, note the unique workspace ID, which is the string after
/client
beginning with T.Obtain the instance ID (workspace ID)
- Auth token: Use the token obtained from the last when you generated the bot token or the user token.
- Instance ID (Workspace ID):
Select which entities to sync and click Continue.
- To crawl all channels, retain the default selections.
- To crawl specific channels, click Filter and select the channels.
The following image shows an example configuration that allows crawling
of channels named
general
andrandom
.Select the channels to crawl
Select a region for your data store.
Enter a name for your data store.
Select a synchronization frequency for your data store.
Click Create. Agentspace Enterprise creates your data store and displays your data stores on the Data stores page.
To check the status of your ingestion, go to the Data stores page and click your data store name to see details about it on its Data page. The Connector state changes from Creating to Running when it starts synchronizing data. When ingestion is complete, the state changes to Active to indicate that the connection to your data source is set up and awaiting the next scheduled synchronization.
Depending on the size of your data, ingestion can take minutes or hours.
Next steps
To attach your data store to an app, create an app and select your data store following the steps in Create an app.
To preview how your search results appear after your app and data store are set up, see Preview search results. If you used third-party access control, see Preview results for apps with third-party access control.
To enable alerts for the data store, see Configure alerts for third-party data stores.
Connect Federated Search with Slack
Use the following procedure to search through your Slack account using federated search.
About federated search
You can use federated search connectors to send your queries to third-party search APIs instead of ingesting and indexing all data into Agentspace Enterprise. Using this approach, you can access external data sources immediately, without waiting for ingestion.
However, this approach might not be suitable in all scenarios. While federated search is quick to set up, it has the following limitations:
- Compared to indexed data, federated search may deliver lower-quality results.
- Federated search may introduce higher latency, because it depends on the third-party search API.
- Not all connectors support federated search.
Before you begin
To configure the Slack connector, make sure to have the following:
- Access to the Slack API Apps and permission to create and configure apps in your Slack workspace.
- A Google Cloud project with Agentspace Enterprise enabled.
- The IAM roles to create and manage data stores in Agentspace Enterprise.
- The client ID and client secret for your Slack app ready.
- Your organization that allows integration with third-party data sources.
A new data source appears in each user's Agentspace Enterprise and requires authorization by each user before use.
Configure the Slack App
- Go to the Slack API Apps page and sign in.
Click Create new app.
Create new app Select From scratch to configure your app manually.
Select from scratch Enter a name for your app (visible to Slack users).
Select the correct workspace for integration. You cannot change this later.
Click Create app.
Select workspace
Set up OAuth and permissions
- Click OAuth & permissions.
- Under Redirect URLs, add the following URLs:
https://vertexaisearch.cloud.google.com/console/oauth/default_oauth.html
https://vertexaisearch.cloud.google.com/oauth-redirect
Under Advanced token security via token rotation, click Opt in.
Select opt in
Retrieve client credentials
- Click Basic information.
Note down the Client ID and Client secret.
Retrieve client credentials
Create a federated search connector with Slack
Console
Use the following steps for Google Cloud console to perform federated search through Slack from Agentspace Enterprise.
In the Google Cloud console, go to the Agentspace page.
In the navigation menu, click Data stores.
Click
Create data store.On the Select a data source page, scroll or search for Slack Federated to connect your third-party source.
Select Slack federated Under Authentication settings:
- Enter the Client ID and Client secret.
- Click Authenticate.
- Click Continue.
Select which entities to sync and click Continue.
Choose a region for your data store.
Enter a name for your data store.
Click Create. Agentspace Enterprise creates your data store and displays your data stores on the Data stores page.
Once the data store is created, go to the Data stores page and click your data store name to see the status. If the Connector state changes from Creating to Active, the federated search connector is ready to be used.