Skip to main content
The nao Slack bot brings your analytics agent directly into Slack, allowing your team to ask questions and get insights without leaving their workspace.
nao Slack Bot Interface
When configured, the nao Slack bot:
  • Listens for mentions in Slack channels
  • Can also answer from direct messages in Slack
  • 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
  • Streams progress updates and can upload CSV outputs for query results
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 your Slack App

  1. In nao, open Settings -> Integrations & MCP -> Slack
  2. Verify your deployment URL
  3. Click “Create Slack App”
This opens Slack with a pre-filled app manifest: scopes, event subscriptions, and interactivity are configured automatically.

Step 2: Install the App to your Workspace

  1. In your Slack app settings, go to “Install App”
  2. Click “Install to Workspace” and allow the permissions

Step 3: Connect your Slack Bot to nao

  1. In “OAuth & Permissions”, copy the Bot User OAuth Token (starts with xoxb-) and paste it as Bot Token in nao
  2. In “Basic Information”, copy the Signing Secret and paste it as Signing Secret in nao
  3. Click “Save”

Step 4: Add Bot to Channels

  1. In Slack, go to any channel where you want the bot
  2. Type /invite @nao (or your bot’s name)
  3. The bot will now listen for mentions in that channel

Optional: Socket Mode for private VPC deployments

Use Socket Mode when nao runs inside a private VPC or air-gapped environment without a public webhook URL.
  1. In your Slack app under Settings -> Socket Mode, enable Socket Mode and generate an App-Level Token with connections:write scope (starts with xapp-).
  2. In nao Slack settings, switch the Transport mode toggle from Webhook (default) to Socket Mode.
  3. Paste the App-Level Token. The Bot Token and Signing Secret from Step 3 are still used.
  4. Save. nao opens an outbound WebSocket and forwards every event into the same handler the webhook uses, so all Slack features behave identically.
Webhook mode stays the default for public deployments. Switch to Socket Mode only when you cannot expose an inbound URL.

Optional: Auto-create users from Slack

When a teammate mentions the bot from a workspace email that matches an allow list you configure, nao auto-creates a user account on first use - no manual invite needed.
  1. In nao Slack settings, open the User auto-creation section.
  2. Add the email domains or specific addresses allowed to self-onboard (e.g. @your-company.com).
  3. Save. The next time someone in the allow list mentions @nao, an account is provisioned with the default role (see Add Users).
Leave the allow list empty to keep manual user provisioning only.

Optional: Reply mode

By default, once you @nao in a thread the bot stays engaged and replies to every following message in that active thread. Admins can change this so the bot only answers messages that explicitly mention it.
  1. In nao Slack settings, open the Settings card.
  2. Toggle Reply only when mentioned:
    • Off (default) - after the first mention, the bot keeps answering follow-ups in that thread without needing another @nao. The Connection card shows Replies: Every message in active threads.
    • On - nao still reads thread context but only answers messages that tag the bot. The Connection card shows Replies: Only when mentioned.
The setting saves immediately and applies to the whole project. Only admins can change it; other members see the current mode on the Connection card. Use Reply only when mentioned in busy shared channels where you want tighter control over when the bot speaks.

Optional: One thread per direct message

By default, a direct message conversation with nao is a single chat that keeps its context. Admins can make DMs behave like channels instead:
  1. In nao Slack settings, open the Settings card.
  2. Turn on Start a new thread for each direct message (off by default).
When it is on, each top-level message sent to nao in a DM starts its own chat, and nao answers in a thread under that message. Replying in the thread continues the same chat. Existing DM chats keep their history, but new DMs no longer add to them.

Optional: Configure Slack from environment variables

On a self-hosted deployment you can seed the Slack connection declaratively instead of pasting tokens in the UI. Set these environment variables and nao writes the default project’s Slack settings on boot: When SLACK_BOT_TOKEN is set, transport defaults to socket if SLACK_APP_TOKEN is present and webhook otherwise; SLACK_TRANSPORT_MODE overrides that choice. Invalid combinations fail startup validation with an actionable message: Socket Mode without an app token, webhook without a signing secret, or any SLACK_* variable set without the bot token. The seed only owns the credential and transport fields. UI-managed settings - model selection, reply mode, auto-created users - are preserved. It is idempotent (no write when the stored config already matches) and never blocks startup: with no project yet, it skips with a warning. While the variables stay set, their values re-assert on every boot, which is the declarative intent; the Settings -> Slack form keeps working for everything else.

