Logo Lanfrica

GIVEN-CHINYAMA/zambia-economic-rag-qa-system

Domaine:

socioeconomic

Type de record:

softwareproject
Créateur:
GIV
Hôte:
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 | …