🩺 CodeBlue Context: Emergency Intelligence Layer 💡 Inspiration In the high-stakes environment of an Emergency Department, every second counts. However, clinicians are often forced to spend precious minutes digging through fragmented clinical records—blurry photos of lab results, multi-page PDF histories, and unformatted discharge summaries.
CodeBlue Context was inspired by the need for an "Intelligence Layer" that sits between raw data and medical decision-making. We wanted to build a system that doesn't just summarize text, but actively reasons through it—identifying "Time-to-Collapse" risks and safety hazards in milliseconds.
🛠️ How we built it CodeBlue Context is built on a Collective Reasoning Pipeline powered by the latest Gemini 3.1 & 2.5 Flash-Lite models. Unlike standard chatbots, we implemented a multi-agent orchestration:
Agent 1 (Triage Specialist): Scans for physiological danger patterns (e.g., Blood Pressure (188/124), SpO2 (88%)). Agent 2 (Safety Guardian): Checks proposed treatments against extracted allergies and medical history. Agent 3 (Pathologist): Correlates lab abnormalities (e.g., INR (4.2), Troponin (0.08)) with patient history. Agent 4 (Chief Resident): Formulates "Must Not Miss" differential diagnoses. Agent 5 (ED Attending): Synthesizes everything into a single, high-impact Immediate Clinical Directive. The backend uses FastAPI for high-concurrency agent orchestration, while the frontend is a React/Vite medical-grade terminal designed for 5-second readability.
🚧 Challenges we faced The biggest challenge was predictability. In healthcare, "AI Hallucinations" aren't just bugs—they are safety risks. We fought this by:
Implementing Explainable AI Reasoning: Every decision is logged in a transparent pipeline so doctors can see why an agent made a claim. Schema Enforcement: Building a robust parsing layer to handle "noisy" medical documents and convert them into structured JSON without data loss. Latency vs. Depth: Balancing the depth of 5 sequential AI calls with the need for ER speed. We solved this by using the ultra-low latency Flash-Lite series. 🧠 What we learned We learned that Agentic Workflows are vastly superior to single-prompt systems for complex tasks. By forcing the AI to "argue" across different clinical personas (Resident vs. Attending), the resulting synthesis is significantly more grounded in clinical reality. We also discovered that "Flash-Lite" models, when properly orchestrated, can match larger models in reasoning while maintaining the speed required for emergency medicine.
Built With
- axios
- context
- fastapi
- fetch-api
- fhir-style-data-format
- gemini-2.0-flash.-backend:-python
- gemini-2.5-flash-lite
- google-ai-studio
- google-gemini-api
- javascript
- json
- lucide-react-(medical-ui-design-system).-deployment:-hugging-face-spaces.-protocols:-json-schema-enforcement
- node.js
- npm
- pymupdf-(high-fidelity-clinical-extraction).-frontend:-react
- react
- react-hooks
- react-icons
- rest-apis
- restful-multi-agent-orchestration.-codeblue-context-?-because-in-the-er
- saves
- tailwind-css
- typescript
- vite
Log in or sign up for Devpost to join the conversation.