workflows.fit
Back to n8n workflows
n8n templateFreeBy Trung Tran

Answer code of conduct questions in Slack with GPT-4 & RAG technology

๐Ÿ“˜ Code of Conduct Q&A Slack Chatbot with RAG Powered [![Watch the video](https://wisestackai.s3.ap-southeast-1.amazonaws.com/code-of-conduct-qanda-chatbot-rag-powered-for-slack.jpg)](https://www.youtube.com/watch?v=2...

CommunicationHITLData & StorageDevelopmentCore NodesAILangchainIf
Loading interactive preview...

Template notes

๐Ÿ“˜ Code of Conduct Q&A Slack Chatbot with RAG Powered [![Watch the video](https://wisestackai.s3.ap-southeast-1.amazonaws.com/code-of-conduct-qanda-chatbot-rag-powered-for-slack.jpg)](https://www.youtube.com/watch?v=2EWgC5UKiBQ) > Empower employees to instantly access and understand the companyโ€™s Code of Conduct via a Slack chatbot, powered by Retrieval-Augmented Generation (RAG) and LLMs.

๐Ÿง‘โ€๐Ÿ’ผ Whoโ€™s it for

This workflow is designed for: - HR and compliance teams to automate policy-related inquiries - Employees who want quick answers to Code of Conduct questions directly inside Slack - Startups or enterprises that need internal compliance self-service tools powered by AI

โš™๏ธ How it works / What it does

This RAG-powered Slack chatbot answers user questions based on your uploaded Code of Conduct PDF using GPT-4 and embedded document chunks. Here's the flow:

1. Receive Message from Slack: A webhook triggers when a message is posted in Slack. 2. Check if itโ€™s a valid query: Filters out non-user messages (e.g., bot mentions). 3. Run Agent with RAG: - Uses GPT-4 with Query Data Tool to retrieve relevant document chunks. - Returns a well-formatted, context-aware answer. 4. Send Response to Slack: Fetches user info and posts the answer back in the same channel. 5. Document Upload Flow: - HR can upload the PDF Code of Conduct file. - Itโ€™s parsed, chunked, embedded using OpenAI, and stored for future query retrieval. - A backup copy is saved to Google Drive.

๐Ÿ› ๏ธ How to set up

1. Prepare your environment: - Slack Bot token & webhook configured (Sample slack app manifest: https://wisestackai.s3.ap-southeast-1.amazonaws.com/slackbotmanifest.json) - OpenAI API key (for GPT-4 & embedding) - Google Drive credentials (optional for backup)