Logo Lanfrica

ahmedcharef/Tunisia-Open-Gov-Data-RAG

Domain:

natural language processing

Record type:

software
Creator:
ahm
Host:
RAG pipeline over Tunisian open government data using LangChain # Tunisia Open Government Data RAG Pipeline **Retrieval-Augmented Generation** over real Tunisian public datasets using LangChain, multilingual embeddings and frontier LLMs via OpenRouter. ## ✨ Features - Ingestion of Tunisian open government CSV datasets about **education establishments** - Multilingual embedding model that handles **Arabic + French** very well - Persistent Chroma vector database - Conversational RAG chain with history awareness - Easy model switching via OpenRouter (Qwen, Llama 3.3, Mistral, Claude, Gemini, …) - Local fallback to Ollama possible - Clean separation: ingestion / querying / configuration - CLI interface + **Streamlit Web UI** ## πŸ—οΈ Project Structure ```text tunisia-rag/ β”œβ”€β”€ data/ # Put downloaded CSVs here β”œβ”€β”€ chroma_db/ # Persistent Chroma vector store (git ignored) β”œβ”€β”€ .env # API keys (git ignored) β”œβ”€β”€ requirements.txt β”œβ”€β”€ README.md β”œβ”€β”€ ingest.py # One-time data β†’ vector store pipeline β”œβ”€β”€ query.py # Conversational RAG interface └── config.py # Central model & path configuration ``` ## Installation Guide Follow these steps to get the **Tunisia Open Government Data RAG Pipeline** up and running on your machine. ### 1. Prerequisites - **Python** β‰₯ 3.10 - **Ollama** (optional – only if you want to use a local LLM fallback instead of OpenRouter) - An **OpenRouter** account and API key β†’ Create one (free tier available): openrouter.ai ### 2. Clone and Install Dependencies ```bash # Clone the repository git clone github.com cd Tunisia-Open-Gov-Data-RAG ``` #### (Recommended) Create and activate a virtual environment ```bash python -m venv .venv # On macOS / Linux source .venv/bin/activate # On Windows # .venv\Scripts\activate # Install all required Python packages pip install -r requirements.txt ``` ### 3. Configure Environment Variables copy and edit .e …