Skip to content

mrbrightsides/safeguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

133 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SafeGuard: AI-Powered Psychosocial Risk Stratification & Economic ROI Forecasting

Prompt Opinion Hackathon 2026 SHARP Compliant A2A Integrated AI-Powered Accessibility-First License: MIT DOI OpenAIRE Software Heritage

React TypeScript Tailwind CSS Motion Vite Firebase PWA

SafeGuard is an enterprise-grade psychosocial health surveillance system focused on high-pressure environments. We employ a dual-tier market strategy:

  • Tier S (High Risk/High Impact): Tourism & Hospitality sector (Hotels, FnB).
  • Tier A (High Adoption/Tech-Native): Startups, IT companies, and Digital Agencies.

It integrates advanced Safespace AI/ML prognostic models with robust Health Economic Evaluation (HEE). Designed for modern organizations, it monitors, detects, and mitigates mental health burdens using WHO-standard ROI modeling and ICD-10 clinical frameworks.

πŸ”Ί THE MASTER HOOK

β€œ1 fatality is not 1 event β€” it is the visible tip of hundreds of ignored psychosocial signals.”

SafeGuard transforms Fatality (Suicide/CVD) from a lagging indicator into a preventable outcome by monitoring Bullying (UA/UC) and workplace stressors as leading indicators in high-pressure service environments.

πŸ›‘οΈ The SAFE Framework

SafeGuard operates on the SAFE mnemonic to ensure comprehensive mental health surveillance:

  • Sense: Digital anamnesis, wearable sync, and IoT-driven companion hardware scans.
  • Analyze: AI-driven risk stratification and prognostic modeling.
  • Flag: Automated alerting for Level 0-L2 clinical risks.
  • Engage: Personalized wellness roadmaps and clinical escalation.

πŸš€ Key Features

1. Dual-Tier Risk Detection

  • Tier S: Hospitality Stress Mapping: Specialized triaging for high-stress roles (Kitchen, Front Office, Housekeeping) facing long hours and emotional labor.
  • Tier A: Startup Burnout Surveillance: Monitoring high-velocity work environments, "crunch culture," and cognitive load in the IT and Digital sectors.
  • Hierarchical Risk Stratification: Automated triaging from Level 0 (Psychiatric Emergency) to Level 3 (Prognostic/Functioning).
  • Digital Anamnesis Analysis: Real-time processing of DASS-21 and SRQ-20 assessments tailored for both service and tech industry stressors.

2. AI Chatbot Counselor (Conversational Support)

  • Gemini-Powered Empathy: Uses Google Gemini 3 Flash to provide 24/7 initial psychosocial support and empathetic listening.
  • Crisis Triaging (L0-L3): Automated detection of high-risk signals within conversation, with immediate escalation to emergency resources and MERP protocols.
  • Empathetic Listening: A safe, non-judgmental space for users to express feelings and receive immediate coping strategies.
  • Distinct from Risk Detector: While the Risk Detector analyzes data, the Counselor provides direct human-like interaction and emotional support.

3. Health Economic Evaluation (HEE)

  • WHO-Standard ROI Modeling: Visualizes the 1:4 Return on Investment (ROI) for mental health interventions (US$1 Trillion global burden context).
  • INA-CBG Claim Mapping: Integration of Indonesian Case-Based Groups (INA-CBG) for mean claim analysis (e.g., Rp12.4M/admission) and medication cost tracking.
  • Cost of Inaction vs. Intervention: Robust comparative analytics to justify wellness budget allocation for management and stakeholders.

4. The Psychosocial Incident Pyramid

  • 1 Fatality = 600 UA/UC: Based on the safety pyramid (Heinrich β†’ Bird), SafeGuard identifies the 600+ "Unsafe Acts" (bullying, toxic culture) that precede a single fatality.
  • Biological Pathway: Maps chronic stress to the HPA axis, cortisol elevation, and cardiovascular risk (CVD).
  • Predictive Bridge: Turns "near misses" into prevented lives through early detection.

5. Clinical & Statistical Interoperability

  • SATUSEHAT Integration: Fully compliant with HL7 FHIR R4 standards for seamless integration with the National Health Data Exchange.
  • Kemenkes Standard: Aligned with Indonesian Ministry of Health (Kemenkes) clinical guidelines and reporting frameworks.
  • ICD-10 Chapter V Mapping: Burden clusters categorized by WHO ICD-10 codes (F30-F39 Mood, F40-F48 Anxiety/Stress, etc.) for standardized reporting.
  • Community Medicine Utilization Review: Doughnut-based analytics for facility distribution (Puskesmas, RSUD) and medication utilization (Antidepressants, Anxiolytics).

