Discord-Integrated RAG Chatbot

Kunal

Kunal Barve

Discord-Integrated RAG Chatbot

1. Overview

Built a conversational RAG (Retrieval-Augmented Generation) chatbot integrated with Discord to automate Q&A for a digital marketing agency's course community. The system ingested video transcripts from training courses, created a searchable knowledge base, and provided 24/7 AI-powered answers to members via Discord. Achieved 95% accuracy in responses, eliminating manual support costs.

2. Tech Stack

Backend: FastAPI (Python)
Database: Supabase (vector storage)
AI/ML: GPT-4, OpenAI Embeddings, LangChain (RAG pipeline)
Workflow Automation: n8n (Google Drive triggers, RAG logic)
Infrastructure: Digital Ocean VPS (hosting FastAPI)
Integrations: Discord API, Google Drive API
Transcription: OpenAI Whisper (video-to-text)---

3. General Flow

Data Ingestion:
n8n monitored the agency’s Google Drive for new course videos.
Videos were sent to a FastAPI server, which transcribed them using OpenAI Whisper.
Transcripts were split into chunks, converted to embeddings (via GPT-4), and stored in Supabase.
Query Handling:
Discord members submitted questions in a dedicated channel.
An n8n workflow triggered the RAG system:
Retrieved relevant context from Supabase using vector similarity search.
Combined the query with chat history (stored in Supabase) and passed it to GPT-4 via LangChain.
The response was sent back to Discord via FastAPI.

4. Input & Output

Input:
Video files (MP4) from Google Drive.
Text questions from Discord users.
Output:
Vector embeddings stored in Supabase.
Text responses in Discord channel (GPT-4 generated).

5. Key Features

Automated Knowledge Base: Transcripts auto-processed into embeddings when new videos were added.
Conversational Memory: Supabase stores chat history for context-aware replies.
Low-Cost Infrastructure: FastAPI hosted on Digital Ocean ensured scalability without high costs.
Accuracy Optimization: Prompt engineering and embedding tuning minimized hallucinations.
24/7 Availability: Instant answers reduce reliance on human support staff.
Like this project

Posted Apr 12, 2025

Built a Discord-integrated RAG chatbot for a marketing agency.

Likes

0

Views

2

Timeline

Sep 19, 2024 - Jan 20, 2025

Clients

Digital Marketing Agency