
- Listens for mentions in Slack channels
- Processes questions using the same agent as the web chat interface
- Returns answers with SQL queries, data tables, and visualizations
- Maintains conversation context within Slack threads
The Slack bot uses the same agent context, rules, and capabilities as your web chat interface. Any improvements to your agent automatically benefit Slack users.
Setup
Step 1: Create a Slack App
- Go to https://api.slack.com/apps/
- Click âCreate New Appâ
- Select âFrom scratchâ
- Name your app (e.g., ânao-chatâ)
- Select your workspace
- Click âCreate Appâ
Step 2: Configure Bot Scope
- In your Slack app settings, go to âOAuth & Permissionsâ
- Scroll to âBot Token Scopesâ
- Add the following scopes:
app_mentions:read- To receive mentions of your botchat:write- To send messages to Slack
Step 3: Install App to Workspace
- Still in âOAuth & Permissionsâ, scroll to the top
- Click âInstall to Workspaceâ
- Review permissions and click âAllowâ
Step 4: Connect your Slack Bot to nao Agent
Option 1: configuration within nao UI- From âOAuth & Permissionsâ page, copy the Bot User OAuth Token (starts with
xoxb-) - In nao UI, go to Settings / Project / Slack integration and paste the Bot Token
- In Slack interface, go to âBasic Informationâ in your app settings and copy the Signing Secret
- In nao UI, paste the signing secret
- From âOAuth & Permissionsâ page, copy the Bot User OAuth Token (starts with
xoxb-) - In Slack interface, go to âBasic Informationâ in your app settings and copy the Signing Secret
- Add these variables to your deployed container
Step 5: Configure Event & Interactions Subscriptions
- In nao UI, go to the Settings / Project / Slack integration You will see 2 urls: Event Subscriptions â Request URL and Interactivity & Shortcuts â Request URL
- Go to âEvent Subscriptionsâ in your app settings
- Enable âEnable Eventsâ
- Set the Request URL to the Event Subscriptions â Request URL from nao UI
Example:
- Under âSubscribe to bot eventsâ, add:
app_mentions- Listen for when users mention your bot
- Click âSave Changesâ
- Go to âInteractivity & Shortcutsâ in your app settings
- Enable âInteractivityâ
- Set the Request URL to Interactivity & Shortcuts â Request URL
Example:
- Click âSave Changesâ
Step 6: Add Bot to Channels
- In Slack, go to any channel where you want the bot
- Type
/invite @nao-chat(or your botâs name) - The bot will now listen for mentions in that channel
Usage
Ask Questions Mention the bot in any channel where itâs been added:- Process your question using the same agent as the web interface
- Generate SQL queries based on your context
- Execute queries against your connected databases
- Return results in a formatted Slack message
- Send you the link to the full conversation to open it in browser UI
The bot replies in threads to keep conversations organized. Make sure to reply in the thread for follow-up questions.
You need to use @nao-chat at every question, even in thread, for the bot to see it.