Skip to content

om-gorakhia/synpulse

Repository files navigation

SynPulse Logo

SynPulse

Agentic AI for Chronic Disease Management & Patient Empowerment

NUS–Synapxe–IMDA AI Innovation Challenge 2026 · Problem Statement 1

Python FastAPI Gemini SEA-LION Ollama


Screen.Recording.2026-03-19.081744.mp4

The Problem

Singapore's elderly chronic disease patients face an Adherence Void — the gap between clinic visits where no professional guidance exists. Current tools like HealthHub are passive, require patient initiative, and lack cultural fluency. 70% of diabetes management happens outside the clinic, yet patients navigate this alone.

Our Solution

SynPulse is a multi-agent AI system that bridges the Adherence Void through:

  • Proactive, agent-initiated engagement — the system contacts the patient, not the other way around
  • Culturally fluent communication — natural Singlish, hawker centre food knowledge, TCM-aware responses
  • Clinical-grade safety — 3-layer guardrail (regex → SEA-GUARD → care plan cross-check), never prescribes
  • Transparent architecture — every agent decision is traced and auditable

Architecture

                    ┌─────────────────────┐
                    │   ORCHESTRATOR      │
                    │   (ManagerAgent)    │
                    └──┬────┬────┬────┬──┘
              ┌────────┘    │    │    └────────┐
              ▼             ▼    ▼             ▼
       ┌──────────┐  ┌────────┐  ┌──────────┐  ┌──────────┐
       │NUTRITION  │  │LIFESTYLE│  │CLINICAL  │  │CONVERSA- │
       │SPECIALIST │  │ COACH   │  │GUARDIAN  │  │TION AGENT│
       │SEA-LION   │  │SEA-LION │  │MERaLiON  │  │Gemini    │
       └─────┬─────┘  └───┬────┘  └────┬─────┘  └────┬─────┘
             └─────────────┴─────┬──────┴──────────────┘
                                 ▼
                       ┌─────────────────┐
                       │ SAFETY AGENT    │
                       │ L1: Regex       │
                       │ L2: SEA-GUARD   │
                       │ L3: Care Plan   │
                       └────────┬────────┘
                           ┌────┴────┐
                         SAFE?     BLOCKED?
                           ▼         ▼
                     [PATIENT]  [FALLBACK]

Key Design Principles:

  • Deterministic routing, generative content — which agent runs is rule-based; only the response is AI-generated
  • Hierarchical supervisor — all coordination through Orchestrator; no direct agent-to-agent communication
  • Graceful degradation — if any service is down, the system falls back without crashing

AI Services Used

Service Role Fallback
Gemini 2.5 Flash Primary reasoning, backup for all agents
Ollama (qwen3:14b) Local reasoning when available Gemini
SEA-LION v4 Text Singlish localisation, cultural fluency Gemini → Ollama
SEA-LION v4 Vision SG food image identification Ollama vision
MERaLiON Clinical Clinical trend analysis, SBAR generation Gemini → Ollama
SEA-GUARD Semantic safety moderation (Layer 2) Regex-only (Layer 1)

Features

For Patients

  • 📊 Dashboard — vitals, steps, meals, medications, mood at a glance
  • 💬 Ask SynPulse — chat with AI in natural Singlish
  • 🧠 AI Health Check — proactive risk assessment with actionable advice
  • 🍜 Meal Logging — auto-enriched from 36-item SG food database
  • 💊 Medication Tracking — adherence monitoring with gentle reminders
  • 🏆 Healthpoints — gamification to encourage healthy choices
  • 😊 Mood Journal — emotional check-ins with empathy mode

For Clinicians

  • 📋 SBAR Summaries — structured clinical notes auto-generated
  • ⚠️ Alert System — GREEN/YELLOW/RED with auto-escalation
  • 📖 Food Database — 36 Singaporean dishes with HPB-aligned nutrition data
  • 🏥 Clinical Thresholds — MoH CPG-sourced reference table

