Egyptian-Telecom-AI-Chatbot An LLM-powered bilingual chatbot that supports Egyptian Arabic (عامية مصرية) and English, designed to assist customers of all major telecom companies in Egypt.
# Egyptian Telecom RAG 📱
A Retrieval-Augmented Generation (RAG) chatbot and assistant built to answer questions about Vodafone Egypt plans, services, and support.
This project scrapes the latest data, processes it into semantic chunks, and uses a hybrid retrieval pipeline (Vector Search + BM25 + Reranking) combined with Groq LLM to generate highly accurate and context-aware responses.
## 🚀 Setup & Installation
### 1. Create a Virtual Environment
It is recommended to use an isolated Python environment. You can use standard `venv` or `uv`:
**Using `venv`:**
```bash
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Mac/Linux:
source .venv/bin/activate
```
### 2. Install Dependencies
If you are using standard `pip`:
```bash
pip install -r requirements.txt
```
*(Note: If you use `uv`, you can quickly install everything using `uv sync` since a `uv.lock` file is present).*
### 3. Prepare Environment Variables (`.env`)
You need API keys for the LLM models to generate answers and process vision tasks.
Rename/copy the example environment file and fill in your keys:
```bash
cp .env.example .env
```
Make sure to edit the `.env` file to add your keys:
- **`GROQ_API_KEY`**: Get it from Groq Console
- **`GEMINI_API_KEY`**: Get it from Google AI Studio
---
## 🗄️ Preparing the Database (Data Pipeline)
Before you run the chatbot, you must populate the vector database with the scraped data. Run the following scripts in order:
### Step 1: Run Scrapers
Scrape Vodafone's website (FAQs, plans, etc.) to get the raw data:
```bash
python -m src.services.run_scrapers # if you need to update the data
```
### Step 2: Clean the Data
Clean and format the raw scraped data, format plans, and remove duplicates:
```bash
python -m src.helpers.cleaner
```
### Step 3: Chunk the Data
Break the cleaned text into semantic passage chunks optimized for vector search:
```bash
python -m src.services.chunker
```
### Step 4: Create Embeddings
Generate vector embeddings and save t …