Slack Integration¶
Overview¶
The Slack Integration serves as a bridge between your internal messaging platform and Dataiku’s Generative AI capabilities. It allows users to interact with Dataiku Agents and LLMs directly within their Slack workspace, enabling seamless access to data insights and automated responses in both direct messages and channels.
Key Features
Interactive Bot: Chat directly with Agents configured in Dataiku.
Socket Mode: Secure connection without exposing public endpoints.
Multi-channel Support: Works in DMs and public/private channels (dependent on slack app permissions).
Setup¶
Pre-requisites¶
The Slack Integration is provided by the “Agents on Slack” plugin, which you must install. Please see Installing plugins
You will need administrative access to a Slack Workspace alongside write permission in a Dataiku Project and code execution permission to configure the integration.
The Slack Integration uses a webapp in DSS, with the backend connecting to Slack and relaying messages back & forth between Slack and the Agent. The backend must be running to process events. Enable auto-start backend in the edit tab to ensure it runs automatically.
DSS needs to have outbound network access to api.slack.com and wss://wss-primary.slack.com.
This section details the setup of the Slack App, the generation of necessary tokens, and the configuration of the Dataiku Webapp backend to establish the connection.
Create a Slack App¶
Navigate to https://api.slack.com/apps and create a new app. This is the app that you will later install into your Slack workspace to interact with the Dataiku Agent or LLM.
You can configure the app yourself or use our pre-configured defaults using a manifest.
Option 1: Quick Start (Manifest)¶
Use this manifest to create a pre-configured app. You can change the display names and descriptions to match your use case in the JSON, or configure that after the app creation.
{
"display_information": {
"name": "Dataiku Agent App",
"description": "App to interact with a Dataiku Agent through a bot.",
"background_color": "#1c2a38",
"long_description": "I'm a bot to interact with a Dataiku Agent. You can talk to me in direct messages or mention me in a channel I'm part of. I will reply in the same thread or start one and consider the thread as part of our conversation."
},
"features": {
"app_home": {
"home_tab_enabled": true,
"messages_tab_enabled": true,
"messages_tab_read_only_enabled": false
},
"bot_user": {
"display_name": "Dataiku Agent",
"always_online": true
}
},
"oauth_config": {
"scopes": {
"bot": [
"app_mentions:read",
"channels:history",
"chat:write",
"files:read",
"files:write",
"im:history",
"incoming-webhook",
"mpim:history",
"reactions:write",
"users:read"
]
}
},
"settings": {
"event_subscriptions": {
"bot_events": [
"app_home_opened",
"app_mention",
"message.im"
]
},
"interactivity": {
"is_enabled": true
},
"org_deploy_enabled": false,
"socket_mode_enabled": true,
"token_rotation_enabled": false
}
}
Option 2: Standard Setup (From Scratch)¶
To configure your app manually, these are the settings required for the integration to function correctly:
1. Enable Socket Mode
In the left sidebar, select Socket Mode.
Toggle Enable Socket Mode to ON if not enabled.
2. Configure Event Subscriptions
In the left sidebar, select Event Subscriptions.
Under Subscribe to bot events, select Add Bot User Event and add the following events:
Event Name |
Description |
Required Scope |
|---|---|---|
|
User opened the App Home on Slack |
none |
|
Subscribe to only the message events that mention your app or bot |
|
|
A message was posted in a direct message channel |
|
Generate an App Level Token¶
You need to generate an app-level token to enable socket mode.
Go to api.slack.com/apps, find your Slack app for this integration.
In the left sidebar select “Basic Information”.
Navigate to App-Level Tokens and select “Generate Token and Scopes”.
Enter a name for the token and add the
connections:writescope.Copy the App-Level Token (starts with
xapp-) to configure in the Dataiku Slack Webapp later.
Thanks to Socket Mode, you do NOT need to configure the Events API URL nor expose your Dataiku instance.
Important
Each app-level token can only be used by one Dataiku WebApp on one Dataiku node. Sharing a token across multiple instances causes missing messages, as Slack randomly distributes events among connections.
Install the Slack App to your Slack Workspace¶
After configuring the bot and permissions, select “Install App”.
Select “Install to (Workspace)” to add your app to your Slack workspace.
Authorize the requested permissions when prompted.
Copy the Bot-User OAuth Token (starts with
xoxb-) to configure in the Dataiku Slack Webapp later.
Note
Since this installation uses socket mode, it is for internal workspace use only, the Slack app cannot be publicly distributed.
Create and Configure the Visual Webapp in Dataiku¶
In the webapp edit tab, configure the following:
Bot User OAuth Token: (From the Slack App Install App or OAuth & Permissions Menu)
App-Level Token: (From the Slack App Socket Mode Menu)
Select the Dataiku LLM to use for generating responses.
Select “Save” to apply your configurations.
When you save the webapp, the backend should automatically start. You’ll see a notification indicating the backend is starting.
If the backend doesn’t start automatically:
Go to the “Actions” panel on the right side of the screen.
Select “Start backend” to manually start it.
Test the Integration¶
In Slack:
Send a Direct Message to your bot.
@mention your bot in a channel it has joined.
In both cases, the bot should respond with a message from your configured Agent/LLM.
Adding Bots to Channels¶
After installation, your bot does not automatically have access to all channels.
You must explicitly invite your bot to channels, e.g. using
/invite @your_bot_name.For the bot to be usable in private channels, your app needs the
groups:historyandgroups:readpermissions.Unless added to a channel, the bot won’t see messages or be able to respond in that channel.