Learn more about our open-source project on Github

In today's data-driven world, organizations are constantly looking for ways to make their data analysis process more efficient and streamlined. The recent surge in Large Language Model technologies has revolutionized the field of analytics by enabling natural language interactions, which gave access to data analytics to everyone. DSensei is an open-source Slack bot that connects this technology with people by enabling them to request data analytics in plain English directly within their familiar instant messaging tool.

In this post, we'll walk through the steps to set up Dsensei in Slack connecting to BigQuery as its data source.

Prerequisites

Setup

Now let's start the setup process.

Step 1. Create a Setup Slack App

First, let's create a new Slack App and install it to the workspace:

display_information:
 name: sensei
features:
 app_home:
   home_tab_enabled: false
   messages_tab_enabled: true
   messages_tab_read_only_enabled: false
 bot_user:
   display_name: sensei
   always_online: true
 slash_commands:
   - command: /info
     description: Get information about DB
     usage_hint: /info [dbs] | [tables db] | [schema db.table]
     should_escape: false
oauth_config:
 scopes:
   bot:
     - app_mentions:read
     - chat:write
     - commands
     - im:history
     - files:write
     - files:read
settings:
 event_subscriptions:
   bot_events:
     - app_mention
     - message.im
 interactivity:
   is_enabled: true
 org_deploy_enabled: false
 socket_mode_enabled: true
 token_rotation_enabled: false

Step 2. Setup BigQuery Credentials

Then let's create a Google Cloud Service Account Dsensei to access Bigquery:

Step 3. Setup DSensei Service

Now with the Slack App and BigQuery access setup, let's set up the Dsensei service:

Start DSensei and Verify in Slack!

That's it, now we should have everything set up, let's start Dsensei and verify it in Slack!

2023-04-26T23:10:00.526Z [SlackApp] info: 
    ____    _____                                _  
   / __ \  / ___/  ___    ____    _____  ___    (_)
  / / / /  \__ \  / _ \  / __ \  / ___/ / _ \  / /
 / /_/ /  ___/ / /  __/ / / / / (__  ) /  __/ / /
/_____/  /____/  \___/ /_/ /_/ /____/  \___/ /_/

2023-04-26T23:10:00.529Z [DataSourceLoader] info: Use data source from BigQuery
[INFO]  socket-mode:SocketModeClient:0 Going to establish a new connection to Slack ...
2023-04-26T23:10:00.782Z [SlackApp] info: Sensei is up running, listening on port 3000
2023-04-26T23:10:00.986Z [BigQuery] info: Loaded databases: ecommerce
[INFO]  socket-mode:SocketModeClient:0 Now connected to Slack
2023-04-26T23:10:01.414Z [BigQuery] info: Loaded table: ecommerce.distribution_centers
2023-04-26T23:10:01.448Z [BigQuery] info: Loaded table: ecommerce.users
2023-04-26T23:10:01.452Z [BigQuery] info: Loaded table: ecommerce.events
2023-04-26T23:10:01.454Z [BigQuery] info: Loaded table: ecommerce.products
2023-04-26T23:10:01.456Z [BigQuery] info: Loaded table: ecommerce.inventory_items
2023-04-26T23:10:01.504Z [BigQuery] info: Loaded table: ecommerce.orders
2023-04-26T23:10:01.529Z [BigQuery] info: Loaded table: ecommerce.order_items
2023-04-26T23:10:01.530Z [BigQuery] info: All 1 databases are loaded.
2023-04-26T23:10:04.334Z [BigQuery] info: Enrichment finished.

Closing Thought

In conclusion, leveraging the power of chatbots to access and analyze data can greatly improve the efficiency and effectiveness of data analysis processes in organizations. DSensei is a great open-source Slack bot that can help you achieve this goal by allowing you to access and analyze data through natural language commands. By following the steps outlined in this post, you can easily set up DSensei and link it to your BigQuery data source to start benefiting from its features.

Weโ€™re passionately developing this project and would love for you to be a part of our community on Discord where you can receive the latest news, report bugs, and make feature requests. Please also feel free to submit any feedback on GitHub directly.

Try a live demo of DSensei in our Slack Channel


The featured image for this article was generated with Kadinksy v2.

Prompt: Illustrate a Disney-like robot on a messaging app.