
MedWeight is a clinical-grade, AI-powered patient engagement platform built for the Obesity Medicine and Diabetes Institute. It operates through two complementary interfaces: an SMS-based chatbot accessible to patients via text message 24/7, and a PHP-based administrative portal that gives clinicians and staff real-time visibility into patient conversations, clinical flags, screening signals, coaching status, and population-level analytics.
The platform is designed to address a fundamental gap in chronic disease management: the 99% of a patient's journey that happens between clinic visits. For patients managing obesity, diabetes, metabolic syndrome, mental health comorbidities, and the complex behavioral challenges associated with these conditions, MedWeight provides continuous, intelligent support that operates at a level of clinical sophistication no single human provider could deliver at scale.
The system's scope extends well beyond medication management. It encompasses a comprehensive educational curriculum, structured coaching programs with dedicated AI coach personas, validated clinical screening instruments, and a governance infrastructure designed for clinical accountability. The core design objectives are:
Automated patient education and engagement through a comprehensive video-based academy spanning seven clinical domains
Structured, opt-in coaching programs with customizable scheduling, session guardrails, and behavioral accountability mechanisms
Dual-layer AI interaction: a responsive general support mode and a deep, MI-consistent coaching mode that patients must explicitly elect to access
Real-time clinical screening using both AI-generated structured output and keyword-based detection across 25+ medical conditions
Completed questionnaire scoring with chronological progress tracking, enabling both patients and clinicians to visualize change over time
Full clinical governance with message integrity verification, audit trails, versioned rule management, and human-in-the-middle override capabilities
Seamless integration with the clinic's existing MySQL patient database, extending rather than duplicating records
The educational foundation of MedWeight is the MedWeight Academy, a structured video-based curriculum imported from the clinic's learning management system. The Academy is organized into seven top-level modules, each containing multi-week courses and standalone special topics:
Foundational approaches to sustainable weight loss and metabolic health
Courses on food addiction, building a healthy outlook, and special topics including depression, anxiety, sleep, emotional eating, addiction, and physical intimacy
Evidence-based nutritional education for metabolic patients
Practical cooking courses and nutritional skills
Exercise programming including fall prevention, women's exercise, recovery, and fueling for movement
Multi-week courses on gaining momentum, overcoming barriers to change, values, motivation, and self-sabotage
Broader wellness, disease management, diabetes, and bariatric topics
Each lesson is imported with its video transcript parsed from VTT subtitle files, chunked for retrieval, and indexed using MySQL FULLTEXT search. When a patient asks a question, the RAG (Retrieval-Augmented Generation) pipeline searches this content and injects relevant context into Claude's system prompt, along with breadcrumb navigation (e.g., "Mental Health & Wellbeing > Food Addiction (8 weeks) > Session 3: Spirituality and Meditation") and direct video links so the patient can watch the source material.
An automated content drip campaign, managed through n8n workflows, delivers stage-appropriate content to patients on a weekly schedule. Patients progress through a journey defined in a journey_definitions table, advancing from Week 1 through Maintenance, with content tailored to their current stage and excluding material they've already completed.
Patient interactions operate across two distinct layers, each with its own behavioral expectations and clinical depth:
Provides responsive, SMS-friendly answers to patient questions about medications, side effects, nutrition, hydration, movement, and emotional wellbeing. The AI responds in a motivational interviewing style grounded in CBT/ACT frameworks, keeping messages concise and warm. This layer references academy content with video links but maintains brief, educational interactions. It is the default mode for all enrolled patients.
A fundamentally different experience. Patients must explicitly elect coaching by responding to a pathway invitation with a specific keyword (*GO FOR COACHING). They then provide their preferred schedule using natural language ("Mondays, Wednesdays, Fridays at 3pm"), which the system parses and converts into a recurring session calendar.
Coaching sessions are time-bounded (30 or 60 minutes), led by a specialized AI coach persona with a detailed professional bio, and use a deeper system prompt emphasizing reflective listening, change talk evocation, open-ended exploration, and homework assignment.
The coaching system enforces strict behavioral guardrails:
Sessions only begin when the patient sends START during a scheduled window. Conversations outside coaching hours route to the general support layer, not the coaching prompt.
SMS reminders are sent before scheduled sessions (1 hour and 5 minutes prior). After schedule confirmation, patients are asked whether they want to start their first session immediately or wait for their scheduled time.
No-shows are tracked: if a patient fails to start a scheduled session within 10 minutes, it is recorded. Consecutive no-shows, cancellations, or reschedules trigger progressive consequences, up to and including automatic revocation of coaching privileges after a configurable threshold (default: 3 consecutive infractions).
The strike count and threshold are admin-configurable per clinic policy. Patients can cancel or reschedule individual sessions, but the system enforces accountability.
Each academy module has a dedicated coach persona with a crafted professional biography. When a patient accepts coaching, they receive their coach's bio including their expertise and credentials, framing the interaction as access to a world-class specialist. Ten coach personas are deployed, covering weight management, mental health, nutrition, cooking skills, movement, habit formation, disease management, diabetes, and bariatric surgery, plus a default general coach.
MedWeight performs clinical screening at two complementary layers:
Every response generated by Claude includes a structured JSON output block identifying recommended questionnaires, detected conditions with confidence levels (high/medium/low), and rule flags (require_review, block, warn). This screening data is stored alongside every conversation and aggregated in a Screening Signals panel on the patient detail view, showing trends over a rolling window.
The system recognizes 9 validated screening instruments:
A PHP-side ClinicalFlagAnalyzer scans patient messages against a library of 25+ conditions spanning 10 clinical categories. Each condition definition includes severity classification, keyword sets that recognize both lay language and medication names, associated screening tools with scoring thresholds and links, and recommended clinical next steps.
Sleep apnea, insomnia
Depression, anxiety, suicidal ideation, body image
Binge eating, emotional eating, night eating
Erectile dysfunction
Low testosterone
Diabetes risk
GERD
Chronic pain, osteoarthritis
Alcohol use
Chronic fatigue
The questionnaire system is fully operational as a closed-loop workflow. Administrators assign validated instruments (PHQ-9, GAD-7, STOP-BANG, PCL-5, AUDIT-C, Quick Wellness Check) to patients from the admin dashboard. The patient receives an SMS with a tokenized link to a mobile-responsive completion page. Questions are rendered one at a time with a progress bar. Upon completion, the system:
Critically, the system supports chronological progress tracking. When a patient completes the same questionnaire type multiple times, a progress viewer renders a line chart showing score trends over time, with smart improvement detection that accounts for whether lower or higher scores indicate improvement (e.g., lower PHQ-9 = improvement, but some instruments score in the opposite direction). The view includes first-vs-latest comparison, completion history table, and improvement percentage calculations. This gives both patients and clinicians a visual record of clinical trajectory, not just point-in-time snapshots.
The administrative portal provides nine functional areas accessible through a tabbed interface:
Aggregate statistics (total patients, flagged patients, messages today, patients by journey stage, top clinical flags) with one-click access to flagged patient review and batch analysis
Searchable/filterable patient list with per-patient detail views showing conversation history, clinical flags with mention counts, screening signals, clinical overrides, clinical notes, and coaching status
Full-text search across all patient conversations with flag-type filtering
Database-driven workflow management (create, edit, toggle, run), message template library with 25+ templates across 9 categories, scheduled message queue with cancellation, and immediate quick-send capability
Versioned condition map and clinical ruleset management with visual editing for symptom weights, condition exclusions, localization labels, and paired release activation with audit logging
Human-in-the-middle governance allowing clinicians to force or block specific screening recommendations at global or per-patient scope, with priority ranking, time windows, and clinical rationale documentation
Message integrity verification using SHA-256 hash checks (prompt_hash, context_hash, response_hash, request_fingerprint) with per-message PASS/FAIL status and drill-down detail
Content ingestion for videos (YouTube, direct URL), PDFs, articles, and text, with chunk visualization and journey-stage assignment
SMS join keyword configuration and system parameters
Every significant administrative action is logged in an audit trail with admin user ID, action type, details, and IP address. The release system ensures that condition maps and clinical rulesets are versioned, clonable, and activated as paired releases, preventing configuration drift between detection logic and screening rules.
MedWeight provides something no traditional clinic model can: continuous, accessible, expert-level support that meets patients where they are — on their phones, in their own time, in plain language. For patients managing complex chronic conditions, this changes the fundamental dynamics of care:
Patients on GLP-1 medications face daily challenges (nausea, injection anxiety, food aversions, protein targets) that don't wait for quarterly appointments. Having an informed, empathetic resource available at any hour lowers the barrier to seeking help.
The coaching layer offers something unprecedented: structured, recurring sessions with an AI specialist whose expertise is drawn from the clinic's own educational content. Patients who opt in receive the kind of sustained behavioral intervention that would typically require a dedicated therapist, nutritionist, or health coach.
The questionnaire progress tracking gives patients visible evidence of their improvement. Seeing a PHQ-9 score drop from 15 to 8 over three months is concrete, motivating proof that their effort is working.
The academy content library means patients aren't just receiving generic advice — they're accessing the same expert-developed curriculum the clinic would present in person, delivered contextually when it's most relevant to their current question or concern.
Patients who mention suicidal ideation, severe symptoms, or crisis situations are immediately flagged, given crisis resources, and directed to contact the clinic — whether it's 2pm or 2am.
The platform transforms clinical monitoring from reactive chart review to proactive, continuous surveillance:
Instead of learning about worsening depression at a follow-up visit, providers see flagged conversations with matched symptoms, confidence levels, and recommended screening instruments in near real-time.
The dual-layer screening (AI-generated structured JSON + keyword-based detection) provides redundancy: clinical concerns are caught even if one layer misses them.
Questionnaire trend data enables clinicians to track treatment response longitudinally without additional clinical encounters.
The override system allows providers to exercise clinical judgment over the AI's screening recommendations — forcing specific questionnaires for patients who need closer monitoring, or blocking recommendations that aren't clinically appropriate for a particular individual.
Shows which patients have been invited to coaching, who has accepted, who is actively engaged, and who has been revoked for non-compliance — all without manual tracking.
Top flags, patients by stage, activity trends surface insights that would be invisible from individual chart reviews. The message template library and scheduled messaging system allow high-touch engagement at scale.
The current system is a mature, working platform. The following extensions represent natural growth paths that would deepen its clinical impact and patient engagement:
The journey stage system currently advances on a time-based schedule. Adapting progression to actual patient behavior — engagement frequency, content completion, coaching attendance, screening scores, and self-reported outcomes — would make the experience feel personalized rather than calendar-driven. A patient struggling with side effects in Week 2 shouldn't advance to exercise goals in Week 3.
Currently, clinicians can send messages through the admin portal, but responses route back through the AI. A "provider takeover" mode — where a clinician can intervene directly in a flagged conversation with the AI stepping back — would address the most critical clinical moments.
This would allow seamless escalation from AI to human for situations requiring immediate clinical judgment, with the conversation thread remaining unbroken.
Integrating weight measurements, lab values (HbA1c, lipids, metabolic panels), medication adherence data, and questionnaire scores into a longitudinal patient dashboard would create a comprehensive clinical picture.
Track body weight trends over time integrated into the patient dashboard
HbA1c, lipids, metabolic panels integrated longitudinally
Track adherence data alongside clinical outcomes
Validated instrument scores aggregated into a comprehensive clinical picture
This data, aggregated across the patient population, would also enable the Institute to measure program effectiveness, demonstrate clinical outcomes to payers, and publish results.
Using conversation patterns, engagement data, and screening signal trajectories to trigger proactive outreach — not just on inactivity, but on detected risk patterns.
A patient who mentions stress eating three times in a week could automatically receive a targeted resource; a patient whose PHQ-9 worsens could be flagged for an earlier follow-up before the situation escalates.

The architecture already supports web sessions. Extending to a patient portal or mobile application with richer interaction — image-based meal logging for nutritional feedback, medication tracking, appointment scheduling, and coaching session video/audio — would increase engagement depth while maintaining SMS as the low-friction entry point that makes the platform universally accessible.
The governance and audit infrastructure positions MedWeight to generate the clinical documentation needed for insurance billing, regulatory compliance, and quality reporting. Automated session summaries, screening documentation, and outcome reports could reduce the administrative burden on providers while strengthening the evidentiary basis for reimbursement of digital health interventions.
MedWeight represents a working clinical system that has moved well beyond proof-of-concept. It is actively serving patients, generating screening data, delivering structured coaching, scoring validated instruments, and providing clinicians with the tools to monitor and intervene at a level of granularity and timeliness that was not previously achievable. The platform's architecture — built on existing clinic infrastructure, respecting existing patient records, and governed by versioned clinical rules with full audit capability — is designed for the operational realities of a clinical practice, not a technology demonstration.
Across 10 clinical categories
Validated clinical tools
Specialized AI coaches deployed
Clinical education domains
Current as of March 2026