Logo Lanfrica

gabrielmahia/kenya-rag

Domain:

socioeconomic

Record type:

software
Creator:
gab
Host:
KenyaRAG β€” LlamaIndex RAG system for Kenya civic data. Natural language queries over parliament, budget, and policy documents. # πŸ” KenyaRAG β€” Civic AI for Kenya > Retrieval-augmented generation over Kenya's civic datasets. Ask questions about parliament records, county budgets, SACCO data, and constitutional rights β€” and get grounded, cited answers. ## What it does KenyaRAG turns Kenya's public civic datasets into a queryable knowledge base. Built on LlamaIndex with Kenya-specific document loaders, retrievers, and citation formatting. **Ask questions like:** - *"Which counties had the lowest development fund absorption in FY 2022/23?"* - *"What is the CDF allocation for Westlands constituency?"* - *"Which MPs have voted against the Finance Bill the most times?"* - *"What does the Constitution say about riparian land rights?"* ## Data sources All data from our published civic dataset: | Dataset | Source | DOI | |---------|--------|-----| | Parliamentary bills | Parliament of Kenya | Kaggle | | County budgets FY22/23 | Controller of Budget | HuggingFace | | MP records | Parliament / Mzalendo | Zenodo | | SACCO registry | SASRA | Kaggle | | CDF utilisation | Controller of Budget | HuggingFace | ## Architecture ``` civic_data/ ← Kenya civic CSVs (from Kaggle/HuggingFace datasets) β”œβ”€β”€ mps_seed.csv β”œβ”€β”€ county_budgets_fy2223.csv β”œβ”€β”€ bills_seed.csv β”œβ”€β”€ cdf_seed.csv └── saccos_seed.csv kenya_rag/ β”œβ”€β”€ loaders/ ← Custom LlamaIndex document loaders per dataset β”œβ”€β”€ indices/ ← Vector + keyword index builders β”œβ”€β”€ query/ ← Query engines with Kenya-specific prompts └── app.py ← Streamlit interface ``` Built on LlamaIndex β€” the leading open-source RAG framework (30k+ GitHub stars). ## Quickstart ```bash pip install kenya-rag # or from source: git clone github.com cd kenya-rag pip install -r requirements.txt export OPENAI_API_KEY=your_key # or ANTHROPIC_API_KEY streamlit run app.py ``` ## Why this exists Kenya's public data is published but not accessible. A Controller of Budget PDF exists. 350-page Hansard records exist. SASRA …