Usage

Ask Questions Mention the bot in any channel where it’s been added:
The bot will:
  1. Process your question using the same agent as the web interface
  2. Generate SQL queries based on your context
  3. Execute queries against your connected databases
  4. Return results in a formatted Slack message
  5. Send you the link to the full conversation to open it in browser UI
Thread Conversations Follow-up questions in the thread maintain context:
The bot replies in threads to keep conversations organized. Use thread replies for follow-ups.
Direct Messages You can also ask the bot in Slack direct messages (no channel mention required). With Start a new thread for each direct message turned on, every top-level DM starts its own chat, answered in a thread. Starting a fresh chat with /new In a direct message or a private channel, a conversation with nao keeps its context indefinitely. Use /new to draw a line under it:
  • /new on its own ends the current chat. Whatever you send next starts a fresh one.
  • /new <question> starts a fresh chat and opens a thread for it, headed by your question, with the agent answering inside that thread. The main conversation stays free, so you can run several independent chats side by side - one per thread.
/new <question> is only available in direct messages and private channels. In a public channel, send /new on its own. Reading the thread when mentioned mid-conversation When you @nao inside an existing Slack thread, the bot reads the previous messages in that thread before answering. This means you can have a human discussion first and then loop nao in with a question like @nao can you pull the numbers for this? - it will pick up the earlier context without you having to restate the question.
  • In a thread with no nao chat yet, nao gets the whole thread, including messages posted by bots (its own and other bots’).
  • In a thread already linked to a nao chat, nao gets everything posted since its own last message, other bots included.
  • With Reply only when mentioned on, a mention in a thread nao follows also gives it the messages it skipped since it last answered.
Replying to an automation’s thread Replies in the thread an automation posted continue that run’s chat, with the report in context, following the reply mode: with Reply only when mentioned off, any reply continues it; with it on, a reply that mentions @nao does. Tables and formatting Markdown tables in the agent’s answer are rendered as native Slack tables instead of raw pipe characters, so query results stay readable in the channel. Text around a table is split into separate blocks and converted to Slack formatting: headings and bold become bold text, and code spans and fenced code blocks are left untouched. This applies to streamed replies as well as messages posted by automations. Tables are sent as native Slack tables that show every row on one page, up to 99 rows. Long answers are sent in full: text sections are expanded, so Slack no longer folds parts of the answer behind See more. Charts Simple charts are rendered as native Slack charts that you can hover to read each value. This covers bar, line, and area charts, and pie and donut charts (shown as a Slack pie with at most 12 slices, the smallest merged into Other). Long titles and labels are shortened to fit Slack’s limits. When a chart uses a shared unit such as $ or %, the unit moves to the value axis title, for example “Revenue ($)”. Custom colors, y-axis bounds, and data labels are not shown on native charts. Other charts are sent as a PNG image, as before: other chart types (stacked, horizontal, mixed, scatter, radar, KPI), charts without a title, a numeric x axis, more than 20 categories or 12 series, series with different units, pies with a unit or negative values, and any chart beyond the second in the same message. If Slack rejects a native chart, nao sends the PNG instead. Native charts are part of the message, so they also work in Socket Mode. Charts that reuse a query from an earlier answer in the thread are also rendered. Compact view A compact view mode renders nao’s replies as shorter Slack messages: SQL and large tables are collapsed behind links so the channel stays readable, and full results are available in the linked web conversation. Toggle it under Settings -> Integrations & MCP -> Slack. Use compact view in busy channels and the default (expanded) view when you want the full SQL and data inline. Empty answers If the agent deliberately returns an empty answer, for example because a RULES.md rule tells it not to answer in some threads, the bot stays silent: the “nao is answering…” message is removed and the card with the link to nao and the feedback buttons is not posted. The exchange is still saved as a chat in nao. A generation stopped by the user still shows “Generation stopped.” Stop Conversations While generating, you will see a “stop generation” button appear in the slack conversation. Click on that button if you want to stop the chat from generating more text. What’s Next?

Chat Overview

Learn about the web chat interface

Self-Hosting Guide

Deploy nao with Docker or on your own Cloud Run instance