A Bangladesh-focused Conversational, Evidence-Grounded Health Assistant (Research & Product Prototype)
[!WARNING] Research Prototype & Medical Disclaimer [NOT CLINICALLY VALIDATED]:
This system is an experimental software research and product prototype developed solely for technical, algorithmic, and conversational evaluation. It is not an AI doctor, is not a diagnostic engine, does not provide disease probability scores or clinical labels ("you probably have X"), does not prescribe treatments or medications, and is not a replacement for qualified clinicians. All emergency routing and clarification mechanisms are software engineering implementations and have not undergone clinical trials or regulatory medical validation.
The project has evolved from a controlled information retrieval benchmark into a conversational, evidence-grounded health assistant prototype designed for Bangladesh. It aims to bridge the gap between colloquial, multi-lingual, and often underspecified user queries (in English, Native Bengali বাংলা, Standard Banglish, and Abbreviated Banglish) and authoritative, verified clinical guidance from vetted sources.
| Stage | Focus Area | Description | Status |
|---|---|---|---|
| Stage 1 | Evidence Ingestion & Retrieval Research | Controlled ingestion of NHS First Aid/acute topics with Hybrid-600 semantic windowing and SHA-256 provenance tracking. | COMPLETED / VERIFIED |
| Stage 2 | Multilingual & Banglish Retrieval | Development of Track A normalizer, keyword anchor mapping, cross-encoder reranking, and debiased dual-anchor scoring (Candidate B freeze). | COMPLETED / VERIFIED |
| Stage 3 | Grounded Generation Architecture | Implementation of BaseLLMProvider, deterministic OutputValidator, citation verification, and Policy C adaptive gating. | COMPLETED / VERIFIED |
| Stage 4 | Evidence Sufficiency & Safety Routing | Classification into explicit states (SUPPORTED_BY_ACTIVE_CORPUS, POSSIBLE_MISMATCH, UNSUPPORTED_BY_ACTIVE_CORPUS, POTENTIAL_EMERGENCY). | COMPLETED / VERIFIED |
| Stage 5 | Conversational Clarification (Phase 7A/7B) | Query understanding, ambiguity detection, structured conversation state, quick-select chips, and multi-turn state preservation. | COMPLETED / VERIFIED |
| Stage 6 | Adaptive Clarification (Phase 7C) | Mathematical Question-Utility model, 4 early stopping rules, duplicate question suppression, and turn-minimization engine. | COMPLETED / VERIFIED |
┌────────────────────────────────────────────────────────┐
│ User Query (English / বাংলা / Banglish) │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Query Understanding Service │
│ - Intent & Language Detection (Auto / বাংলা / EN) │
│ - Extraction (body part, duration, severity, age) │
│ - Red Flag / Emergency Keyword Detection │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Structured Conversation State │
│ - Multi-Turn State (`ConversationContextState`) │
│ - Dimension Tracking (`asked_questions`) │
│ - Missing High-Value Fields Identification │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Adaptive Clarification Planner (Phase 7C) │
│ - 6-Factor Question-Utility Model: │
│ Utility = G_ret + G_saf + R_amb + C_corp - P_red - P_unnec│
│ - 4 Early Stopping Rules Evaluation │
└─────────┬──────────────────────┬───────────────────────┘
│ │
[Clarification Needed]│ │[Direct / Stopped]
▼ ▼
┌───────────────────────────────┐ ┌─────────────────────────────────────┐
│ Clarification Response │ │ Candidate B Retrieval Service │
│ - Highest Utility Question │ │ - Track A Lexical Normalization │
│ - Observable Quick Chips │ │ - Dense: multilingual-e5-small │
│ - Context Update & Loop │ │ - Cross-Encoder: bge-reranker-v2-m3│
└───────────────────────────────┘ │ - 0.85x Overview Debiasing │
│ - Candidate B Dual Fusion │
└──────────────────┬──────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Evidence Sufficiency Router │
│ - Top Rerank Threshold (>= 0.65) │
│ - Out-of-Corpus Filter (< 0.40) │
└─────────┬─────────┬────────┬────────┘
│ │ │
┌────────────────────────┘ │ └────────────────────────┐
▼ ▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐ ┌───────────────────────────┐
│ Grounded Answer Response │ │ Honest Abstention Response│ │ Emergency Response │
│ - Citations & Passages │ │ - Irrelevant Cards Hidden │ │ - Emergency Protocols │
│ - Policy C Evidence Cards │ │ - Safe Non-Claim Guidance │ │ - Red Flag Escalation │
│ - Medical Disclaimers │ │ - Clinician Advisory │ │ - Immediate Help Hotlines │
└───────────────────────────┘ └───────────────────────────┘ └───────────────────────────┘
The active application corpus consists of 119 Hybrid-600 semantic chunks derived from 14 verified NHS clinical evidence sources (DOC-NHS-004 through DOC-NHS-017):
| Source ID | Condition / Clinical Topic | Chunk Count |
|---|---|---|
DOC-NHS-004 | Asthma (First aid and management) | 8 chunks |
DOC-NHS-005 | Burns and scalds | 7 chunks |
DOC-NHS-006 | Cuts and grazes | 9 chunks |
DOC-NHS-007 | Dehydration | 6 chunks |
DOC-NHS-008 | Diarrhoea and vomiting | 11 chunks |
DOC-NHS-009 | Headaches (Tension, migraine, cluster) | 8 chunks |
DOC-NHS-010 | High temperature (fever) in children | 10 chunks |
DOC-NHS-011 | Anaphylaxis & insect bites/stings | 9 chunks |
DOC-NHS-012 | Chest pain (Cardiac and non-cardiac) | 9 chunks |
DOC-NHS-013 | Stroke (FAST recognition) | 7 chunks |
DOC-NHS-014 | Sepsis (Red flag indicators) | 8 chunks |
DOC-NHS-015 | Meningitis | 16 chunks |
DOC-NHS-016 | Nosebleed | 6 chunks |
DOC-NHS-017 | Allergic rhinitis | 5 chunks |
| Total | 14 Conditions | 119 Chunks |
CANDIDATE_B_CONTEXT_AWARE_DISAMBIGUATION (independently validated from Phase 6K).92224DC6CB0F81C92B8A2869AC562D6CC63B291E36D373F6FE22B524F594EC8A.1cc216db046264d52bb05616e20123c71b77b56623b17a14c018d0e743ad86ae.44D0602F730D6460E6FEFA431BD5C09005B48CE92B47D02832532E5868D4AA58.[!NOTE] Banglish Development Status:
Further Banglish vocabulary expansion remains future research work and must be evaluated as a separately versioned candidate. The validated Candidate B configuration remains frozen and untouched.
To demonstrate the difference between deterministic interrogation and adaptive clarification:
[Turn 1]: User sends: "amar paye betha, ki korbo?"
├── Query Understanding: Language=Banglish, Body Part="leg", Ambiguity=HIGH (Broad anatomical region).
├── Adaptive Planner: Scores candidates (Sub-location=0.75, Mechanism=0.65, Duration=0.35).
├── Question Selected: Sub-location ("পায়ের কোন অংশে ব্যথা হচ্ছে?").
├── Quick Chips: [পায়ের পাতা] [গোড়ালি] [পিণ্ডলি] [হাঁটু] [উরু] (Observable anatomical regions only).
└── Context Updated: asked_questions=["sub_location"].
[Turn 2]: User clicks [গোড়ালি] and inputs: "hatar somoy mochkay gechilo"
├── Query Understanding: Sub-location="ankle", Mechanism="sprain/twist", Trauma=True.
├── Adaptive Planner:
│ ├── Redundancy Checks: sub_location (-1.00), mechanism (-1.00).
│ ├── Topic Coverage: Ankle sprains/twists are detected as OUT-OF-CORPUS (NHS-004..017).
│ └── Early Stopping Rule B: UNSUPPORTED_TOPIC triggers immediately.
└── Response: Honest abstention explaining that ankle sprains are outside the active corpus,
suppressing irrelevant NHS burns/cuts cards, and providing general safe advice to rest,
elevate, and seek clinical evaluation.
└── Conversation terminates cleanly in 2 turns.
frontend/):
backend/):
intfloat/multilingual-e5-small (384-dim embeddings)BAAI/bge-reranker-v2-m3BaseLLMProvider interface (OpenAI-compatible local/remote endpoints)OutputValidator for deterministic citation and evidence boundary verification| Environment | Host / URL | Role | Status |
|---|---|---|---|
| Frontend Web App | https://drmomenul.vercel.app | Interactive UI with quick chips, citations, and language selector | DEPLOYED (Vercel SPA) |
| Backend API | http://localhost:8000 | FastAPI server with Candidate B retrieval and Adaptive Planner | DEVELOPMENT / LOCAL RUNTIME |
| Production Backend | Pending Cloud Deployment | Containerized microservice (e.g. Render) with cloud health checks | NEXT (Phase 8A/8B) |
[!IMPORTANT] The backend is currently a local/research runtime unless independently verified otherwise. The complete end-to-end system is not yet fully production cloud-deployed.
drmomenul.vercel.app and Render backend# Navigate to project root
cd "Dr. Md. Momenul Islam"
# Create and activate virtual environment
python -m venv .venv
.venv\Scriptsctivate # Windows PowerShell
# source .venv/bin/activate # Linux / macOS
# Install backend dependencies
pip install -r backend/requirements.txt
# Run FastAPI backend with Uvicorn
$env:PYTHONPATH="backend" # Windows PowerShell
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload --app-dir backend
The backend API is accessible at http://localhost:8000. Interactive OpenAPI documentation is at http://localhost:8000/docs.
# In a separate terminal
cd frontend
npm install
npm run dev
The frontend UI is accessible at http://localhost:5173.
# Run complete Phase 7C pytest test suite
$env:PYTHONPATH="backend"
pytest backend/tests/test_phase_7c_adaptive_clarification.py -v
Developed for software engineering and clinical informatics research. Evidence passages are ingested from NHS.uk under the Open Government Licence v3.0 (OGL v3.0).
24 commits
Python
59.8%
HTML
38.0%
TypeScript
2.1%
A Bangladesh-focused Conversational, Evidence-Grounded Health Assistant (Research & Product Prototype)
[!WARNING] Research Prototype & Medical Disclaimer [NOT CLINICALLY VALIDATED]:
This system is an experimental software research and product prototype developed solely for technical, algorithmic, and conversational evaluation. It is not an AI doctor, is not a diagnostic engine, does not provide disease probability scores or clinical labels ("you probably have X"), does not prescribe treatments or medications, and is not a replacement for qualified clinicians. All emergency routing and clarification mechanisms are software engineering implementations and have not undergone clinical trials or regulatory medical validation.
The project has evolved from a controlled information retrieval benchmark into a conversational, evidence-grounded health assistant prototype designed for Bangladesh. It aims to bridge the gap between colloquial, multi-lingual, and often underspecified user queries (in English, Native Bengali বাংলা, Standard Banglish, and Abbreviated Banglish) and authoritative, verified clinical guidance from vetted sources.
| Stage | Focus Area | Description | Status |
|---|---|---|---|
| Stage 1 | Evidence Ingestion & Retrieval Research | Controlled ingestion of NHS First Aid/acute topics with Hybrid-600 semantic windowing and SHA-256 provenance tracking. | COMPLETED / VERIFIED |
| Stage 2 | Multilingual & Banglish Retrieval | Development of Track A normalizer, keyword anchor mapping, cross-encoder reranking, and debiased dual-anchor scoring (Candidate B freeze). | COMPLETED / VERIFIED |
| Stage 3 | Grounded Generation Architecture | Implementation of BaseLLMProvider, deterministic OutputValidator, citation verification, and Policy C adaptive gating. | COMPLETED / VERIFIED |
| Stage 4 | Evidence Sufficiency & Safety Routing | Classification into explicit states (SUPPORTED_BY_ACTIVE_CORPUS, POSSIBLE_MISMATCH, UNSUPPORTED_BY_ACTIVE_CORPUS, POTENTIAL_EMERGENCY). | COMPLETED / VERIFIED |
| Stage 5 | Conversational Clarification (Phase 7A/7B) | Query understanding, ambiguity detection, structured conversation state, quick-select chips, and multi-turn state preservation. | COMPLETED / VERIFIED |
| Stage 6 | Adaptive Clarification (Phase 7C) | Mathematical Question-Utility model, 4 early stopping rules, duplicate question suppression, and turn-minimization engine. | COMPLETED / VERIFIED |
┌────────────────────────────────────────────────────────┐
│ User Query (English / বাংলা / Banglish) │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Query Understanding Service │
│ - Intent & Language Detection (Auto / বাংলা / EN) │
│ - Extraction (body part, duration, severity, age) │
│ - Red Flag / Emergency Keyword Detection │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Structured Conversation State │
│ - Multi-Turn State (`ConversationContextState`) │
│ - Dimension Tracking (`asked_questions`) │
│ - Missing High-Value Fields Identification │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ Adaptive Clarification Planner (Phase 7C) │
│ - 6-Factor Question-Utility Model: │
│ Utility = G_ret + G_saf + R_amb + C_corp - P_red - P_unnec│
│ - 4 Early Stopping Rules Evaluation │
└─────────┬──────────────────────┬───────────────────────┘
│ │
[Clarification Needed]│ │[Direct / Stopped]
▼ ▼
┌───────────────────────────────┐ ┌─────────────────────────────────────┐
│ Clarification Response │ │ Candidate B Retrieval Service │
│ - Highest Utility Question │ │ - Track A Lexical Normalization │
│ - Observable Quick Chips │ │ - Dense: multilingual-e5-small │
│ - Context Update & Loop │ │ - Cross-Encoder: bge-reranker-v2-m3│
└───────────────────────────────┘ │ - 0.85x Overview Debiasing │
│ - Candidate B Dual Fusion │
└──────────────────┬──────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Evidence Sufficiency Router │
│ - Top Rerank Threshold (>= 0.65) │
│ - Out-of-Corpus Filter (< 0.40) │
└─────────┬─────────┬────────┬────────┘
│ │ │
┌────────────────────────┘ │ └────────────────────────┐
▼ ▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐ ┌───────────────────────────┐
│ Grounded Answer Response │ │ Honest Abstention Response│ │ Emergency Response │
│ - Citations & Passages │ │ - Irrelevant Cards Hidden │ │ - Emergency Protocols │
│ - Policy C Evidence Cards │ │ - Safe Non-Claim Guidance │ │ - Red Flag Escalation │
│ - Medical Disclaimers │ │ - Clinician Advisory │ │ - Immediate Help Hotlines │
└───────────────────────────┘ └───────────────────────────┘ └───────────────────────────┘
The active application corpus consists of 119 Hybrid-600 semantic chunks derived from 14 verified NHS clinical evidence sources (DOC-NHS-004 through DOC-NHS-017):
| Source ID | Condition / Clinical Topic | Chunk Count |
|---|---|---|
DOC-NHS-004 | Asthma (First aid and management) | 8 chunks |
DOC-NHS-005 | Burns and scalds | 7 chunks |
DOC-NHS-006 | Cuts and grazes | 9 chunks |
DOC-NHS-007 | Dehydration | 6 chunks |
DOC-NHS-008 | Diarrhoea and vomiting | 11 chunks |
DOC-NHS-009 | Headaches (Tension, migraine, cluster) | 8 chunks |
DOC-NHS-010 | High temperature (fever) in children | 10 chunks |
DOC-NHS-011 | Anaphylaxis & insect bites/stings | 9 chunks |
DOC-NHS-012 | Chest pain (Cardiac and non-cardiac) | 9 chunks |
DOC-NHS-013 | Stroke (FAST recognition) | 7 chunks |
DOC-NHS-014 | Sepsis (Red flag indicators) | 8 chunks |
DOC-NHS-015 | Meningitis | 16 chunks |
DOC-NHS-016 | Nosebleed | 6 chunks |
DOC-NHS-017 | Allergic rhinitis | 5 chunks |
| Total | 14 Conditions | 119 Chunks |
CANDIDATE_B_CONTEXT_AWARE_DISAMBIGUATION (independently validated from Phase 6K).92224DC6CB0F81C92B8A2869AC562D6CC63B291E36D373F6FE22B524F594EC8A.1cc216db046264d52bb05616e20123c71b77b56623b17a14c018d0e743ad86ae.44D0602F730D6460E6FEFA431BD5C09005B48CE92B47D02832532E5868D4AA58.[!NOTE] Banglish Development Status:
Further Banglish vocabulary expansion remains future research work and must be evaluated as a separately versioned candidate. The validated Candidate B configuration remains frozen and untouched.
To demonstrate the difference between deterministic interrogation and adaptive clarification:
[Turn 1]: User sends: "amar paye betha, ki korbo?"
├── Query Understanding: Language=Banglish, Body Part="leg", Ambiguity=HIGH (Broad anatomical region).
├── Adaptive Planner: Scores candidates (Sub-location=0.75, Mechanism=0.65, Duration=0.35).
├── Question Selected: Sub-location ("পায়ের কোন অংশে ব্যথা হচ্ছে?").
├── Quick Chips: [পায়ের পাতা] [গোড়ালি] [পিণ্ডলি] [হাঁটু] [উরু] (Observable anatomical regions only).
└── Context Updated: asked_questions=["sub_location"].
[Turn 2]: User clicks [গোড়ালি] and inputs: "hatar somoy mochkay gechilo"
├── Query Understanding: Sub-location="ankle", Mechanism="sprain/twist", Trauma=True.
├── Adaptive Planner:
│ ├── Redundancy Checks: sub_location (-1.00), mechanism (-1.00).
│ ├── Topic Coverage: Ankle sprains/twists are detected as OUT-OF-CORPUS (NHS-004..017).
│ └── Early Stopping Rule B: UNSUPPORTED_TOPIC triggers immediately.
└── Response: Honest abstention explaining that ankle sprains are outside the active corpus,
suppressing irrelevant NHS burns/cuts cards, and providing general safe advice to rest,
elevate, and seek clinical evaluation.
└── Conversation terminates cleanly in 2 turns.
frontend/):
backend/):
intfloat/multilingual-e5-small (384-dim embeddings)BAAI/bge-reranker-v2-m3BaseLLMProvider interface (OpenAI-compatible local/remote endpoints)OutputValidator for deterministic citation and evidence boundary verification| Environment | Host / URL | Role | Status |
|---|---|---|---|
| Frontend Web App | https://drmomenul.vercel.app | Interactive UI with quick chips, citations, and language selector | DEPLOYED (Vercel SPA) |
| Backend API | http://localhost:8000 | FastAPI server with Candidate B retrieval and Adaptive Planner | DEVELOPMENT / LOCAL RUNTIME |
| Production Backend | Pending Cloud Deployment | Containerized microservice (e.g. Render) with cloud health checks | NEXT (Phase 8A/8B) |
[!IMPORTANT] The backend is currently a local/research runtime unless independently verified otherwise. The complete end-to-end system is not yet fully production cloud-deployed.
drmomenul.vercel.app and Render backend# Navigate to project root
cd "Dr. Md. Momenul Islam"
# Create and activate virtual environment
python -m venv .venv
.venv\Scriptsctivate # Windows PowerShell
# source .venv/bin/activate # Linux / macOS
# Install backend dependencies
pip install -r backend/requirements.txt
# Run FastAPI backend with Uvicorn
$env:PYTHONPATH="backend" # Windows PowerShell
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload --app-dir backend
The backend API is accessible at http://localhost:8000. Interactive OpenAPI documentation is at http://localhost:8000/docs.
# In a separate terminal
cd frontend
npm install
npm run dev
The frontend UI is accessible at http://localhost:5173.
# Run complete Phase 7C pytest test suite
$env:PYTHONPATH="backend"
pytest backend/tests/test_phase_7c_adaptive_clarification.py -v
Developed for software engineering and clinical informatics research. Evidence passages are ingested from NHS.uk under the Open Government Licence v3.0 (OGL v3.0).
24 commits
Python
59.8%
HTML
38.0%
TypeScript
2.1%