Bilingual RAG chatbot over e& Egypt package documentation, built with LangGraph and ChromaDB
# e& Egypt Knowledge-Base Chatbot
A bilingual (Arabic/English) retrieval-augmented chatbot that answers questions
about e& Egypt mobile packages, internet plans, prices and service codes,
grounded entirely in the company's official documentation.
Built for the **e& Summer Internship Program** by Ahmed Khairy.
---
## What it does
Ask a question in Arabic, English, or a mix of both. The system retrieves the
relevant passages from the knowledge base and answers from them, citing which
source each figure came from. If the documentation does not cover the question,
it says so rather than guessing.
```
> How much does Emerald 430 cost per month?
The Emerald 430 package costs 430 EGP per month before taxes [1].
> عايز اعرف سعر باقة حكاية 46
سعر باقة حكاية انترنت 46 هو 46 جنيه [1].
(ميني حكاية انترنت 46 بصلاحية 3 أسابيع سعرها 46 جنيه أيضاً [2].)
> ايه تفاصيلها
حكاية إنترنت 46 هي باقة شهرية، تفاصيلها كالتالي:
· السعر: 46 جنيه
· الإنترنت: 1,250 ميجابايت
· وحدات المكالمات والرسائل: 300 وحدة
...
```
---
## Architecture
```mermaid
graph TD
A[Customer question] --> B[understand]
B -->|greeting or thanks| C[smalltalk]
B -->|real question| D[retrieve]
D -->|relevant context| E[generate]
D -->|nothing usable| F[no_context]
C --> G[Answer]
E --> G
F --> G
subgraph inside_understand [inside understand]
H[detect language]
I[rewrite follow-ups using recent turns]
J[split multi-product questions]
end
subgraph components [ ]
K[(ChromaDB 447 chunks)]
L[Groq gpt-oss-120b]
end
D -.- K
E -.- L
I -.- L
J -.- L
```
The agent is a LangGraph state machine with two conditional edges.
**understand** detects the question's language and prepares the search. Two
optional LLM calls happen here:
- *Query rewriting* — a follow-up like "what are its details" carries no
product name, so it is rewritten using the last four turns into a question
that can stand alone.
- *Query decomposition* — a question naming two products is split into one
search per product.
Both are skipped when they …