How olveraalec/preventive-health-ai works
Preventive Health Intelligence is a research prototype for time-aware sepsis-risk inference and evidence-aware model allocation, with React and Streamlit research interfaces. The main workflow is hourly observations through causal features, static/temporal inference and bounded allocation, to a decision-summary API and inspectable UI; retrospective replay and cohort evaluation are separate evidence paths. Edges follow shown imports/calls or README statements. Some subsystems are represented by their exact enclosing directories because their implementation was not sampled; unverified wiring is omitted.
Main entry points: App.tsx React application · sepsis_inference.py Static and temporal experts · main.py Research API · useResearchWorkspace.ts Research workspace
Components 29
Inference and control
- Causal features
src/healthcare_ai_lab/preprocessing - Model artifacts
src/healthcare_ai_lab/models/artifact.py - Static and temporal experts
src/healthcare_ai_lab/models/sepsis_inference.py - Adaptive allocation
src/healthcare_ai_lab/controllers/adaptive.py - Trajectory inference
src/healthcare_ai_lab/trajectories/service.py - Decision contracts
src/healthcare_ai_lab/trajectories/contracts.py - Controller service
src/healthcare_ai_lab/controller/service.py - Controller contracts
src/healthcare_ai_lab/controller/contracts.py
Research and evaluation
- Agent workflow
src/healthcare_ai_lab/agent/workflow.py - Memory selection
src/healthcare_ai_lab/memory/selector.py - Patient and policy evaluation
src/healthcare_ai_lab/evaluation - Controller experiments
src/healthcare_ai_lab/experiments
API and persistence
- Research API
src/healthcare_ai_lab/api/main.py - Research repository
src/healthcare_ai_lab/database/repository.py
React experience
- React application
frontend/src/App.tsx - Research workspace
frontend/src/hooks/useResearchWorkspace.ts - API client
frontend/src/api/client.ts - Canonical response adapter
frontend/src/api/canonical.ts - UI data contracts
frontend/src/api/contracts.ts - Decision interpretation
frontend/src/components/DecisionInterpretation.tsx - Patient monitoring
frontend/src/components/PatientMonitoring.tsx - Observation evidence
frontend/src/components/ObservationEvidence.tsx - Model evaluation view
frontend/src/components/ModelEvaluation.tsx - Retrospective import
frontend/src/api/retrospective.ts
Research explorer
- Streamlit explorer
dashboard/app.py - Adaptive decisions
dashboard/pages/1_Adaptive_Decisions.py - Explorer evaluation
dashboard/pages/2_Model_Evaluation.py
Other components
- Historical ICU data
- Research user
Connections 28
- Historical ICU data → Causal features: provides observations
README.md - Causal features → Static and temporal experts: builds features
README.md - Model artifacts → Static and temporal experts: supplies models
src/healthcare_ai_lab/models/artifact.py - Static and temporal experts → Adaptive allocation: provides predictions
src/healthcare_ai_lab/models/sepsis_inference.py - Adaptive allocation → Static and temporal experts: blends predictions
src/healthcare_ai_lab/models/sepsis_inference.py - Trajectory inference → Static and temporal experts: runs inference
src/healthcare_ai_lab/trajectories/service.py - Trajectory inference → Decision contracts: returns trajectory
src/healthcare_ai_lab/trajectories/service.py - Research user → React application: uses
README.md - React application → Research workspace: renders workspace
frontend/src/App.tsx - React application → Decision interpretation: renders decisions
frontend/src/App.tsx - React application → Patient monitoring: renders monitoring
frontend/src/App.tsx - React application → Observation evidence: renders evidence
frontend/src/App.tsx - React application → Model evaluation view: renders evaluation
frontend/src/App.tsx - Research workspace → API client: requests trajectory
frontend/src/hooks/useResearchWorkspace.ts - Research workspace → Retrospective import: imports export
frontend/src/hooks/useResearchWorkspace.ts - API client → Canonical response adapter: parses response
frontend/src/api/client.ts - API client → UI data contracts: validates evaluation
frontend/src/api/client.ts - Research workspace → UI data contracts: parses request
frontend/src/hooks/useResearchWorkspace.ts - Research API → Trajectory inference: serves inference
src/healthcare_ai_lab/api/main.py - Research API → Research repository: persists agent runs
src/healthcare_ai_lab/api/main.py - Research API → Agent workflow: invokes workflow
src/healthcare_ai_lab/api/main.py - Agent workflow → Memory selection: selects memories
src/healthcare_ai_lab/agent/workflow.py - Research API → Controller service: dispatches decisions
src/healthcare_ai_lab/api/main.py - Controller service → Controller contracts: accepts input
src/healthcare_ai_lab/controller/service.py - Research user → Streamlit explorer: explores research
README.md - Streamlit explorer → Adaptive decisions: offers decisions
README.md - Streamlit explorer → Explorer evaluation: offers evaluation
README.md - Patient and policy evaluation → Controller experiments: evaluates policies