AI-powered WhatsApp chatbot for maternal health education in Kenya
# Zeya - WhatsApp AI Antenatal Education Chatbot
An AI-powered WhatsApp chatbot providing personalized antenatal education to pregnant women in Migori County, Kenya. Built for a research study comparing chatbot-based education against standard SMS reminders.
## Features
- **AI-Powered Responses**: Uses Google Gemini to provide accurate maternal health information based on WHO and Kenya Ministry of Health guidelines
- **Danger Sign Detection**: Automatically detects 8 categories of obstetric emergencies in both English and Swahili, triggering immediate emergency responses with local hospital contacts
- **Multilingual Support**: Responds in English or Swahili based on user preference
- **Gestational Age Tracking**: Provides trimester-specific advice based on pregnancy stage
- **Admin Dashboard**: React-based dashboard for monitoring users, conversations, and danger sign alerts
- **Data Export**: Export conversation and engagement data to CSV for research analysis
## Tech Stack
**Backend**
- Python 3.11 / FastAPI
- PostgreSQL 15 (database)
- Redis 7 (conversation history cache)
- Google Gemini AI (gemini-2.0-flash-exp)
- WhatsApp Cloud API
**Frontend**
- React 18 / Vite
- TailwindCSS
- Recharts (analytics)
**Infrastructure**
- Docker / Docker Compose
- Nginx (frontend serving)
## Quick Start
### Prerequisites
- Docker and Docker Compose
- ngrok (for WhatsApp webhook)
- WhatsApp Business API credentials
- Google Gemini API key
### Installation
1. Clone the repository:
```bash
git clone
github.com
cd zeya
```
2. Create environment file:
```bash
cp backend/.env.example backend/.env
```
3. Edit `backend/.env` with your credentials:
```
GEMINI_API_KEY=your_gemini_api_key
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_ACCESS_TOKEN=your_access_token
WHATSAPP_VERIFY_TOKEN=your_verify_token
```
4. Start the application:
```bash
make up
make migrate
```
5. Access the services:
- Backend API:
localhost
- …