🤖

Guide to Building a Slack AI Assistant

Dec 3, 2024

Building a Slack AI Assistant

Overview

This guide provides a step-by-step process to build a Slack AI assistant using tools like Make, Slack, ChatGPT, and Airtable. The assistant can answer common, complex questions and is integrated with Slack and a vector store database for data storage.

Key Tools and Setup

  • Slack Workspace: Create channels for client queries.
  • Make (Integromat): Connects Slack with the assistant.
  • Airtable: Database to track messages and responses.
  • ChatGPT Assistants: Develop and train based on uploaded content in vector store databases.

Implementation Steps

1. Setup Airtable Database

  • Create an Airtable base from scratch.
  • Delete default columns and add required columns:
    • Message ID (auto-number)
    • Message, User, Type, Timestamp (single line text)
    • Thread Timestamp, Client Message ID, Team, Channel, Channel Type
    • Assistant Thread ID, Assistant Response (long text)

2. Connect Make with Slack

  • Webhook Creation:
    • Go to Make, create a Webhook, name it, and save.
    • In Slack API, create a new app, turn on event subscriptions, and connect with Make.
  • Subscribe to Bot Events:
    • Add bot user events for message history in private channels.

3. Create Slack App

  • Install the app in the Slack workspace.
  • Add the app to a Slack channel.

4. Setup OpenAI for ChatGPT

  • Create Project in OpenAI:
    • Generate API keys and create a ChatGPT assistant.
  • Upload Content:
    • Add files and guides that the assistant should use for responses.

5. Build Make Automation

  • Search Airtable for Threads:
    • Use search records to find existing threads based on thread timestamp.
  • Create a New Record:
    • Record new messages in Airtable.
  • Respond to User:
    • Send initial acknowledgment message in Slack.
  • Integrate ChatGPT Assistant:
    • Use the assistant to generate responses to messages.
  • Update Airtable:
    • Log assistant responses and update threads in Airtable.

6. Advanced Setup

  • Filter Messages:
    • Prevent infinite loops by filtering bot messages.
  • Error Handling:
    • Add error handlers in Make to manage bot errors gracefully.
  • Multiple Assistants:
    • Route messages to different assistants based on Slack channels.

Community Resources

  • No Code Architects Community:
    • Access templates and support.
    • Participate in daily calls for further guidance.

Conclusion

Following these steps allows you to set up a functional AI assistant within Slack, automated with Make, and supported by a robust database in Airtable. This setup can handle specific, niche tasks efficiently, enhancing support within your community.