Egyptian Tax Navigator is an AI-powered RAG system that answers user questions based on Egypt’s Income Tax Law (2005) and VAT Law (2016), using LangChain and LLMs to make tax regulations more accessible and searchable.
# 🧾 Egyptian-Tax-Navigator – المساعد الضريبي الذكي لمصر
**Egyptian-Tax-Navigator** is an intelligent Arabic Q\&A assistant designed to answer questions related to **Egyptian tax law** using official legal documents only. It uses OCR to extract text from scanned PDFs, embeds the content into a **Chroma vector store**, and allows users to ask natural language questions in Arabic via a simple Streamlit web interface.
Built using **LangChain**, **Gemini 2.5**, **ChromaDB**, and **HuggingFace multilingual embeddings**.
---
## 📁 Project Structure
```
Egyptian-Tax-Navigator/
├── app.py # Streamlit interface
├── qa_chain.py # Retrieval-Augmented Generation pipeline
├── create_pdf_vector_db.py # OCR + ChromaDB vectorization
├── assets/ # Place tax law PDFs here
├── data/chroma_db/ # Vector DB (auto-generated)
├── .env # API key and configuration
└── requirements.txt # All dependencies
```
---
## ⚙️ Setup Instructions
### 1. Clone the Repository
```bash
git clone
github.com
cd Egyptian-Tax-Navigator
```
### 2. Create a Virtual Environment
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
### 3. Install Dependencies
```bash
pip install -r requirements.txt
```
---
## 🔐 Configure Environment Variables
Create a `.env` file in the root directory and add the following:
```env
GOOGLE_API_KEY="your_google_gemini_api_key"
HUGGINGFACEHUB_API_TOKEN="your_huggingface_api_token"
```
These keys are used for:
* 🔑 `GOOGLE_API_KEY`: Accessing **Gemini 2.5** via `langchain-google-genai`
* 🔑 `HUGGINGFACEHUB_API_TOKEN`: Loading **multilingual-e5-base** embeddings via `langchain-huggingface`
If you don’t already have these:
* Get your Gemini API key
* Get your Hugging Face token
---
## 📚 Step 1: Add Tax PDFs
Place all your Egyptian tax-related PDFs (even scanned/image-based ones) in the `assets …