AI for Bharat Hackathon 2026 Submission
Swasthya-Setu ("Health Bridge") demonstrates how Generative AI on AWS can support frontline healthcare workers and patients in rural India โ with fast AI triage, a guideline-grounded medical chatbot, and a patient management system โ all deployed live on AWS.
| Service | URL |
|---|---|
| Frontend (CloudFront) | https://d74rck1rcmkfd.cloudfront.net |
| Backend API (API Gateway) | https://5zdiwo4lfl.execute-api.ap-south-1.amazonaws.com/api/v1 |
| API Docs (Swagger) | https://5zdiwo4lfl.execute-api.ap-south-1.amazonaws.com/docs |
Rural India faces a severe healthcare accessibility crisis:
- 600M+ people live in rural areas with limited access to doctors
- Frontline health workers (ASHAs, ANMs) lack structured decision-support tools
- Patients travel hours to clinics for conditions that can be triaged remotely
- No affordable, multilingual, AI-powered health guidance exists at scale
Swasthya-Setu is a working proof-of-concept that shows how AI can bridge this gap โ today.
- Register patients with name, age, and gender (Male/Female)
- Persistent patient profiles stored in AWS RDS PostgreSQL
- Full consultation history per patient (triage + chat logs)
- Search and browse all registered patients
- Enter symptoms in Hindi or English โ multilingual input supported
- Powered by GPT-4o-mini for fast, structured classification
- Returns one of three clinically meaningful levels:
- ๐ด RED โ Emergency: Immediate hospital referral
- ๐ก YELLOW โ Priority: Visit clinic or pharmacy
- ๐ข GREEN โ Non-urgent: Home care with guidance
- Includes confidence score, actionable advice, and clinical reasoning
- Every triage is logged to the database for analytics
- Conversational Q&A powered by GPT-4o-mini + Retrieval-Augmented Generation
- Answers grounded in WHO guidelines, NHM advisories, and Ayushman Bharat documentation
- Shows cited sources for every response โ transparent and trustworthy
- Session memory for multi-turn conversations
- Embeddings stored in pgvector on AWS RDS via Amazon Bedrock Titan
- Real-time consultation counts
- Triage distribution breakdown (RED / YELLOW / GREEN)
- Chat interaction metrics
- Live data from production database
User (Browser)
โ
โผ
Amazon CloudFront โโโโโโโโโโโโโโโโโโ Amazon S3
(CDN, HTTPS, SSL) (React Frontend)
โ
โผ
Amazon API Gateway (ap-south-1)
โ
โผ
AWS Lambda โ FastAPI via Mangum adapter
โ
โโโ OpenAI GPT-4o-mini (Triage + Chatbot LLM)
โโโ Amazon Bedrock Titan (Embeddings for RAG)
โโโ Amazon RDS PostgreSQL + pgvector (Patient data + Vector store)
โโโ LangChain (RAG orchestration)
| Service | Purpose |
|---|---|
| AWS Lambda | Serverless backend (FastAPI app via Mangum) |
| Amazon API Gateway | HTTP routing and CORS |
| Amazon RDS (PostgreSQL) | Patient data + pgvector embeddings |
| Amazon S3 | Frontend static hosting |
| Amazon CloudFront | CDN, HTTPS, global delivery |
| Amazon ECR | Docker image registry for Lambda |
| Amazon Bedrock (Titan) | Vector embeddings for RAG knowledge base |
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS, Framer Motion |
| Backend | Python 3.13, FastAPI, Mangum |
| AI / LLM | OpenAI GPT-4o-mini |
| RAG | LangChain, pgvector, Amazon Bedrock Titan Embeddings |
| Database | PostgreSQL (AWS RDS), SQLAlchemy |
| Deployment | Docker, AWS Lambda (arm64), ECR, API Gateway |
# Clone the repo
git clone https://github.com/Sumit-ai-dev/swasthya-setu-prototype.git
cd swasthya-setu-prototype
# Start everything with Docker Compose
docker compose up --build| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
Required environment variables โ copy backend/.env.example to backend/.env and fill in:
OPENAI_API_KEY=your_openai_key
DATABASE_URL=postgresql://postgres:password@localhost:5432/swasthya_setu
EMBEDDING_PROVIDER=local # or 'bedrock' for AWS Titan
TRIAGE_MODEL_ID=gpt-4o-mini
CHATBOT_MODEL_ID=gpt-4o-minicd backend
bash scripts/deploy.shThis script:
- Builds the Docker image for
linux/arm64 - Pushes to Amazon ECR in
ap-south-1 - Creates or updates the Lambda function
- Applies environment configuration
cd frontend
npm run build
aws s3 sync dist/ s3://swasthya-setu-frontend-bucket --delete
aws cloudfront create-invalidation --distribution-id <ID> --paths "/*"cd backend
export DATABASE_URL=postgresql+psycopg2://...
# Create tables
python3 -m app.scripts.init_db
# Seed WHO/NHM medical knowledge base
python3 -m app.scripts.seed_medical_dataThe triage engine is calibrated against WHO Emergency Triage Assessment and Treatment (ETAT) guidelines:
- ๐ด RED โ Airway, Breathing, Circulation, or Disability compromise; cancer/malignancy indicators; severe fever in infants
- ๐ก YELLOW โ Stable but serious conditions requiring clinical investigation; persistent symptoms; chronic conditions
- ๐ข GREEN โ Mild self-limiting symptoms; home care appropriate
โ ๏ธ Disclaimer: Swasthya-Setu is an AI demonstration prototype. It is not a substitute for professional medical diagnosis or treatment. Always consult a qualified healthcare provider.
cd backend
pytest app/tests/test_clinical_triage.py -vTests verify triage classification correctness across critical symptom profiles including fever, chest pain, respiratory distress, and oncology red flags.
swasthya-setu-prototype/
โโโ backend/
โ โโโ app/
โ โ โโโ api/api_v1/endpoints/ # patients, triage, chatbot, analytics
โ โ โโโ core/config.py # Pydantic settings
โ โ โโโ db/ # SQLAlchemy models + session
โ โ โโโ schemas/ # Pydantic request/response schemas
โ โ โโโ services/ # RAG service, LLM calls
โ โ โโโ scripts/ # DB init, seed scripts
โ โโโ Dockerfile # Lambda-compatible container
โ โโโ requirements.txt
โ โโโ scripts/deploy.sh # AWS Lambda deployment
โโโ frontend/
โ โโโ src/
โ โ โโโ components/ # PatientDashboard, Triage, Chatbot, Analytics
โ โ โโโ api.js # Axios API client
โ โ โโโ App.jsx
โ โโโ scripts/deploy.sh # S3 + CloudFront deployment
โโโ docker-compose.yml
- Offline-first Android app โ DistilBERT on-device triage for no-internet zones
- Indian Sign Language (ISL) support โ accessibility for deaf patients
- eSanjeevani / ABDM integration โ connect with national health ID
- Voice input in regional languages โ Telugu, Tamil, Bengali, Marathi
- Village-level health worker dashboards โ ASHA/ANM portal
- Outbreak detection โ anomaly detection from triage data patterns
Built by Sumit Das for the AI for Bharat Hackathon 2026 ๐ฎ๐ณ
เคธเฅเคตเคพเคธเฅเคฅเฅเคฏ-เคธเฅเคคเฅ โ Bridging India's healthcare gap, one consultation at a time.