Using Waii via Slack
Overview
The Waii Slack bot enables teams to access and query data warehouse information directly through Slack. This integration streamlines data access by allowing users to ask questions about their data in natural language, whether in direct messages or in channels.
This guide covers the setup process for a slack workspace
Key Features
- Natural language queries for database information
- Support for multiple database connections
- Granular access control through Slack permissions
- Rich response formats including direct answers, charts, and tables
- Query explanation capabilities for transparency
- Thread-based conversations for query refinement
Security
The bot implementation uses Slack's OAuth mechanism for secure authentication. The required permissions are kept to a minimum and include only what's necessary for basic bot functionality:
- chat:write - For sending messages
- im:read, im:write, im:history - For direct message interactions
- files:write - For sharing charts and visualizations
- app_mentions:read - For responding to mentions in channels
- users:read - Read user's id to which it responds to
Interaction Patterns
Users can interact with the bot in two ways:
-
Direct Messages
- One-on-one conversations with the bot
- Immediate responses without needing to mention the bot
- Private, secure interactions for sensitive queries
-
Channel Integration
- Bot can be added to any channel
- Users must mention the bot (e.g., "@Waii What was our revenue last month?")
- Responses are created in threads for organized discussions
- Follow-up questions can refine the initial query
Setup Process
Prerequisites
- Admin access to your Slack workspace
- Your Waii API credentials
- Database connection information
1. Slack App Creation
- Visit
api.slack.com/apps
- Click "Create New App"
- Choose "From an app manifest"
- Select your workspace
- We will provide the manifest template
- You can customize the bot's display name, description, and branding to match your organization's standards or use the default Waii branding
- Install the app in the workspace which will give you the bot token
2. Share credentials with Waii team
After creating the app, you'll receive:
- A signing secret (found in "Basic Information")
- An App token (found in "Basic Information")
- A bot token (available after installing the app to your workspace)
Share these tokens with the us. We will get back to you after configuring the slack bot for your workspace
3. Add to channels and configure
Once we complete the configuration, head to the workspace where the App was installed and you should see the Waii bot added to the list of apps
- Add the app to any channel (press
/
in the channel and selectAdd App
) - Use
/configure
slash command from that channel to configure the app- You will need 3 things:
- Waii API URL - will be shared by the waii team
- Waii API Key - Copy your API Key by going to Waii UI -> Top right drop down ->
Copy API Key
- DB Connection - Select the DB Connection from the drop down in slack
- You will need 3 things:
Configuration is complete. You can now start using Waii in the slack channel. Just mention @Waii to ask anything
Follow Step 3 to configure the App in Direct Message to the app as well
Usage Examples
Direct Messages
User: What were our top selling products last month?
Waii: Here are the top 5 products by revenue for August 2024:
[Table or chart showing results]
Channel Interactions
User: @Waii How has customer churn changed over the past year?
Waii: [Creates a thread]
Here's the monthly churn rate for the past 12 months:
[Chart showing trend]
The overall trend shows a 2.3% decrease in churn.
Query Explanation
User: Why did you include the refund_date in that query?
Waii: I included refund_date to ensure we're only counting final sales
after the refund window. Here's how the query was constructed:
[Query explanation]