RAG-powered Q&A system over Zambian macroeconomic data (World Bank API) using ChromaDB, Groq LLaMA, and Gradio β with evaluation framework and live deployment.
#πΏπ² Zambia Economic RAG Q&A System
> **Retrieval-Augmented Generation (RAG) system that answers natural language questions about Zambia's macroeconomic history using verified World Bank data and a live LLM.**
---
## π Project Overview
This project builds a **production-grade RAG system** that allows users to query Zambia's macroeconomic history using plain English β no SQL, no dashboards, just questions and grounded answers.
Instead of a standard LLM that guesses or hallucinates country-level economic data, this system:
1. **Retrieves** the most relevant verified facts from a ChromaDB vector store
2. **Grounds** the LLM response strictly in that retrieved data
3. **Cites** the exact year and source for every answer
**Example questions the system answers:**
- *"What caused Zambia's inflation spike in 2021?"*
- *"How has the Kwacha depreciated against the USD since 2010?"*
- *"What was Zambia's GDP growth trend between 2015 and 2023?"*
- *"When did Zambia's government debt peak?"*
- *"What was the unemployment rate in Zambia in 2019?"*
---
## ποΈ System Architecture
User Question
β
[Sentence Transformer β all-MiniLM-L6-v2] β Query Embedding
β
[ChromaDB Vector Store] β Top-5 Relevant Year Chunks (Cosine Similarity)
β
[System Prompt + Retrieved Context + Question]
β
[Groq LLM β LLaMA 3.3 70B Versatile] β Grounded, Cited Answer
β
[Gradio Interface] β Live Interactive Response with Source Citation
---
## π Data Sources
| Source | Indicators Collected | Years Covered |
|--------|---------------------|---------------|
| World Bank API | GDP Growth Rate | 2000β2024 |
| World Bank API | Inflation CPI (%) | 2000β2024 |
| World Bank API | USD/ZMW Exchange Rate | 2000β2024 |
| World Bank API | Unemployment Rate | 2000β2024 |
| World Bank API | Government Debt (% of GDP) | 2000β2024 |
| World Bank API | Current Account Balance | 2000β2024 |
| World Bank API | Foreign Direct Investment | 2000β2024 |
| World Bank API | GDP per Capita (USD) | 2000β2024 | β¦