generated from 2025/project_base
An AI-powered chatbot that answers student and staff FAQs in regards to CSIS.
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| backend | ||
| doc | ||
| frontend | ||
| sample_data | ||
| src | ||
| .env | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| demo_script | ||
| LICENSE | ||
| README.md | ||
CSIS Helpdesk Chatbot
A RAG-powered AI chatbot for university helpdesk queries built with a microservices architecture.
Architecture
Backend Services
| Service | Port | Description |
|---|---|---|
| Knowledge Base | 8000 | Vector search with Qdrant, document ingestion |
| Chatbot | 8001 | RAG chat with GPT-3.5-turbo, escalation logic |
| Notification | 8003 | Escalation handling, ticket creation |
Infrastructure
- Qdrant (6333) - Vector database
- RabbitMQ (5672, 15672) - Message queue for escalations
- MySQL - Conversation storage
- NGINX (80) - Load balancer
Frontend
React
Quick Start
Prerequisites
- Docker and Docker Compose
- Node.js 18+
- OpenAI API key
Environment Setup
Create backend/.env:
OPENAI_API_KEY=your-key-here
Running with Docker
cd backend
docker-compose up -d
Frontend runs at http://localhost:3000
Running Frontend on its own
cd frontend
npm install
npm run dev
API Endpoints
Chatbot Service (8001)
POST /api/chat- Send message, get AI responseGET /api/conversations- List conversationsGET /api/conversations/{session_id}- Get conversation messagesDELETE /api/conversations/{session_id}- Delete conversation
Knowledge Base Service (8000)
POST /api/knowledge/search- Vector searchPOST /api/knowledge/ingest- Add documentPOST /api/knowledge/upload- Upload file (PDF/DOCX/TXT/JSON)GET /api/knowledge/documents- List documentsDELETE /api/knowledge/documents/{id}- Delete document
Notification Service (8003)
GET /api/escalations- List escalationsGET /api/escalations/stats- Escalation statisticsPATCH /api/escalations/{id}/status- Update status
Features
- RAG-powered responses using OpenAI embeddings and GPT-3.5
- Automatic document chunking for better retrieval
- Query escalation based on confidence scores and keywords
- Conversation history per user
- Admin dashboard for managing knowledge base and escalations
- Voice input support
Project Structure
backend/
chatbot/ # Main chat service
knowledge_base/ # Vector DB and document processing
auth/ # Authentication service
notification_service/ # Escalation handling
database/ # MySQL schema
frontend/
src/
components/ # React components
services/ # API client
utils/ # Helper functions
sample_data/ # Sample knowledge base documents
Configuration
Escalation Thresholds
In backend/chatbot/main.py:
MIN_CONFIDENCE_SCORE = 0.3- Below this triggers escalationESCALATION_KEYWORDS- Words that trigger escalation
Chunking
In backend/knowledge_base/main.py:
CHUNK_SIZE = 1500- Characters per chunkCHUNK_OVERLAP = 200- Overlap between chunks