How to set up a Slack bot to automatically answer questions
Danswer will connect to your Slack and listen for messages to answer.
You can easily configure rules for what channels Danswer should respond in, what knowledge sets should back each configured channel, and set filters to respond or not respond to different types of messages.
When Danswer identifies valid questions, it will respond in the message thread with:
Danswer also provides a configuration page so you can create custom settings for each slack channel (or you can just use the default settings for all your channels).
Since we are using Web Sockets, Danswer is able to initiate the connection. This means that this is able to work even if you are running Danswer inside a firewall protected VPC.
Note: You must be an admin of the Slack workspace to set up the Slack bot.
App-level Token
, following the guide here.
Add the connections:write
scope to the app-level token and click Generate.
Copy this somewhere safe for now, as you will need this later to initiate the Web Socket-based connection to Slack.Install to Workspace
and Allow the app.
Start by finding the admin page in the top right of the Danswer web UI.
On the left hand menu of the admin page, navigate to the bottom to Bots.
Provide your Slack Tokens and Danswer will start to respond to your slack channels after a short startup delay.
There are also a set of less often used / more advanced configuration options available via environment variables that can set things like how many “Reference Documents” to show per answer, etc. Refer to the available configs here