◈ SEPSISGUARD AI ◈ Detect Deterioration. Defend Every Hour. Deliver Survival.

🔗 Live System Sepsis Guard AI | Prompt Opinion Marketplace


💡 Inspiration

Sepsis doesn't announce itself. It creeps — a heart rate rising 8 bpm per hour, a lactate drifting from 1.8 to 3.4, a nursing note that reads "patient increasingly diaphoretic and confused." By the time traditional scoring systems trigger, the window for optimal intervention has already narrowed.

Every year, 49 million people develop sepsis worldwide and 11 million die — that's 1 in 5 of all global deaths. Every hour of delayed detection increases mortality by approximately 7%.

SepsisGuard AI was built because rules count numbers, but survival requires reasoning.


⚠️ The Problem — Rule-Based Blindness

Current clinical systems rely on static threshold scoring:

System Method Limitation
qSOFA RR ≥ 22, SBP ≤ 100, AMS Misses early-stage deterioration
SIRS HR > 90, Temp > 38°C, WBC > 12k High false-positive rate
NEWS Aggregate vital scoring Cannot read clinical context

These systems answer: "Has the patient crossed a threshold?"

SepsisGuard AI answers: "Is this patient deteriorating — and what does the full clinical picture say?"


🚀 What It Does

SepsisGuard AI is an MCP Server published on the Prompt Opinion Marketplace with three composable tools that any agent in the ecosystem can invoke:

Tool 1 — compute_sepsis_risk Analyzes patient vitals, labs, and clinical notes. Returns a risk score (0–100) with an evidence-cited reasoning chain, confidence level, and key clinical signals.

Tool 2 — generate_clinical_alert Formats structured bedside alerts for nursing staff — headline, immediate actions, escalation guidance, and reassessment timing.

Tool 3 — recommend_bundle_actions Returns time-stamped treatment recommendations aligned with Surviving Sepsis Campaign (SSC) 2024 guidelines.


🧠 Core Model — Sepsis Risk Intelligence

Sepsis risk is not a binary event. It is a continuous multivariate signal across physiological, biochemical, and contextual domains:

$$V = [\text{Vitals}, \text{Lactate}, \text{WBC}, \text{Mentation}, \text{Context}]^T$$

The Risk Score \( RS \) is computed as:

$$RS = f(V) = \text{GenAI}\left(\sum_{i=1}^{n} w_i \cdot \text{signal}_i + \text{semantic}(\text{notes})\right)$$

Where:

  • \( w_i \) = clinical weighting per signal (trending vitals weighted higher than static readings)
  • \( \text{semantic}(\text{notes}) \) = NLP reasoning over nursing documentation
  • The function \( f \) is not a linear model — it is LLM-powered clinical reasoning that integrates structured and unstructured data simultaneously

📉 The Deterioration Curve

Sepsis mortality follows a non-linear escalation:

$$M(t) = M_0 \cdot e^{\lambda t}$$

Where:

  • \( M_0 \) = baseline mortality at time of onset
  • \( \lambda \) ≈ 0.07 per hour (7% increase per hour of delayed treatment)
  • \( t \) = hours since detectable onset

After 6 hours without intervention, mortality risk has compounded by:

$$M(6) = M_0 \cdot e^{0.42} \approx 1.52 \cdot M_0$$

A 52% increase in mortality — from hours, not days. SepsisGuard AI targets the left side of this curve.


🔬 Why Gen AI, Not Rules

Rule-based systems operate on isolated thresholds:

IF lactate >= 2.0 THEN flag
IF HR > 90 THEN add_point
IF SBP <= 100 THEN add_point

Sepsis Guard AI operates on integrated clinical reasoning:

OBSERVE: HR trending 88 → 96 → 104 over 4 hours (rising trajectory)
OBSERVE: Lactate 3.4 mmol/L (tissue hypoperfusion)
OBSERVE: Nursing note — "diaphoretic, confused, not oriented"
OBSERVE: PMH includes CKD Stage 2 (comorbidity amplifier)
REASON: Synergistic deterioration across hemodynamic, metabolic,
        and neurological domains
CONCLUDE: Risk 78/100 — HIGH — Hour-1 Bundle recommended

A rule-based system sees four separate data points. SepsisGuard AI sees one deteriorating patient.


🏗️ How I Built It

SepsisGuard AI is built as a native MCP Server on the Prompt Opinion platform:

SepsisGuard AI Architecture Diagram

Stack:

Layer Technology
MCP Server Python + MCP SDK + Uvicorn
AI Engine Gemini 2.5 Flash
Protocol SHARP Context Propagation
Data Standard FHIR R4
Transport Streamable HTTP
Tunnel ngrok
Platform Prompt Opinion Marketplace