6. Personalized Prevention Roadmap

  • Dual-Mode Interface: Specialized roadmaps for Worker Mode (Occupational Health) and Patient Mode (Clinical Prevention).
  • L3 Prognostic Predictors: Monitoring of workplace conflict, peer support quality, and psychosocial stressors.
  • Personal ROI: Individualized estimates of annual healthcare savings and productivity value in IDR.

7. Digital Anamnesis & Multi-Source Sensing

  • DASS-21 & SRQ-20 Integration: Comprehensive psychosocial self-assessment for AI-driven risk detection.
  • Multi-Device Wearable Sync: Real-time data syncing for Apple Watch, Garmin, and Fitbit to monitor autonomic nervous system regulation (BPM & HRV).
  • IoT Companion Hardware (Arduino): Proprietary IoT tool integrated into toys and companion dolls for school-to-university engagement.
  • Hardware-Level TTS: Built-in Text-to-Speech (TTS) capabilities for interactive emotional support and data collection.

8. Wellness Hub & Digital Therapeutics

  • Curated Resource Library: Evidence-based articles on burnout management and cognitive reframing.
  • Interactive Exercises: Guided "Box Breathing" sessions and YouTube-integrated "Deep Sleep Meditation" for immediate stress reduction.
  • Resource Stratification: Content categorized by Article, Exercise, and Audio for diverse learning preferences.
  • AI Counselor Integration: Direct access to empathetic chat support within the wellness ecosystem.

9. Inclusive Design (Accessibility-First)

  • Adaptive UI Engine: Toggleable Accessibility Mode with high-contrast (B&W) interface and simplified layouts.
  • AI Voice Summary (TTS): Real-time audio briefing of health risks and population status for low-vision users.
  • Tremor-Resistant Interaction: Extra-large touch targets (p-8/80px) and simplified navigation for users with motor disabilities (Parkinson/Amputation).
  • Universal Iconography: Zero-text dependency mode using intuitive icons for low-literacy populations.

10. Mental Emergency Response Protocol (MERP)

  • L0 SOS Trigger: Floating emergency button with immediate GPS-linked escalation.
  • Automated Dispatch: Real-time connection to refinery medical teams and first responders.
  • Voice-Guided Protocol: Audio instructions for users in crisis until help arrives.

11. Progressive Web App (PWA) & Real-time Sync

  • Installable Experience: Add to Home Screen (A2HS) support for mobile and desktop.
  • Service Worker Integration: Background sync and offline-first capability for remote industrial sites.
  • Real-time Firebase Sync: Instant data synchronization between patients and providers using NoSQL listeners.
  • Push Notifications: Real-time behavioral health alerts via Firebase Cloud Messaging (FCM).

12. Ethical Clearance & Clinical Compliance

  • IRB Roadmap: Formal commitment to obtaining Institutional Review Board (IRB) clearance for corporate deployment.
  • Informed Consent: Transparent protocols for worker data usage and privacy protection.
  • Anonymized Reporting: Aggregate analytics that protect individual worker identities while providing management with actionable insights.

πŸ’° Business Model & Operational Costs

1. Subscription Model (B2B SaaS)

  • Standard Rate: Rp 50.000 - 100.000 / employee / year.
  • ROI Justification: For a hotel with 200 staff, the cost (Rp 10-20M) is fully offset by preventing just one burnout-related resignation (recruitment cost ~Rp 15M).

2. Operational Cost Analysis (Per 1000 Users)

  • AI API (Gemini 1.5 Flash): ~$5 - $10 / month (based on 10,000 scans).
  • Cloud Database (Firebase Blaze): ~$15 - $25 / month (pay-as-you-go).
  • Maintenance: Rp 5 - 10 Million / year for technical support and monitoring.

πŸ‘₯ The Leadership Team

SafeGuard is developed by a multidisciplinary team of experts in AI, product engineering, health data, and clinical occupational health:

  • Akhmad Khudri β†’ Team Lead & Product Orchestrator (Strategy & SWOT)
  • Stanley Nathanael Wijaya β†’ Lead AI & Product Engineer (Front-end & Integration)
  • Dwiki Aulia Rahman β†’ Health Data & Predictive Insight (AI Architecture & Epidemiology)
  • dr. M. Rifki Al Ikhsan β†’ Clinical & Occupational Health Advisor (Policy, MCU, HRA, Psychosocial Intervention)

πŸš€ A2A Skills

SafeGuard exposes four core skills via the Agent-to-Agent (A2A) protocol:

1. Clinical Risk Stratification

  • Level 0-L3 Triaging: Automated risk detection from Level 0 (Psychiatric Emergency) to Level 3 (Prognostic/Functioning).
  • Standardized Assessment: Real-time processing of DASS-21 and SRQ-20 scores to determine clinical urgency.

2. Psychosocial Analysis

  • AI-Powered Insights: Deep analysis of clinical notes and digital anamnesis to detect behavioral risks and workplace stressors.
  • Burnout Surveillance: Specialized mapping for high-pressure environments (Hospitality, Tech, Healthcare).

