https://github.com/karim-elkadhi/ai_chatbot
AI chatbot for customer service with real time text and voice interaction
https://github.com/karim-elkadhi/ai_chatbot
chatbot lang langfuse llm openai rag rag-chatbot sentiment-analysis speech-recognition speech-to-text text-to-speech tts
Last synced: 3 months ago
JSON representation
AI chatbot for customer service with real time text and voice interaction
- Host: GitHub
- URL: https://github.com/karim-elkadhi/ai_chatbot
- Owner: Karim-ElKadhi
- License: mit
- Created: 2025-06-12T12:40:47.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-12-10T15:12:36.000Z (8 months ago)
- Last Synced: 2026-04-30T12:33:29.969Z (3 months ago)
- Topics: chatbot, lang, langfuse, llm, openai, rag, rag-chatbot, sentiment-analysis, speech-recognition, speech-to-text, text-to-speech, tts
- Language: Python
- Homepage:
- Size: 1.93 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π§ AI Chatbot Platform for Insurance Services
> **MediBot** is an intelligent, multimodal chatbot platform built with Python.
> Itβs designed to enhance **insurance services** through voice and text interactions, emotion analysis, and data-driven dashboards.
## π§© Overview
MediBot offers two main modules:
- π₯ **User Module** β customers interact with the chatbot using **voice or text**, view their conversation history, and receive emotion-aware responses.
- π§βπΌ **Admin Module** β decision-makers explore **KPIs, dashboards, and sentiment analytics**, manage users, and monitor global activity.
---
## π Key Features
### π£οΈ Multimodal Interaction
- Supports **Text** π¬ and **Voice** ποΈ input using Speech-to-Text (STT) and Text-to-Speech (TTS) technologies.
- Provides natural, human-like responses with audio output.
### π¬ Conversational Intelligence
- Real-time **emotion & intent detection** (e.g., *happy, sad, angry, neutral*).
- Generates automatic satisfaction scores based on emotion trends.
### π§ Sentiment & Emotion Monitoring
- Tracks sentiment evolution across each conversation.
- Displays **interactive graphs** showing emotional evolution.
### π Secure Authentication
- **JWT-based authentication** with role-based access control:
- π§ **Users** β interact with the bot and review their conversation history.
- π§βπΌ **Admins** β access advanced dashboards and user management tools.
### πΎ Persistent Data Storage
- Stores conversations, users, and sentiment scores in a SQLite database.
- Enables filtered queries and historical analysis.
---
## π§ββοΈ User Module
π§ Click to expand
### Features
- Interact with MediBot via **text** or **voice commands**.
- Enjoy **real-time voice replies** through Text-to-Speech (TTS).
- Access **chat history** and review previous interactions.
- Experience adaptive responses based on emotional tone.
### Example User Flow
1. Log in with credentials.
2. Start a conversation (voice or text).
3. MediBot detects emotions, intent, and provides contextual responses.
4. View conversation history revisit previous conversations.

------------------------------------------------------------------------------------------------------

---
## π§βπΌ Admin Module (Decision-Makers Dashboard)
The admin area empowers decision-makers with data-driven insights:
π Click to expand
### π KPI & Analytics
- View real-time **metrics and visual dashboards** (user activity, sentiment trends, satisfaction scores).
- Access aggregated analytics across all users and sessions.
### π§Ύ Conversations Management
- Access a complete list of all usersβ conversations.
- Filter, search, and export conversation histories.
### π₯ User Management
- Add π’, modify π‘, or delete π΄ users.
- Manage **roles and permissions** dynamically.
### π Sentiment Monitoring
- Visual dashboards for sentiment analysis across users and time periods.
- Identify negative trends or dissatisfaction in customer interactions.

------------------------------------------------------------------------------------------------------

---
### βοΈ Technical Details
MediBot is built using a modular, scalable, and RAG-enabled AI architecture to provide context-aware and accurate responses.
### πΉ Core AI Components
- Retrieval-Augmented Generation (RAG)
Uses LangChain to orchestrate retrieval of relevant information and generate responses.
Enhances factual accuracy by combining dataset knowledge with LLM generation.
- Vector Store & Semantic Search
Embeddings generated via SentenceTransformers (all-MiniLM-L6-v2 or multilingual variants).
FAISS vector store enables fast semantic search on the dataset (question, intent, category, response).
- Large Language Model Integration
Groq LLM generates natural, context-aware responses based on retrieved passages.
Prompt templates adapt dynamically to the userβs language using get_system_prompt(language).
- Multilingual Support
Detects input language automatically.
Retrieval and generation respect the detected language, ensuring consistent responses in French, English, or other languages.
- Observability & Monitoring
Langfuse tracks every RAG interaction: user query, retrieved context, LLM output, and metrics.
Enables debugging, analytics, and continuous improvement of the chatbotβs accuracy.
---
## π§± Project Structure
AI-chatbot/
βββ main.py
βββ utils
β βββ lang.py
βββ dataset
β βββ dataset.csv
βββ database/
β βββ databaset.db
β βββ conversations.db
βββ requirements.txt
βββ README.md
## π¦ Installation
1. **Clone the repository**:
```bash
git clone https://github.com/Karim-ElKadhi/AI-chatbot.git
cd AI-chatbot
pip install -r requirements.txt
python app/main.py
## Access the interface
π§ User Dashboard β http://localhost:5000/user
π§βπΌ Admin Dashboard β http://localhost:5000/admin
```
π License
This project is licensed under the MIT License.