Answer Code of Conduct Questions in Slack with GPT-4 & RAG Technology
๐ Code of Conduct Q&A Slack Chatbot with RAG Powered
> 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:
Receive Message from Slack: A webhook triggers when a message is posted in Slack. Check if itโs a valid query: Filters out non-user messages (e.g., bot mentions). Run Agent with RAG: Uses GPT-4 with Query Data Tool to retrieve relevant document chunks. Returns a well-formatted, context-aware answer. Send Response to Slack: Fetches user info and posts the answer back in the same channel. 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
Prepare your environment: Slack Bot token & webhook configured (Sample slack app manifest: https://wisestackai.s3.ap-southeast-1.amazonaws.com/slack_bot_manifest.json) OpenAI API key (for GPT-4 & embedding) Google Drive credentials (optional for backup)
Upload the Code of Conduct PDF: Use the designated node to upload your document (Sample file: https://wisestackai.s3.ap-southeast-1.amazonaws.com/20220419-ingrs-code-of-conduct-policy-en.pdf) This triggers chunking โ embedding โ data store.
Deploy the chatbot: Host the webhook and connect it to your Slack app. Share the command format with employees (e.g., @CodeBot Can I accept gifts from partners?)
Monitor and iterate: Improve chunk size or embed model if queries arenโt accurate. Review unanswered queries to enhance coverage.
๐ Requirements
n8n (Self-hosted or Cloud) Slack App (with chat:write, users:read, commands) OpenAI account (embedding + GPT-4 access) Google Drive integration (for backups) Uploaded Code of Conduct in PDF format
๐งฉ How to customize the workflow
| What to Customize | How to Do It | |-----------------------------|------------------------------------------------------------------------------| | ๐ค Prompt style | Edit the System & User prompts inside the Code Of Conduct Agent node | | ๐ Document types | Upload additional policy PDFs and tag them differently in metadata | | ๐ค Agent behavior | Tune GPT temperature or replace with different LLM | | ๐ฌ Slack interaction | Customize message formats or trigger phrases | | ๐ Data Store engine | Swap to Pinecone, Weaviate, Supabase, etc. depending on use case | | ๐ Multilingual support | Preprocess text and support locale detection via Slack metadata |
Related Templates
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
USDT And TRC20 Wallet Tracker API Workflow for n8n
Overview This n8n workflow is specifically designed to monitor USDT TRC20 transactions within a specified wallet. It u...
๐ Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments