SwiftCareAI

Multi-'Nodal' AI-Assisted Triage for Real-Time Emergency Response

💡 Inspiration

In emergency scenarios, every second counts. Whether in field hospitals, disaster zones, or traditional ERs, medical personnel need to make life-critical decisions rapidly and accurately.

SwiftCareAI was born from the intersection of:

  • The urgent need for optimized emergency response systems
  • Recent advancements in AI-driven healthcare solutions, including AI-assisted triage under specific conditions.
  • The remarkable flexibility offered by Pocketflow AI Framework, allowing for a vendor agnostic and modular system.

Our vision: A unified, intelligent triage system that adapts to any emergency context and evolves with technology.


🔍 What SwiftCareAI Does

SwiftCareAI creates a seamless pathway from emergency inputs to actionable medical decisions:

Stage Functionality
📥 Data Ingestion Collects patient information from first responders, wearable devices, field variables and/or manual entry
🧠 AI Triage Leverages Cohere's NLP to summarize symptoms and assign triage scores based on ML models
🏥 Treatment Guidance Integrates with Google Maps API to recommend nearest suitable treatment facilities
📊 Dashboard Displays real-time alerts, patient summaries, and recommended actions via Streamlit

Modularity

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Data Source │ ──> │  NLP Model  │ ──> │ Triage Logic│
└─────────────┘     └─────────────┘     └─────────────┘
       ↑                   ↑                   ↑
       │                   │                   │
       └───────── Easily Replaceable ─────────┘

What It Means: Pocket Flow is designed to be vendor-agnostic, allowing you to swap out components (LLMs, APIs) without affecting the entire system.

SwiftCareAI Implementation:

  • We can switch from Cohere to another NLP provider—or integrate a new data source—without rebuilding our emergency response system
  • During disaster scenarios, we can rapidly adapt to available data sources without compromising triage functionality
  • When medical guidelines update, we can replace just the triage logic node while preserving all other system components

🛠️ How We Built it - Technical Architecture

Backend (backend.py)

Our technical implementation leverages three key services integrated through a modular Pocket Flow architecture:

Core Services Integration

We built SwiftCareAI by connecting three APIs into a seamless emergency response pipeline under the PocketAI framework:

  1. Firebase/Firestore - Secure, real-time patient data storage
  2. Cohere NLP - Intelligent symptom analysis and summarization
  3. Google Maps API - Location-based hospital recommendations

Node-Based Architecture

We implemented three specialized processing nodes based on PocketAI framework:

┌─────────────────┐      ┌────────────┐      ┌────────────────────┐
│ DataIngestionNode│ ──> │ TriageNode │ ──> │ResourceAllocationNode│
└─────────────────┘      └────────────┘      └────────────────────┘

The resulting system processes patient data end-to-end, from initial symptom reporting to hospital recommendation, with intelligent triage prioritization in between.

Frontend (app.py)

Our Streamlit dashboard prioritizes critical information:

🎨 Frontend Design & Features

Our healthcare AI dashboard features a modern, intuitive interface built with Streamlit, designed specifically for medical professionals to make quick, informed decisions.

🏥 Key Interface Components

1. Prioritized Patient List

  • Real-time Patient Monitoring: Instant access to patient information
  • Smart Triage Scoring: Visual indicators for patient priority levels
  • Comprehensive Patient Details:

2. Real-Time Alert System

  • Instant Notifications: Critical alerts for immediate attention
  • Visual Warning Indicators: Prominent display of urgent cases
  • Patient-Specific Alerts: Detailed messages for each alert

3. Analytics Dashboard

  • Key Performance Metrics:
    • Total patient count
    • Priority-based patient categorization
    • High/Medium/Low priority patient distribution
  • Dynamic Updates: Real-time metric calculations

🧗 Challenges We Overcame

  1. 🔒 Firestore Authentication
    Challenge: Persistent invalid_grant errors blocked data persistence Solution: Refined Google Cloud IAM permissions and implemented robust error handling

  2. ⚡ Real-Time Data Streaming
    Challenge: Maintaining continuous data flow from multiple emergency sources Solution: Implemented buffer nodes and fallback mechanisms to ensure uninterrupted operation

  3. 🎨 Emergency UX Design
    Challenge: Creating an interface usable during high-stress situations Solution: Minimalist design with color-coding and one-tap actions for critical scenarios