For Judges / Demo

  • 🔬 Agent Trace — live view of every agent action, model used, latency
  • 🌐 Service Status — real-time connectivity for all 5 AI services
  • 🎲 Simulated Users — one-click creation with 2 months of realistic history
  • 📈 60 days of bootstrapped data — demo user (Mr. Tan) with full medical history

Quick Start

Prerequisites

Setup (Windows)

# Clone the repo
git clone https://github.com/YOUR_TEAM/synpulse.git
cd synpulse

# Run the setup script
setup.bat

Setup (Manual)

# 1. Install dependencies
cd synpulse_app
pip install -r requirements.txt

# 2. Generate demo data (if synpulse_data/ doesn't exist)
cd ..
python generate_data.py
cd synpulse_app

# 3. Configure API keys
# Edit .env and add your Gemini API key

# 4. Run
python run.py
# Open http://127.0.0.1:8000

Optional: Enable Ollama (local AI)

# In a separate terminal:
ollama serve
ollama pull qwen3:14b
# Restart the app — Ollama will show as 🟢 in Agent Trace

Demo Walkthrough

  1. Open http://127.0.0.1:8000 → lands on Demo User (Mr. Tan)
  2. Explore demo data: Trends, Meals, Medications, Mood, Clinical View
  3. Click 🧠 Run Health Check → see AI-generated clinical assessment
  4. Ask "Is my glucose okay?" → get culturally-fluent AI response
  5. Navigate to 🔬 Agent Trace → see architecture in action
  6. Create a simulated user → 🎲 button generates 2 months of history
  7. Log a meal (e.g. "Char Kway Teow") → see AI nutritional analysis
  8. Check Healthpoints page → see gamification rewards

Project Structure

synpulse/
├── synpulse_app/                 ← Web application
│   ├── run.py                    ← Entry point: python run.py
│   ├── requirements.txt
│   ├── .env                      ← API keys (not in repo)
│   ├── backend/
│   │   ├── web.py                ← FastAPI routes (28 endpoints)
│   │   ├── agents.py             ← 5 AI agents + tracing
│   │   ├── api_clients.py        ← HTTP clients for 5 AI services
│   │   ├── triggers.py           ← Proactive trigger engine (7 categories)
│   │   ├── services.py           ← Business logic + simulated user generator
│   │   ├── database.py           ← SQLite schema (14 tables)
│   │   ├── schemas.py            ← Pydantic models
│   │   ├── demo_loader.py        ← Read-only demo data access
│   │   ├── ai_stubs.py           ← Risk score calculator
│   │   └── config.py             ← Configuration + .env loader
│   ├── templates/
│   │   └── app.html              ← Responsive UI (746 lines)
│   └── static/
│       ├── styles.css            ← Healthcare-themed CSS
│       └── app.js                ← Chart.js + interactions
├── synpulse_data/                ← Bootstrapped demo data (20 files)
├── generate_data.py              ← Data generator (reproducible)
├── docs/
│   └── SynPulse_Architectural_Framework.docx
├── .gitignore
├── .env.example
├── setup.bat                     ← Windows one-click setup
└── README.md

Bootstrapped Data (Mr. Tan)

Dataset Records Description
Vitals readings 569 Glucose, BP, HR over 59 days
Meal log 177 3 meals/day with food DB cross-refs
Step count 1,416 Hourly step data
Sleep log 59 Duration, quality, awakenings
Medication adherence 177 91% taken, 6.8% late, 2.3% missed
Mood check-ins 44 5-point mood + energy scale
Agent interactions 94 AI nudge history
Anomaly register 14 11 YELLOW + 3 RED events
SBAR summaries 22 Clinical notes for doctors
Reward points 48 Healthpoints transactions
Food reference 36 Singaporean dishes, HPB-aligned
Clinical thresholds 8 MoH CPG-sourced ranges

Team

Name Role
Om Tech Lead
Vera Product
Yangyi UX / Content
Zihan Data
Thinh Ops

License

This project was built for the NUS–Synapxe–IMDA AI Innovation Challenge 2026.

About

Agentic AI for Chronic Disease Management & Patient Empowerment — NUS-Synapxe-IMDA AI Innovation Challenge 2026

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors