AI-powered patient-facing chatbot for a community healthcare provider in Uganda — Claude on Bedrock with intent routing, formulary search, Bedrock Guardrails, and clinical safety evals
# LMMC Smart Clinic Assistant
An AI-powered patient-facing chatbot for Lynda Michelle Medical Centre, a community healthcare provider in Wakiso District, Uganda. Helps patients understand services, estimate costs, prepare for visits, and reach the clinic in English and Luganda.
## Architecture
```
┌──────────────────────────────────────────────────────────────────────┐
│ React Frontend (Vite + TypeScript + Tailwind + shadcn-ui) │
│ ChatWidget → getAIResponse() → AWS Lambda or Supabase Edge Function│
└──────────────────────────────────┬───────────────────────────────────┘
│
POST
... (or AWS Lambda Function URL)
│
┌──────────────────────────────────▼───────────────────────────────────┐
│ AWS Lambda / Supabase Function Compute │
│ │
│ ┌─────────────┐ ┌─────────────────────────────────────────────┐ │
│ │ Rate Limiter │───▶│ Input Validation (role allowlist, length) │ │
│ └─────────────┘ └─────────────────────┬───────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────▼───────────────────────┐ │
│ │ Intent Router (Claude Haiku / Bedrock, structured output) │ │
│ │ → general_info | formulary_lookup | booking | emergency | oos │ │
│ └───────┬────────────┬───────────────────┬───────────────────────┘ │
│ │ │ │ │
│ emergency out_of_scope general_info / formulary / │
│ │ │ booking │
│ ▼ ▼ │ │
│ Fixed template Polite redirect ▼ │
│ + escalation (no model call) ┌────────────────────────┐ │
│ row written │ Claude Sonnet / Bedrock │ │
│ │ + s …