Inspiration: Why Western Fitness Apps Fail in Bangladesh

In Bangladesh, public health is facing a quiet, compounding epidemic:

  1. The Asian BMI Paradox: Clinical literature shows that South Asians develop Type 2 diabetes, visceral adiposity, and cardiovascular complications at a BMI as low as 23.0 (compared to the standard WHO cut-off of 25.0).
  2. Rice Monoculture: According to national surveys (BBS HIES & INFS Dhaka University), polished rice supplies more than 65% of daily caloric intake in Bangladeshi households, driving dramatic postprandial glucose surges.
  3. The Shared-Pot Reality: In a typical Bangladeshi household, meals are cooked in communal pots (deg or karai) and measured with household utensils (bati, chamoch, hata). Western fitness trackers (MyFitnessPal, LoseIt, Cronometer) fail completely because they expect people to weigh individual raw chicken breasts and avocado slices on digital gram scales before eating.
  4. The Shame Spiral: When an individual attends a Friday wedding feast (kacchi dawat), Western apps react punitively—slashing calories the next day, triggering a cycle of guilt, metabolic slowdown, and eventual app abandonment.

We built Deshi Health Companion to create an evidence-based, culturally native health companion built specifically around how Bangladeshis actually cook, eat, move, and live.


What We Learned

  • Never Trust an LLM with Calorie Arithmetic: Early in our research, we saw language models produce wild, unpredictable arithmetic errors when multiplying weights, portions, and caloric densities. We learned that an AI health product must maintain a strict architectural boundary: deterministic TypeScript algorithms for 100% of the math, and generative AI solely for natural language parsing and empathetic coaching.
  • Cultural Units are Scientifically Modelable: A medium bati of cooked parboiled rice (bhat) weighs roughly 240g, delivering ~312 kcal; a standard ladle of patla masur dal is ~45 kcal; a dim bhaji fried in mustard oil is ~115 kcal. By codifying local household measures from the Food Composition Table for Bangladesh (FCTB) and BIRDEM guidelines, we bridged the gap between colloquial habits and nutritional precision.
  • Feast Recovery Must Protect the Metabolic Floor: Human metabolism is adaptive. Slashing calories below basal metabolic needs after a high-intake day triggers hormonal hunger spikes and muscle catabolism. A gentle, multi-day rebalancing strategy that recovers 50–70% of a surplus over 3 to 7 days produces sustainable, long-term adherence without shame.
  • Environmental Context Matters as Much as Calories: In Dhaka and major industrial hubs, air quality index (AQI) frequently exceeds 160–200, and summer feels-like temperatures top 40°C. Recommending outdoor brisk walks under hazardous particulate levels or extreme heat index is medically irresponsible. A health companion must incorporate ambient environmental awareness.

How We Built It

We designed the product as an offline-capable, lightning-fast Progressive Web App (PWA) with a modular architecture:

┌─────────────────────────────────────────────────────────────┐
│        Client UI: Next.js 16 (App Router) + Bun + PWA       │
│  Bilingual (EN/BN) · Offline FCTB Search · Tailwind CSS v4  │
└──────────────────────────────┬──────────────────────────────┘
                               │ Client Actions / Queries
┌──────────────────────────────▼──────────────────────────────┐
│                  Next.js App Server Layer                   │
│   Server Functions · Route Handlers · Strict Validation     │
└──────────────────────────────┬──────────────────────────────┘
                               │
       ┌───────────────────────┴───────────────────────┐
       ▼                                               ▼
┌───────────────────────────────┐       ┌──────────────────────────────┐
│   Pure Deterministic Engine   │       │   Local Verified AI & RAG    │
│ • Asian BMI (23.0 Cutoff)     │       │ • FCTB / BIRDEM Knowledge    │
│ • 7-Day Gentle Rebalancer     │       │ • Groq Llama 3.3 70B Coach   │
│ • Shared-Pot Fraction Math    │       │ • Strict Unsourced-Number    │
│ • Weather & AQI Safe Gate     │       │   Guardrail & Plain-Text API │
└───────────────────────────────┘       └──────────────────────────────┘
                               │