🏆 Key Accomplishments

  • Unified Multi-Context Triage
    One system handles pre-hospital, disaster zone, and ER workflows with consistent logic

  • Powerful NLP Pipeline
    Demonstrated robust symptom analysis using Cohere's models, even with incomplete patient information

  • Future-Proof Architecture
    Applied Pocket Flow's principles to create a system that will evolve with both medical knowledge and AI capabilities


📚 What We Learned

Our journey taught us:

  1. User-Centered Design must account for extreme conditions and high-stress operators

🚀 Future Development Areas for Pocket Flow in SwiftCareAI

1. MLOps Integration

┌───────────────┐    ┌───────────────┐    ┌───────────────┐
│  Model Build  │───>│  Model Test   │───>│ Model Deploy  │
└───────────────┘    └───────────────┘    └───────────────┘
        ↑                                          │
        └─────────── Feedback Loop ───────────────┘

What It Means: Integrating Pocket Flow with CI/CD pipelines and model registries would enable continuous deployment of AI systems.

SwiftCareAI Impact:

  • Automate deployment of new triage models as medical guidelines evolve
  • Seamlessly roll out updates without disrupting emergency operations
  • Enable A/B testing of model improvements with real-world feedback loops

2. Real-Time Adaptive Flows

                      ┌── If stable ──┐
                      │               ↓
Patient Data ───> Assessment ───> Routine Path
                      │
                      └── If deteriorating ──> Urgent Path

What It Means: Dynamically adjusting a Flow's execution path based on performance metrics or user feedback could further automate workflows.

SwiftCareAI Impact:

  • If a patient's condition deteriorates, the system automatically re-prioritizes triage tasks
  • During mass casualty events, the system can adaptively allocate computational resources to the most critical cases
  • Real-time integration of new data sources (e.g., incoming ambulance data) can trigger workflow adjustments

3. Advanced Debugging & Logging

┌───────────┐  ┌─────────────┐  ┌──────────────┐
│ Node Logs │──│ Flow Traces │──│ Error Reports│
└───────────┘  └─────────────┘  └──────────────┘
       │              │                 │
       └──────────────┼─────────────────┘
                      ↓
              Visualization Dashboard

What It Means: Enhanced visualization tools and granular logging at the Node level would make it easier to debug and monitor large-scale workflows.

SwiftCareAI Impact:

  • Easily identify the root cause if a Node fails during surges in patient data
  • Monitor performance metrics across the triage pipeline to identify bottlenecks
  • Create audit trails for medical decision-making processes

4. Deeper AI Assistant Collaboration

What It Means: Fine-tuning LLM assistants to domain-specific patterns could optimize code suggestions, tool selection, and error handling.

SwiftCareAI Impact:

  • Accelerate development cycles for new emergency protocols
  • Generate domain-specific medical code with built-in safety checks
  • Reduce human error in rapidly evolving triage scenarios
  • Enable real-time assistance for emergency responders through AI suggestions

🌐 Broader Impact

For Healthcare Systems

SwiftCareAI optimizes resource allocation during mass casualty events, potentially saving lives through more efficient triage.

For AI Developers

Our implementation demonstrates how Pocketflow AI's modularity, expressibility, and information hiding principles make it ideal for building scalable, maintainable AI systems in high-stakes environments where failure is not an option.

For Disaster Response

The system's theoretical ability to adapt to various emergency contexts makes it valuable for humanitarian response efforts globally.

For Startups

The SwiftCareAI architecture showcases how Pocket Flow features represent opportunities to differentiate healthcare AI products and create additional value through vendor-agnostic flexibility, maintainable code, and future-ready extensibility.


"When seconds matter, SwiftCareAI helps medical teams make the right decisions faster."


SwiftCareAI - Powered by Pocketflow AI - GenAI Genesis Hackathon 2025

Built With

Share this project:

Updates