In this tutorial, you'll learn how to build a Slackbot that responds to, monitors, and takes action on Slack messages.
Why Build a Slackbot? Save hours sifting through Slack DMs and team conversations Focus on high-priority messages Automate responses to team questions and customer inquiries Improve information circulation and support What You'll Achieve Lindy will refer to a knowledge base to respond to team questions and customer inquiries, reducing your time mediating Slack conversations.
Time Required Building a Slackbot will take approximately 7 minutes.
By the end of this tutorial, you'll have a functional Slackbot that streamlines your team's communication and enhances productivity
Let's Get Started!
Create A New Lindy Click the plus sign beside Lindies to start building your Lindy.
Click "Start from scratch" to create a new Lindy.
Add a Trigger Select a trigger.
Add the "Slack Message Received" trigger.
Configure Trigger Settings Choose the Channels and Direct Messages for Lindy to monitor.
Options:
Select specific channels. Monitor every channel in your workspace. (All) Add Filters (Optional) You can specify which Slack messages trigger this Lindy by using trigger filters .
You can filter by:
Senders (Slack users) Channels Keywords or phrases In the below example, Lindy will only be triggered on Slack messages beginning with, "Hey Lindy.."
Add Conditions (Optional) Use Conditions to determine how Lindy handles incoming messages. Choose which messages Lindy should reply to, take action on, or ignore altogether.
Why Use Conditions:
Ensure Lindy responds only to relevant messages
Customize responses based on message content
Improve the accuracy and efficiency of your Slackbot
How to Set Up Conditions Click the plus sign to add a step Select "Condition" Define the Condition Example Condition:
Only continue if... the message received contains a question about an internal process
Give Lindy Examples: Add specific examples of message content that meets the condition.
Example Condition with Examples:
Only continue if... the message received contains a question about an internal process such as: Our time off policy, Benefit information, or Product-related questions
Give Lindy a Knowledge Base Next, we are going to have Lindy search a knowledge base so she knows how to respond to questions.
Add a step and select “Search Knowledge Base”.
Select a knowledge base and add all the files Lindy will need in order to respond to Slack Messages.
Ensuring Accurate Slack Responses Because Lindy will search the Knowledge Base for every message that passes the initial condition, we'll add a second condition to refine her responses.
Add A Second Condition Click the plus sign below the Knowledge Base and add a "Condition".
Set Condition Parameters Insert the condition:
Only continue if "You found the answer to the Slack message question in the knowledge base"
Add a Slack Response Action After the condition, add the recommended "Slack Thread" . Select the "Send Message" action.
This allows Lindy to respond to Slack messages, in thread.
Handle Unanswered Queries (Optional) If no answer is found, you can:
Create a new action to escalate this to a human Set a reminder to add the answer to your knowledge base for future queries This ensures Lindy only responds when she has found relevant information, maintaining accuracy in her Slack interactions.
Customize the Slack Response In the Slack “Send Channel Message” action, customize how Lindy responds to users using the "Message" field and adding an "AI Prompt"
In the example below, the prompt is:
"Respond to the user using context found in your knowledge base. Be succinct and helpful."
Test! Let your Lindy go free! Just kidding..
Now you can test your Lindy:
Go to a public Slack channel Ask a question (that passes your condition) Watch Lindy respond using the content extracted from your Knowledge Base This test will show you how Lindy can immediately answer questions in Slack using the content in your knowledge base.