An AI-enabled healthcare platform designed for underserved rural communities.
It combines clinical guidance support, priority-based appointment scheduling, and role-secure workflows in one Django system.
- Project Overview
- Core Algorithms
- Key Features
- Technology Stack
- Quick Start (Docker Recommended)
- Local Development Setup
- Docker Developer Commands
- Project Structure
- Future Improvements
- License
- Authors
Rural Health AI addresses access barriers in rural healthcare by providing:
- AI-guided health Q&A with retrieval grounding
- Priority-aware appointment management for limited clinical resources
- Awareness campaign and document-driven knowledge workflows
- Role-based access for Villagers, Health Workers, and Admins
The chatbot follows a controlled multi-step reasoning pipeline:
- Semantic Retrieval
Query embeddings are matched against verified health documents in ChromaDB. - State-Based Decision Routing
LangGraph decides whether local context is sufficient. - Fallback Search
If confidence is low, the system uses SerpAPI for fresh external context. - Grounded Response Synthesis
Google GenAI generates a contextual, safety-aware answer.
Appointment allocation is optimized by urgency and fairness, not only by first-come-first-served.
- Role & Access Validation
Confirms request is from an allowed user role. - Score Calculation
ComputesPriorityScorefor each pending request. - Queue Ordering
Requests are sorted by score (high to low). - Conflict-Free Slot Matching
Assigns earliest feasible slot from provider availability. - Escalation Rule
If high-priority requests exceed SLA threshold, mark as escalated. - Async Confirmation
Celery + Redis handles notifications and status updates. - Lifecycle Tracking
Appointment states:Scheduled,Completed,Cancelled,Escalated.
- AI Healthcare Assistant (local-first RAG + fallback web retrieval)
- Priority-Based Appointments (triage-aware scheduling)
- Role-Based Access Control (RBAC) for Villager/Worker/Admin
- Awareness Campaign Management
- Medical Document Upload + Indexing
- Responsive UI with Tailwind CSS
- Asynchronous Task Execution with Celery
- Backend: Python, Django
- AI/RAG: LangChain, LangGraph, Google GenAI, SerpAPI
- Vector Storage: ChromaDB
- Frontend: Django Templates, Tailwind CSS, Vanilla JavaScript
- Queue/Async: Celery + Redis
- Database: PostgreSQL (default) / SQLite (dev option)
- Containerization: Docker + Docker Compose
git clone <your-repo-url>
cd Rural_Health_AI_Smart_Healthcare_Solution# Django
SECRET_KEY=your_django_secret_key
DEBUG=True
# AI Keys
GOOGLE_GENAI_API_KEY=your_google_genai_api_key
SERPAPI_API_KEY=your_serpapi_api_key
# Email (optional)
EMAIL_HOST_USER=[email protected]
EMAIL_HOST_PASSWORD=your_email_passworddocker-compose up --buildApp URL: http://localhost:8000
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py createsuperuser
python manage.py runserverStart Celery worker:
celery -A rural_health_assistant worker --beat --scheduler django --loglevel=infopython -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic --noinput
python manage.py createsuperuser
python manage.py runserver# Start services
docker-compose up -d
# Stop services
docker-compose down
# Stop + remove volumes (DB reset)
docker-compose down -v
# Tail logs
docker-compose logs -f
# Django commands inside web container
docker-compose exec web python manage.py makemigrations
docker-compose exec web python manage.py migrate
docker-compose exec web python manage.py createsuperuser
# PostgreSQL shell
docker-compose exec db psql -U postgres -d rural_health_assistant_dbaccounts/ # Authentication, profiles, roles
appointments/ # Priority scheduling and booking logic
awareness/ # Awareness campaigns
chat/ # Chat interface and conversation handling
contact/ # Support/contact workflows
documents/ # Upload, parsing, indexing pipelines
rag_components/ # Agentic RAG graph, retrieval, generation
vector_db/ # Persistent ChromaDB storage
templates/ # Shared and app templates
static/ # CSS/JS/static assets
media/ # Uploaded files
rural_health_assistant/ # Django settings, URLs, WSGI/ASGI
- Explainable priority breakdown in UI (why a case was ranked high)
- Offline-first mobile mode for low-connectivity regions
- Multilingual support for local languages
- Model monitoring and response quality analytics
Educational and non-commercial use.
Binisha Chapagain
Arun Pandey Laudari
BCA 6th Semester Final Project