Research-led conversational AI for exploring WHO public-health indicators for Nigeria and supporting evidence-informed decision-making.
# Nigeria Health Insights
Nigeria Health Insights is a FastAPI application for exploring public-health indicators for Nigeria through a browser-based chat interface and authenticated API. It combines a local FAISS retrieval index with a Hugging Face inference endpoint and can optionally use OpenAI to improve response presentation.
> [!IMPORTANT]
> This is a research and demonstration project. Its responses may be incomplete or incorrect and are not medical advice, diagnosis, or a substitute for qualified healthcare professionals or official public-health guidance.
## Features
- Retrieval-augmented answers grounded in the included health-indicator data
- Browser client served by FastAPI
- JWT authentication and role-based access for guests, analysts, and administrators
- PostgreSQL-backed users, chat history, settings, and analytics
- Hugging Face model inference with optional OpenAI response enhancement
- Training notebook and exported Colab workflow for the experimental model pipeline
## How it works
1. The application searches the included FAISS index for health-indicator records relevant to a question.
2. Retrieved records are summarized and passed to the configured Hugging Face inference endpoint.
3. If `OPENAI_API_KEY` is configured, the response can be refined for clarity and actionable context.
4. Authenticated conversations and response metadata are stored in PostgreSQL.
The repository includes the source CSV files, a prepared JSONL dataset, document chunks, and the FAISS index so the retrieval layer can load at startup.
## Tech stack
- Python, FastAPI, and Uvicorn
- PostgreSQL and SQLAlchemy
- FAISS and Sentence Transformers
- Hugging Face Inference
- OpenAI API (optional)
- Vanilla HTML, CSS, and JavaScript
## Quick start
### Prerequisites
- Python 3.10 or later
- PostgreSQL
- A Hugging Face token with read access
- A deployed Hugging Face inference endpoint
- An OpenAI API key only if you want the optional response-enhancement step
### Instal …