Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arivu.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

What the backend needs

The Slack adapter in integrations/slack_adapter.py uses Slack Bolt and supports two runtime modes:
  • Socket Mode for local development or private deployments
  • HTTP mode for deployments with a public webhook endpoint
Required values:
  • SLACK_BOT_TOKEN or bot_token
  • SLACK_APP_TOKEN for Socket Mode
  • SLACK_SIGNING_SECRET for HTTP mode
  • Optional admin_user_ids for approval gating

What Slack users can do

Direct Messages

Users can ask questions in DM and receive replies in Slack.

@mentions

Mention the bot in a channel and keep replies in the thread.

Slash Commands

/dh-query runs a question and /dh-refresh refreshes schema.

Approvals and Feedback

Approve or reject destructive SQL and collect 👍 / 👎 feedback.

Setup steps

1

Create the Slack app

Create an app in the Slack API Console.
2

Enable the right mode

Use Socket Mode for zero-public-URL setups, or HTTP mode if you want Slack to call a public endpoint.
3

Add scopes

Add chat:write, app_mentions:read, commands, reactions:read, im:history, im:write, and channels:history.
4

Install the app

Install the bot to your workspace and copy the bot token.
5

Set admin users

Pass Slack user IDs in admin_user_ids so only trusted users can approve SQL.
6

Start Arivu

Start the adapter in Socket Mode or HTTP mode depending on your deployment.

Example

from arivu.integrations.slack_adapter import SlackIntegration

adapter = SlackIntegration(
    db=db,
    bot_token="xoxb-your-bot-token",
    app_token="xapp-your-app-token",
    signing_secret="your-signing-secret",
    admin_user_ids=["U12345678", "U23456789"],
)

adapter.start(socket_mode=True)

Backend behavior

  • Session IDs are mapped as slack:{user_id}.
  • Non-destructive questions return a normal answer and RLHF buttons.
  • Destructive SQL is held for admin approval and sent to admins with approve/reject buttons.
  • /dh-refresh refreshes the database schema cache.
Slack responses stay in the thread when the query comes from a channel mention, which keeps channels clean.