Telecom Egypt Intelligent Assistant — multilingual RAG-powered customer support system.
# TE Intelligent Assistant — RAG Case Study
A Telecom Egypt RAG proof-of-concept designed around the supplied case study.
## What this version adds
- Official `te.eg` website ingestion with source URL metadata.
- Multilingual Arabic/English retrieval plus Egyptian Arabizi normalization.
- PDF, DOCX, TXT, HTML and image/OCR document ingestion.
- Persistent local embedding/retrieval index with multilingual Sentence Transformers when available and a TF-IDF fallback.
- Grounded generation through a local Ollama model, with deterministic fallback when Ollama is unavailable.
- Source citations in every supported answer.
- User-document scoping so uploaded content is not automatically treated as global TE knowledge.
- Streamlit professional chat UI.
- FastAPI endpoints for chat, document upload, website indexing, tickets and analytics.
- Notebook, evaluation plan, architecture and on-premises deployment documentation.
- Existing complaint classification, escalation, ticketing, authentication and dashboard foundations retained.
## Important grounding rule
The assistant is instructed to answer only from retrieved approved context. If the retrieval layer cannot find enough evidence, it refuses to invent an answer. It does not claim account, payment, network or CRM access.
## Setup
```bash
python -m venv .venv
# Windows: .venv\\Scripts\\activate
# Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt
```
### Build the official website index
```bash
python scripts/index_website.py
```
The crawler starts from approved `te.eg` pages and stays on the same host. Re-run it when the knowledge base needs refreshing.
### Optional local LLM
Install Ollama separately and pull an approved local instruct model, then set:
```text
OLLAMA_URL=
127.0.0.1
OLLAMA_MODEL=qwen2.5:7b-instruct
```
If Ollama is not available, the PoC uses an extractive, deterministic fallback. This keeps the demo functional but is not a substitute for a validated production L …