SHARP Integration: The server receives the platform's FHIR context via the SHARP extension spec:

{
  "fhirUrl": "https://...",
  "fhirToken": "Bearer ...",
  "patientId": "edward-499"
}

Patient clinical data is fetched from the platform's internal FHIR server, parsed, and sent to the GenAI reasoning engine — all within a single tool invocation.


🧪 Capabilities

  • Real-time sepsis risk scoring (0–100) with evidence-cited reasoning
  • Three-tier risk stratification: HIGH / MODERATE / LOW
  • Structured clinical alerts formatted for bedside nursing staff
  • SSC 2024-aligned treatment bundle recommendations with timeframes
  • SHARP context propagation for FHIR patient data access
  • A2A availability — any agent on the Marketplace can invoke Sepsis Guard tools
  • Synthetic FHIR R4 patient data — zero PHI, fully compliant

⚔️ Challenges I Ran Into

SHARP Schema Discovery — The exact JSON field names for FHIR context propagation were not documented in the tutorial. I extracted the schema directly from the platform's published spec to discover the five fields: fhirUrl, fhirToken, fhirRefreshToken, fhirRefreshTokenUrl, and patientId.

MCP SDK Version Friction — The Fast MCP library's API changed between versions. Parameters like instructions and stateless_http from documentation were unsupported in the installed version. I debugged initialization errors and adapted to the minimal working configuration using streamable_http_app().

Clinical Text vs Structured FHIR — The platform stores patient data as plain-text clinical documents, not structured FHIR R4 JSON resources. I pivoted from structured resource parsing to semantic reasoning over clinical text — which made the Gen AI capability essential and impossible to replicate with rules.

Platform Rate Limits — The free-tier Gemini model on Prompt Opinion has a 20-request daily cap. I resolved this by powering the MCP server's reasoning layer with my own Gemini API key while the platform handles only agent orchestration.


🏆 Accomplishments I'm Proud Of

  • Built a fully functional, published MCP Server with 3 discoverable tools
  • Achieved clinically accurate risk stratification across HIGH, MODERATE, and LOW scenarios
  • Demonstrated genuine GenAI superiority over rule-based sepsis scoring
  • Extracted and implemented the undocumented SHARP context schema
  • Published to the Prompt Opinion Marketplace with A2A interoperability enabled
  • All outputs cite specific clinical evidence — no hallucinated recommendations
  • SSC 2024 guideline alignment in every bundle recommendation

📚 What I Learned

  • Platform-native beats platform-adjacent. Building inside the ecosystem — not beside it — is the difference between a submission and a product.
  • GenAI's clinical superpower is unstructured data. Rules handle structured vitals. LLM reasoning over trending trajectories and nursing note semantics creates value that rules cannot replicate.
  • Demo specificity wins. Three patients at three risk levels demonstrate reasoning range better than any architecture diagram.
  • Read the schema, not the tutorial. The SHARP spec URL contained more actionable information than 19 minutes of video walkthrough.
  • Ship before you polish. A running server with demo fallbacks beats a beautiful architecture that never deploys.

🚀 What's Next for SepsisGuard AI

  • RAG Integration — Upload SSC 2024 guidelines to Prompt Opinion Collections for grounded, cited treatment recommendations
  • Real FHIR R4 Traversal — Connect to SMART on FHIR sandboxes for structured Observation, Condition, and MedicationRequest resources
  • Multi-Patient Triage — Rank an entire ED waiting room or ICU ward by sepsis risk simultaneously
  • Predictive Trending — Detect risk trajectory before threshold crossing using time-series vital analysis
  • Voice Interface — Bedside voice trigger for hands-free clinician queries
  • Epic App Orchard — Port the MCP architecture to production EHR distribution channels

🌍 Impact

SepsisGuard AI transforms sepsis detection from:

❌ Reactive → ✅ Predictive ❌ Rule-based → ✅ Reasoning-based ❌ Threshold-dependent → ✅ Trajectory-aware ❌ Isolated signals → ✅ Integrated clinical picture ❌ Static scoring → ✅ Dynamic intelligence


⚠️ Disclaimer

SepsisGuard AI is a clinical decision support tool. It augments clinician judgment — it does not replace it. All patient data used in this submission is fully synthetic. No protected health information (PHI) was used at any stage.


✨ Final Statement

"Sepsis doesn't wait for rules to trigger. Neither should we."

SepsisGuard AI — because every hour matters.

Built With

Share this project:

Updates