┌──────────────────────────────▼──────────────────────────────┐
│                   Convex Cloud Database                     │
│  User Profiles · Meal Logs · Weigh-ins · Weather State      │
└─────────────────────────────────────────────────────────────┘
  1. Frontend & Mobile UX:

    • Next.js 16 App Router & Bun: Server-rendered for near-instant first-contentful paint, bundled with Tailwind CSS v4 and responsive warm Deshi design tokens.
    • Multilingual Support: Real-time toggling between Bengali, English, and phonetic Banglish ("dupure 1 bati bhat ar rui mach").
    • Offline PWA Engine: IndexedDB and client-side memory trie for instant search across 318+ local foods without requiring mobile data.
  2. Deterministic Nutritional Engine:

    • Computes BMR, TDEE, and gentle deficit targets via pure mathematical functions verified by 134 automated unit and property-based test suites.
    • Shared-Pot Converter: Converts household fractions (e.g., eating 1/5th of a 1,000g family pot of dal) directly into verified macronutrient estimates.
    • Weather Guardrail: Automatically queries regional Open-Meteo data for all 8 administrative divisions. When AQI exceeds 150 or feels-like temperature exceeds 38°C, outdoor workout suggestions seamlessly switch to indoor stairs or low-impact apartment routines.
  3. Grounded AI Coaching & Safety Rails:

    • Powered by Groq's high-throughput Llama 3.3 70B versatile endpoint.
    • Enforces a strict plain-text only system prompt, forbidding markdown asterisks or code formatting to ensure clean readability in chat bubbles.
    • Incorporates a strict domain boundary: immediately and politely refuses any non-health queries (coding, trivia, entertainment) to focus purely on human health and Bangladeshi nutrition.
    • Employs an automated unsourced-number validator that intercepts LLM output and flags any fabricated numerical claims not grounded in verified clinical excerpts.
  4. Wave 6 Personalization Features:

    • Condition-Aware Plate Presets: Tailored glycemic plates for diabetes management (limiting starchy carbohydrates, prioritizing bitter gourd and leafy greens) and sodium watch plates for hypertension (eliminating dry fish shutki and high-sodium pickles achar).
    • Ramadan & Fasting Mode: Automatically disables calorie deficits during fasting windows and provides a 4-slot hydration pacing schedule (9 glasses distributed from Iftar to Sehri).
    • Taka-to-Protein Economics: Live Dhaka market price benchmarks calculating protein density per ৳100 (spotlighting budget heroes like masur dal, farm eggs, pangas fish, and roasted soybeans).

Challenges We Faced

  1. Modeling Shared-Pot Cooking Math Without Weighing Scales:

    • Problem: In Bangladesh, no one weighs cooked meals with kitchen scales before dinner.
    • Solution: We created a two-step calibrated bati model. Users calibrate their daily ceramic or stainless steel bowl once using standard household vessels, allowing the app to translate "1 bati rice" into accurate cooked weight (≈240g) and macronutrient values seamlessly.
  2. Eliminating LLM Hallucinations in Health Contexts:

    • Problem: Language models frequently hallucinate dietary numbers (e.g., claiming a samosa has 12g of protein or inventing random calorie targets).
    • Solution: We completely decoupled arithmetic from the AI. The LLM only parses natural language text into food identities; all caloric math is computed by our deterministic FCTB database. Furthermore, our post-processing parser inspects all coach replies and enforces a strict plain-text presentation.
  3. Phonetic Banglish & Dialectical Meal Parsing:

    • Problem: Bangladeshi users express their meals in diverse ways—standard Bengali script (ভাত ও ডাল), phonetic Banglish ("dupure 2 plate biriyani khasi"), or mixed English ("1 egg poch with tea").
    • Solution: We built a multi-alias phonetic dictionary mapping colloquial slang, common regional dish names (morog polao, chotpoti, shorshe ilish, alu bhorta), and household units to standard nutritional database entries.
  4. Feast Day Recovery vs. The Deficit Trap:

    • Problem: Traditional calorie counters either ignore overages or punish users with severe starvation goals the following day.
    • Solution: We designed the Adaptive 7-Day Rebalancer, which spreads a feast surplus across subsequent days while strictly clamping trims so the daily target never drops below the user's metabolic floor.

Built With

Share this project:

Updates

Submission history