CodeBlue-Context / README.md
Hackathon Builder
Update README with Agentic vs Chatbot comparison and new feature highlights
49ca4d3
|
Raw History Blame Contribute Delete
4.25 kB
---
title: CodeBlue Context
emoji: 🚨
colorFrom: blue
colorTo: red
sdk: docker
app_port: 7860
pinned: false
---
# CodeBlue Context 🚨
> *"In the ER, we don't have 15 minutes to read a medical history. When a patient is crashing, we have seconds to make a decision that determines if they live or die. Missing a single drug allergy or a subtle lab trend isn't just an oversight—it's a tragedy."*
> — **The Problem We Are Solving**
**CodeBlue Context** is an explainable, 5-agent clinical emergency intelligence system built for the Agent Assemble Hackathon. It is designed to tackle the most critical, high-stakes bottleneck in modern healthcare: the time doctors waste reading lengthy, scattered patient histories during life-or-death emergencies.
Instead of spending 10-15 minutes extracting vital signs, labs, conditions, and contraindications from a messy EHR chart, CodeBlue **compresses the patient's entire medical context into a structured, highly visual 10-second summary**.
---
## 💥 Why This Matters (The Real-World Impact)
Imagine a patient arriving in severe respiratory distress. The physician orders a rapid sequence intubation and pushes a standard dose of succinylcholine. But buried on page 4 of the patient's record is a history of malignant hyperthermia. The patient crashes.
This happens every day. Medical errors are the 3rd leading cause of death. Our system is built to ensure it never happens again by employing **Five Specialized AI Agents** that act as the ultimate safety net for emergency physicians.
## 🧠 Agentic Orchestration vs. Standard Chatbots
A typical medical chatbot is a single model answering a single prompt. CodeBlue Context is **fundamentally different**:
* **Multi-Agent Pipeline**: Instead of one "black box" answer, we use a **sequential team of 5 specialists**. Each agent (Triage, Guardian, Pathologist, Physician, Attending) performs a specific task and "hands off" its findings to the next, just like a real ER team.
* **Inter-Agent Communication**: Our agents don't just work in isolation; they **cross-reference** each other. If the Pathologist finds a high INR, the Guardian agent automatically blocks anticoagulants in the Action Protocol.
* **Deterministic Guardrails**: We combine LLM intelligence with a **deterministic core**. If the AI is unavailable, our hardcoded medical rules engine still extracts and highlights critical vitals and labs, ensuring the system never fails in an emergency.
* **Explainability**: Every decision includes a "Collaboration Thread" showing the reasoning of each agent, making it a "Glass Box" system that doctors can trust.
## 🌟 Hackathon-Winning Features
- **Advanced Clinical Consultation**: Beyond the initial brief, doctors can enter "Consult Mode" to ask the 5-agent team specific follow-up questions (e.g., *"Why did you exclude pulmonary embolism?"*).
- **Primary Clinical Directive**: A high-impact banner that identifies the single most important stabilization task in milliseconds.
- **"Hospital Clinical" UI**: A professional, high-contrast "Blue-Green" dashboard with pulse animations, designed for readability in high-stress hospital environments.
- **Real-Time Thinking Logs**: Watch the agents "deliberate" in real-time with terminal-style logs showing their cross-checks and hand-offs.
- **BYOK (Bring Your Own Key)**: Securely inject your own Gemini API key via the UI to bypass server-side rate limits during live demonstrations.
- **Upload Anything (PDF, DOC, JSON, Image)**: Gemini Vision structures raw clinical charts into parsable medical contexts instantly.
- **MCP Compliance**: Fully exposes an MCP Tool Manifest (`/mcp/tools`) for seamless integration with modern agent ecosystems.
## 🚀 Run Locally
### Requirements
- Python 3.9+
- Node.js 18+
### 1. Backend Setup
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
Set your API key in a `.env` file in the root directory:
```
gemini_api_key=YOUR_GEMINI_KEY
```
Start the backend:
```bash
uvicorn backend.main:app --reload
```
### 2. Frontend Setup
```bash
cd frontend
npm install
npm run dev
```
---
*Disclaimer: For hackathon and demonstration purposes only. Not for actual clinical use.*