AI-powered knowledge portal and research assistant for EPRC Uganda
# EPRC AI Research Assistant
An AI-powered knowledge portal and research assistant for the **Economic Policy Research Centre (EPRC) of Uganda** β built to make 30+ years of Uganda's economic policy research instantly accessible to researchers, policymakers, and the public.
> Built entirely in-house by EPRC ICT staff as a zero-cost alternative to external consultants.
---
## What It Does
- π **Semantic search** across 500+ EPRC research documents (1994β2024)
- π¬ **Natural language Q&A** β ask questions, get cited answers from real EPRC research
- π **Website navigation assistant** β guides users to the right section of eprcug.org
- π **Source citations** β every answer references the exact document and page
- π€ **Small talk capable** β handles greetings and general queries gracefully
---
## Tech Stack
| Component | Technology |
|---|---|
| LLM | Gemma 4 (via Ollama) β runs 100% locally |
| Embeddings | nomic-embed-text (via Ollama) |
| Vector Store | ChromaDB (persistent local store) |
| Document Registry | PostgreSQL |
| Backend API | FastAPI + Python |
| Frontend | Vanilla HTML/CSS/JS chat widget |
| Document Parsing | PyPDF + python-docx |
---
## Architecture
```
EPRC Documents (PDF/DOCX)
β
knowledge_base.py β chunks, embeds, stores in ChromaDB
β
User asks question via chat widget
β
engine.py β embeds query β searches ChromaDB β retrieves top 8 chunks
β
Gemma answers using retrieved context + EPRC identity
β
Streamed response with source citations
```
---
## Project Structure
```
eprc-ai-assistant/
βββ app.py # FastAPI backend + chat widget UI
βββ engine.py # RAG query pipeline
βββ knowledge_base.py # Document ingestion pipeline
βββ database.py # PostgreSQL + ChromaDB setup
βββ prompts.py # System prompts + EPRC identity
βββ static/
β βββ index.html # Floating chat widget UI
βββ eprc_documents/ # EPRC research documents (not in repo)
βββ chroma_store/ # Vector embeddings (not in repo)
βββ .en β¦