ClinAssist Edge is an offline, privacy-first AI assistant for clinicians in low-resource settings, powered by MedGemma and HAI-DEF models. It delivers differential diagnosis with risk flags, SOAP note automation, patient instruction translation, advanced RAG-based reasoning, and drug safety checks.
# ClinAssist Edge
### Privacy-First Offline Clinical Intelligence Platform
**ClinAssist Edge** is an offline-first clinical decision support system designed for resource-constrained environments. Built on the **MedGemma-2B** foundation model, it provides differential diagnosis, automated documentation, and safety monitoring without requiring internet connectivity or cloud infrastructure.
## System Architecture
The platform utilizes a modular, privacy-preserving architecture optimized for edge deployment on consumer hardware.
**Core Components:**
1. **User Interface Layer**: A Streamlit-based frontend optimized for low-latency interaction and high-contrast visibility.
2. **Application Logic**: Python-based backend handling input validation, session state management, and template rendering.
3. **Inference Engine**: Local execution of the MedGemma-2B Large Language Model, supporting 4-bit and 8-bit quantization for reduced memory footprint.
4. **Safety & Ethics Module**: Rule-based gating mechanisms to detect and flag high-risk outputs (e.g., contraindicated prescriptions) before they reach the user.
5. **Retrieval-Augmented Generation (RAG)**: Vector database (FAISS) implementation for grounding model outputs in local, reliable medical guidelines.
```mermaid
graph TD
User[Clinician] --> UI[Streamlit Interface]
UI --> Backend[Application Backend]
Backend --> Safety[Safety & Ethics Gate]
Backend --> RAG[Local Knowledge Base]
subgraph "Offline Inference Engine"
Safety --> Model[MedGemma-2B]
RAG --> Model
end
Backend --> Logs[Encrypted Audit Logs]
Model --> UI
```
## Key Capabilities
* **Differential Diagnosis**: Generates ranked differential diagnoses with associated confidence scores using Bayesian uncertainty quantification.
* **Drug Safety Analysis**: Performs real-time checks for drug-drug interactions, disease contraindications, and known allergies.
* **Automated Documentation**: Converts unstructured clinical notes into standardized SOAP (Sub …