3. ICD-10 Recommendation Support

  • Chapter V Mapping: Suggests relevant ICD-10 codes (F30-F39 Mood, F40-F48 Anxiety/Stress) based on patient symptoms and history.
  • Clinical Justification: Provides evidence-based reasoning for each recommended code to assist clinicians in documentation.

4. Economic ROI Forecasting

  • Health Economic Evaluation (HEE): Visualizes the 1:4 - 1:5 Return on Investment for mental health interventions.
  • INA-CBG Claim Estimates: Integration of Indonesian Case-Based Groups (INA-CBG) for mean claim analysis and potential cost savings.

πŸ›‘οΈ SHARP & A2A Integration

SafeGuard is built for the Prompt Opinion Marketplace, adhering to the highest standards of interoperability:

  • SHARP Compliant: Consumes fhir-context (Patient ID, Server URL, Token) to fetch real-time patient data.
  • A2A Manifest: Discoverable via .well-known/agent-card.json with explicit capability declarations.
  • REST Transport: Optimized for stable, high-performance inter-agent communication.
  • Structured JSON Output: Returns machine-readable clinical and economic data for seamless UI rendering.

πŸ› οΈ Tech Stack

  • Frontend: React 19, TypeScript, Vite
  • Styling: Tailwind CSS 4.0 (Utility-first CSS)
  • Animations: Motion (formerly Framer Motion)
  • Data Visualization: Recharts (Area, Bar, Pie, Doughnut)
  • Backend/DB: Firebase (Firestore, Auth, Messaging)
  • PDF Generation: jsPDF (Strategic Whitepaper Export)
  • PWA: Service Workers, Manifest.json, Offline-first
  • Accessibility: Web Speech API (TTS), WCAG 2.2 Compliance

πŸ›‘οΈ Security & Privacy

SafeGuard is built on privacy-first principles.

  • Firestore Security Rules: Robust Role-Based Access Control (RBAC) ensuring users only access their own data.
  • Data Anonymization: Individual data is anonymized in aggregate reports.
  • Encryption: AES-256 at-rest and TLS 1.3 in-transit.
  • Compliance: Level 0/1 escalations follow strict HIPAA/GDPR-compliant protocols.

πŸ—ΊοΈ Roadmap

  • AI Chatbot Counselor: 24/7 initial support and crisis triaging using Gemini 3 Flash.
  • Wearable Integration (Simulated): Real-time data syncing from Apple Watch, Garmin, and Fitbit.
  • Wellness Hub Enhancements: Interactive exercises and real-world content integration.
  • IoT Hardware Commercialization: Mass production of Arduino-based companion dolls with integrated TTS for educational sectors.
  • TWA (Trusted Web Activity): Native Android deployment for Google Play Store.
  • Full Wearable API Integration: Live production data from HealthKit/Google Fit.
  • Manager/Jury Dashboard: Advanced view for stakeholders with deep-dive ROI simulation tools.
  • Multi-language Support: Full localization for global enterprise deployment.

πŸ“‘ API Documentation

SafeGuard provides a robust set of APIs for integration with the Prompt Opinion Orchestrator and external health systems.

πŸ‘‰ Agent Card (Manifest): https://server-safeguard.onrender.com/.well-known/agent-card.json πŸ‘‰ Interactive Swagger Docs: https://server-safeguard.onrender.com/api-docs

Core Endpoints:

  • POST /api/v1/chat: Main A2A communication endpoint for skills execution.
  • POST /api/v1/analyze: SHARP-compliant patient data analysis.
  • GET /api/v1/economic-forecast: ROI and INA-CBG claim estimates.

πŸš€ Technical Architecture Upgrade

The platform has been optimized for Full-stack Serverless deployment:

  • Frontend: React + Vite (Served via Vercel Edge).
  • Backend: Node.js Express (Deployed as Serverless Functions in /api).
  • Database: Firebase Firestore (NoSQL) with real-time sync.
  • Auth: Firebase Authentication (Google OAuth).
  • Messaging: Firebase Cloud Messaging (FCM) via Service Workers.
  • Swagger UI: OAS 3.0 with CDN-backed assets (jsDelivr) for high availability.
  • Environment Awareness: Automatic switching between Local (Port 3000) and Production (Vercel) contexts.

🌐 Ecosystem Partners

SafeGuard is part of a broader ecosystem of AI-driven mental health and emotional support tools:

  • Halo Ayah (Hey Dad): A warm AI companion providing fatherly guidance, life skills, and emotional support.
  • Unsaid: A safe space for unspoken thoughts, helping users process what couldn't be said in the moment.

Developed for the Prompt Opinion Hackathon 2026

About

AI-Powered Psychosocial Health Surveillance

Topics

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages