Production-ready Community Manager Chatbot for LaserOstop Tunisia with GPT-5, RAG, and Tunisian Dialect Support
# LaserOstop CM Chatbot
A production-ready community manager chatbot for **LaserOstop Tunisia**, featuring RAG (Retrieval-Augmented Generation), GPT-5-nano integration, comprehensive evaluation framework, and a full-featured testing interface with detailed logging.
## Overview
This chatbot serves as an intelligent community manager for LaserOstop Tunisia's laser stop-smoking service. It communicates in Tunisian dialect (Derja), mixing Arabic and French naturally, and provides accurate information about laser therapy for smoking cessation.
### Key Features
#### Backend
- **RAG-Enhanced Responses**: Uses Tunisian dialect social media datasets for context-aware responses
- **GPT-5-nano Integration**: Powered by OpenAI's latest GPT-5-nano model (`gpt-5-nano-2025-08-07`)
- **Multilingual Support**: Handles Arabic, French, and Tunisian dialect seamlessly
- **Voice Message Support**: Whisper API integration for audio transcription
- **Comprehensive Evaluation**: Built-in evaluation framework with quality metrics
- **Multi-Channel Ready**: Prepared for WhatsApp, Meta (FB/IG), and TikTok integration
- **Database Logging**: Full conversation tracking and analytics
#### Frontend Testing Interface
- **Comprehensive Logging**: Real-time logs from Frontend, Backend, AI/GPT, and Errors
- **Performance Monitoring**: Track response times, token usage, and success rates
- **Log Filtering**: Toggle visibility of different log sources
- **Export Functionality**: Export all logs and messages to JSON for analysis
- **RAG Toggle**: Enable/disable RAG for A/B testing
- **Modern UI**: Clean, responsive interface supporting Arabic and Latin scripts
## Architecture
```
┌─────────────────┐
│ User Message │
└────────┬────────┘
│
▼
┌─────────────────┐ ┌──────────────┐
│ Flask API │◄────►│ Webhooks │
└────────┬────────┘ │ (WhatsApp, │
│ │ Meta, etc) │
▼ └──────────────┘
┌─────────────────┐
│ Chat Logic │
└────────┬────────┘
│
┌── …