A document-grounded chatbot that answers questions about Tunisia's renewable energy incentive programs (PROSOL, PROSOL Elec, PROSOL Elec Économique) using Retrieval-Augmented Generation (RAG).
# Tunisia Renewable Energy RAG Chatbot
A document-grounded chatbot that answers questions about Tunisia's renewable
energy incentive programs (PROSOL, PROSOL Elec, PROSOL Elec Économique) using
Retrieval-Augmented Generation (RAG).
## Problem / Motivation
General-purpose LLMs don't reliably know the specifics of niche national
programs like Tunisia's solar subsidy schemes, and will often generate
plausible-sounding but incorrect details (wrong subsidy amounts, made-up
eligibility rules). This project demonstrates a RAG pipeline that grounds
every answer in real source documents, and explicitly says "I don't know"
when the answer isn't present in the retrieved chunks — rather than guessing.
## Documents Used
- **`cahier_des_charges_prosol_elec_2023.pdf`** — ANME's official program
specification for PROSOL Elec (2023)
- **`guide_sections_1_2_5.txt`** — Extracted sections (energy context,
regulatory framework/Law 2015-12, and investment/incentive environment)
from ANME's "Projets d'Énergie Renouvelable en Tunisie — Guide Détaillé"
(2019), originally a 329-slide presentation; trimmed to the sections
relevant to subsidies, financing, and eligibility
## Architecture / Pipeline
```
Documents (PDF + TXT)
↓
Text extraction & loading (PyPDFLoader / TextLoader)
↓
Chunking (RecursiveCharacterTextSplitter, chunk_size=1000, overlap=200)
↓
Embeddings (Gemini embedding model)
↓
Vector storage (ChromaDB)
↓
Similarity retrieval (top-k=4 chunks per question)
↓
Grounded generation (Gemini LLM, answers restricted to retrieved context)
↓
Answer + cited source chunks
```
## Technologies
- **LangChain** — document loading, text splitting, orchestration
- **ChromaDB** — vector storage and similarity search
- **Google Gemini** — embeddings (`gemini-embedding-001`) and generation
(`gemini-3.6-flash`)
- **Python / Google Colab**
## Installation & Usage
1. Open the notebook in Google Colab
2. Run the install cell to set up dependencies
3. Enter your Gemini API key when prompted (`get …