A voice-powered AI assistant for Kenya's eCitizen government services platform. Features natural language understanding, talking avatar animation, and accessible design for all users.
# Rafiki.ai - Kenya Government Voice Assistant
A production-grade, accessible voice assistant helping citizens navigate Kenya government services via voice in **English**, **Kiswahili**, and **Mixed/Code-Switching**.
## 🎯 Features
### Core Voice Assistant
- 🎤 **Voice-based interaction** with speech recognition and text-to-speech
- 🤖 **AI-powered NLU** using Google Gemini with RAG (citations included)
- 🇰🇪 **Bilingual support** - English, Kiswahili, and code-switching
- 🗣️ **Talking avatar** with realistic lip-sync (SadTalker + Google Colab GPU)
- ⚡ **50-100x faster** video generation with T4 GPU acceleration
### Government Services Workflow Engine
- 📋 **7 Pre-built Workflows** for common government services:
- NTSA Driving License appointment booking
- KRA Nil Returns filing guidance
- DCI Good Conduct Certificate application
- Huduma Centre location finder
- Constitutional knowledge Q&A
- Feedback submission
- Emergency reporting
- ✅ **Built-in validators** for Kenya-specific data:
- Phone numbers (07xx, +254xx)
- National ID (7-8 digits)
- KRA PIN (A###########B format)
- 🔄 **State machine** with pause/resume/cancel support
### Security & Compliance
- 🔐 **Immutable audit logging** with SHA-256 hash chaining
- 🕵️ **PII auto-redaction** in logs
- 🚨 **Fraud detection** with rate limiting
- 📱 **SMS confirmations** via Africa's Talking
### Accessibility
- ♿ **WCAG 2.1 AA compliant** UI
- 📜 **Conversation history** with transcript downloads
- 🗺️ **Huduma Centre locator** with directions
## Architecture
```
Frontend (React/TypeScript) Backend (FastAPI) External Services
------------------------- ----------------- -----------------
- Vite dev server - REST API - Google Gemini AI
- Avatar components - Workflow Engine - ElevenLabs TTS
- useSadTalker hook - RAG with ChromaDB - Africa's Talking SMS
- Audio visualization - Session management - Google …