Skip to main content
Bring Vaquill’s legal research engine into any Slack workspace. The bot responds to @mentions, direct messages, and slash commands, replies in-thread with cited case law and statutes, and supports follow-up questions without re-mentioning the bot. Source code lives at github.com/Vaquill-AI/integrations/slack-bot.

Features

  • @mention, DM, and /vaquill slash command surfaces
  • Per-thread conversation memory with configurable timeout
  • Cited sources block (case name, citation, court) and Helpful / Not Helpful feedback buttons
  • Starter-question buttons when the bot is mentioned without a query
  • Per-user and per-channel rate limits (in-memory or Redis-backed)
  • User and channel allowlists / blocklists

Prerequisites

  • Python 3.10+ (or Docker)
  • Slack workspace where you can install custom apps
  • Vaquill API key from app.vaquill.ai/settings (starts with vq_key_). See Authentication.
  • Optional: Redis for distributed rate limiting across multiple bot instances

Platform setup

You need a Slack app with bot scopes, event subscriptions, two slash commands, and either Socket Mode or HTTP mode enabled.
1

Create the Slack app

Open api.slack.com/apps, click Create New App, choose From scratch, name it (e.g. “Vaquill Legal AI”), and select your workspace.
2

Add bot token scopes

Under OAuth & Permissions > Bot Token Scopes, add every scope in the table below. Missing scopes cause silent failures.
3

Subscribe to events

Under Event Subscriptions, toggle Enable Events on and subscribe to: app_mention, message.im, and optionally message.channels. For HTTP mode, set the Request URL to https://your-domain.com/slack/events. Skip the URL for Socket Mode.
4

Register slash commands

Create /vaquill and /vaquill-help under Slash Commands. Use https://your-domain.com/slack/events as the Request URL for HTTP mode.
5

Enable Socket Mode (recommended for dev)

Under Socket Mode, toggle it on. When prompted, create an App-Level Token with the connections:write scope. Copy the token (starts with xapp-) - this is your SLACK_APP_TOKEN. Skip this step if you want HTTP mode.
6

Install to workspace and copy credentials

Under OAuth & Permissions, click Install to Workspace. Copy the Bot User OAuth Token (starts with xoxb-) as SLACK_BOT_TOKEN. Under Basic Information > App Credentials, copy the Signing Secret as SLACK_SIGNING_SECRET.

Socket Mode vs HTTP Mode

The bot auto-detects mode: if SLACK_APP_TOKEN is set, it uses Socket Mode. Otherwise it starts an HTTP server on PORT (default 3000).
Use Socket Mode locally to skip ngrok entirely. Switch to HTTP mode in production by removing SLACK_APP_TOKEN from the environment.

Quickstart

1

Clone and install

2

Configure environment

Set the minimum required values:
3

Run

Look for Bot initialised with user ID: U0XXXXXXX. In Slack, invite the bot to a channel with /invite @Vaquill, then try:

Configuration

The top env vars. See the repo’s .env.example for the full reference.

Commands

Slack requires a response within 3 seconds. The bot sends a “Thinking…” placeholder immediately and edits it once the Vaquill API replies.

Deployment

The repo ships a docker-compose.yml that bundles the bot with Redis for rate limiting.

Standalone Docker

Cloud hosts

Railway

Push the repo, set env vars in the Railway dashboard. Railway provisions an HTTPS domain you can paste into Slack’s Request URLs.

Render

Web Service. Build: pip install -r requirements.txt. Start: python bot.py. Free tier sleeps after 15 minutes - slash commands may time out on cold starts.

Fly.io

fly launch, then fly secrets set ... for each env var, then fly deploy.

VPS + nginx

Reverse-proxy port 3000 behind TLS (Let’s Encrypt or Cloudflare). Use Socket Mode to skip the proxy entirely.
For production, run in HTTP mode (drop SLACK_APP_TOKEN) behind HTTPS and update Event Subscriptions, Slash Commands, and Interactivity Request URLs to https://your-domain.com/slack/events.

Troubleshooting

Scope changes only take effect after reinstalling the app to your workspace. If you see missing_scope errors, add the scope and reinstall.

Discord

Same engine, prefix-command UX.

Microsoft Teams

Adaptive Cards on Azure Bot Framework.

Chatbots overview

Compare all six platforms.

Authentication

How Vaquill API keys work.