A Voiceflow-powered AI chat agent to help hackers get answers to their questions quickly and accurately! Open sourced as of Hack the North 2024 on Wednesday, August 21st, 2024.
- Answers questions about Hack the North in a dedicated Slack channel or in DMs using a knowledge base with documents, FAQs, and more.
- Automatically categorizes and scores the quality of the answers.
- Allows users to submit feedback or ask for further help with buttons.
- Pulls real-time schedule information from the Hack the North's HackerAPI to answer questions about events, workshops, and more.
- Organizers can update the knowledge base by sending information to a private channel or in public announcements.
- Posts monitoring messages to a Slack channel to track the bot's activity and performance.
- Stores analytics and logs in Airtable for further analysis.
Node 20+ is required.
- Clone the repo.
- Copy
.env.template
to.env
. - Run
npm install
. - Create a new Slack bot and set any secrets in your
.env
file. - Create a new Voiceflow project and set any secrets in your
.env
file. - Create a new Airtable base and set any secrets in your
.env
file. - Run
npm start
to start the bot.
You can also use the provided Dockerfile to run the bot in a container.
- Create a Slack bot based off the manifest
SlackBotManifest.json
. Enable socket mode. - Add the signing secret, bot token, and app token to
.env
. - Add the bot to your desired workspace.
- Invite the bot to the below Slack channels and add their IDs to
.env
.
QUESTIONS_CHANNEL
: the channel to monitor for questions from hackersANNOUNCEMENTS_CHANNEL
: the channel to monitor for new knowledge from public announcementsINSERT_KB_CHANNEL
: the channel to monitor for new knowledge from private messagesMONITORING_CHANNEL
: the channel to output log messages
- Choose maintainer pings and add their IDs to
.env
MAINTAINER_PING
: the user or user to ping when an organizer runs into an issue that requires technical interventionFAILED_ANSWER_PING
: the group to ping when the bot fails to answer a questionEMERGENCY_PING
: the group to ping when the bot detects an emergency situation
When adding pings, make sure to set them with the @
symbol in the .env
for users, and the !subteam^
syntax for groups.
- Import the Voiceflow project
VoiceflowQnaAgent.vf
to your workspace. You might have to change the models used in some places because there are paid models selected. - Run the agent in the testing tool and then publish it.
- Add the API key, project ID, and version ID to
.env
.
- Create a new Airtable base and add its base ID to
.env
underAIRTABLE_BASE_ID
. - Create a conversation table with the following fields and add its ID to
.env
underCONVERSATION_TABLE_ID
:
convo_id
question
answer
user_id
end_type
end_reason
answer_score
time_asked
time_answered
slack_permalink
vf_transcript
channel
user_satisfaction
- Create an announcements table with the following fields and add its ID to
.env
underANNOUNCEMENT_TABLE_ID
:
announcement_ts
body
user_id
document_id
status
method
- Create a personal access token with read and write access to the tables and add it to
.env
underAIRTABLE_API_KEY
.
Any top-level messages in ANNOUNCEMENTS_CHANNEL
or INSERT_KB_CHANNEL
will be added to the knowledge base. You can only remove information through the Voiceflow project's knowledge section.
Special thanks to Voiceflow for partnering with Hack the North to build this project.
Built with ❤️ by Alex Aumais with the help of the rest of the Hack the North and Voiceflow teams.