# larrynovsky/larry-health-os architecture

> Architecture diagram of the GitHub repository larrynovsky/larry-health-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/larrynovsky/larry-health-os
- Repository: https://github.com/larrynovsky/larry-health-os

## Overview

Larry Health OS is a proactive personal health system: it gathers medical records and personal health streams, keeps them in a local database, analyzes changes and deadlines, then reaches the person through Telegram and reminders. The principal loop runs from user-submitted data and connected sources through persistence and scheduled analysis to briefs, alerts, hypotheses, and tasks; replies and new records feed back into the system. The README documents major capabilities beyond the sampled code; edges based on those capabilities cite the README, and unsampled implementation details are not inferred.

Main entry points: [`jobs/scheduled.py`](https://github.com/larrynovsky/larry-health-os/blob/main/jobs/scheduled.py) (Scheduled jobs), [`health_db.py`](https://github.com/larrynovsky/larry-health-os/blob/main/health_db.py) (Local health database), [`genome_intake.py`](https://github.com/larrynovsky/larry-health-os/blob/main/genome_intake.py) (Genome intake), [`task_agent.py`](https://github.com/larrynovsky/larry-health-os/blob/main/task_agent.py) (Tasks and follow-up)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Data intake"]
  node_intake["Bot intake<br/>[messages.py]"]
  node_genome_intake["Genome intake<br/>[genome_intake.py]"]
  node_lab_intake["Lab review<br/>[api_lab_review.py]"]
  node_dashboard["Local dashboard<br/>[views.py]"]
end

subgraph group_health["Health data"]
  node_database[("Local health database<br/>[health_db.py]")]
  node_labs[("Lab records<br/>[labs_db.py]")]
  node_genome_pipeline["Genome processing<br/>[genome_pipeline.py]"]
  node_wearable_imports["Health imports<br/>[import_all.py]"]
end

subgraph group_analysis["Analysis"]
  node_scheduled["Scheduled jobs<br/>[scheduled.py]"]
  node_brief["Morning brief<br/>[brief_pipeline.py]"]
  node_intelligence["Health intelligence<br/>[hai_core.py]"]
  node_correlations["Correlation checks"]
  node_hypotheses["Hypotheses<br/>[hai_hypotheses.py]"]
  node_tasks["Tasks and follow-up<br/>[task_agent.py]"]
end

subgraph group_delivery["Proactive delivery"]
  node_bot_actions["Bot actions<br/>[actions.py]"]
  node_notifications["Notifications<br/>[notify.py]"]
end

subgraph group_platform["Internal platform"]
  node_llm_client["LLM client<br/>[llm_client.py]"]
  node_time["Time seam<br/>[_time_inject.py]"]
  node_config["System configuration<br/>[config_db.py]"]
  node_i18n["Interface language<br/>[i18n.py]"]
end

node_person(("Person"))
node_telegram(("Telegram"))
node_health_sources(("Health sources"))
node_medical_docs["Medical documents"]
node_wearables(("Wearables"))
node_genome["Genome files"]
node_reminders(("macOS Reminders"))
node_llm(("LLM service"))

node_person -->|"sends data"| node_telegram
node_telegram -->|"routes replies"| node_intake
node_intake -->|"records health data"| node_database
node_person -->|"provides records"| node_medical_docs
node_medical_docs -->|"ingests records"| node_database
node_health_sources -->|"supplies measurements"| node_wearables
node_wearables -->|"imports data"| node_wearable_imports
node_wearable_imports -->|"stores data"| node_database
node_person -->|"provides file"| node_genome
node_genome -->|"uploads file"| node_genome_intake
node_genome_intake -->|"dispatches processing"| node_genome_pipeline
node_genome_intake -->|"records data"| node_database
node_person -->|"reviews data"| node_dashboard
node_dashboard -->|"reviews labs"| node_lab_intake
node_lab_intake -->|"reads and updates"| node_labs
node_database -->|"feeds analysis"| node_scheduled
node_scheduled -->|"schedules brief"| node_brief
node_brief -->|"requests analysis"| node_intelligence
node_intelligence -->|"uses client"| node_llm_client
node_llm_client -->|"sends requests"| node_llm
node_scheduled -->|"checks correlations"| node_correlations
node_scheduled -->|"runs consilium"| node_hypotheses
node_scheduled -->|"creates follow-up"| node_tasks
node_tasks -->|"stores tasks"| node_database
node_scheduled -->|"delivers brief"| node_telegram
node_scheduled -->|"sends alerts"| node_notifications
node_notifications -->|"delivers messages"| node_telegram
node_person -->|"answers prompts"| node_bot_actions
node_bot_actions -->|"routes replies"| node_intake
node_tasks -->|"syncs reminders"| node_reminders
node_scheduled -->|"reads current time"| node_time
node_scheduled -->|"reads settings"| node_config
node_bot_actions -->|"localizes replies"| node_i18n

click node_intake "https://github.com/larrynovsky/larry-health-os/blob/main/handlers/messages.py"
click node_genome_intake "https://github.com/larrynovsky/larry-health-os/blob/main/genome_intake.py"
click node_lab_intake "https://github.com/larrynovsky/larry-health-os/blob/main/dashboard_routers/api_lab_review.py"
click node_dashboard "https://github.com/larrynovsky/larry-health-os/blob/main/dashboard_routers/views.py"
click node_database "https://github.com/larrynovsky/larry-health-os/blob/main/health_db.py"
click node_labs "https://github.com/larrynovsky/larry-health-os/blob/main/labs_db.py"
click node_genome_pipeline "https://github.com/larrynovsky/larry-health-os/blob/main/genome_pipeline.py"
click node_wearable_imports "https://github.com/larrynovsky/larry-health-os/blob/main/import_all.py"
click node_scheduled "https://github.com/larrynovsky/larry-health-os/blob/main/jobs/scheduled.py"
click node_brief "https://github.com/larrynovsky/larry-health-os/blob/main/brief_pipeline.py"
click node_intelligence "https://github.com/larrynovsky/larry-health-os/blob/main/hai_core.py"
click node_correlations "https://github.com/larrynovsky/larry-health-os/blob/main/correlation_gate.py"
click node_hypotheses "https://github.com/larrynovsky/larry-health-os/blob/main/hai_hypotheses.py"
click node_tasks "https://github.com/larrynovsky/larry-health-os/blob/main/task_agent.py"
click node_bot_actions "https://github.com/larrynovsky/larry-health-os/blob/main/bot/actions.py"
click node_notifications "https://github.com/larrynovsky/larry-health-os/blob/main/notify.py"
click node_llm_client "https://github.com/larrynovsky/larry-health-os/blob/main/llm_client.py"
click node_time "https://github.com/larrynovsky/larry-health-os/blob/main/_time_inject.py"
click node_config "https://github.com/larrynovsky/larry-health-os/blob/main/config_db.py"
click node_i18n "https://github.com/larrynovsky/larry-health-os/blob/main/i18n.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_intake,node_genome_intake,node_lab_intake,node_dashboard toneBlue
class node_database,node_labs,node_genome_pipeline,node_wearable_imports toneAmber
class node_scheduled,node_brief,node_intelligence,node_correlations,node_hypotheses,node_tasks toneMint
class node_bot_actions,node_notifications toneRose
class node_llm_client,node_time,node_config,node_i18n,node_person,node_telegram,node_health_sources,node_medical_docs,node_wearables,node_genome,node_reminders,node_llm toneIndigo
```

## Components

### Data intake

- [Bot intake](https://github.com/larrynovsky/larry-health-os/blob/main/handlers/messages.py): `handlers/messages.py`
- [Genome intake](https://github.com/larrynovsky/larry-health-os/blob/main/genome_intake.py): `genome_intake.py`
- [Lab review](https://github.com/larrynovsky/larry-health-os/blob/main/dashboard_routers/api_lab_review.py): `dashboard_routers/api_lab_review.py`
- [Local dashboard](https://github.com/larrynovsky/larry-health-os/blob/main/dashboard_routers/views.py): `dashboard_routers/views.py`

### Health data

- [Local health database](https://github.com/larrynovsky/larry-health-os/blob/main/health_db.py): `health_db.py`
- [Lab records](https://github.com/larrynovsky/larry-health-os/blob/main/labs_db.py): `labs_db.py`
- [Genome processing](https://github.com/larrynovsky/larry-health-os/blob/main/genome_pipeline.py): `genome_pipeline.py`
- [Health imports](https://github.com/larrynovsky/larry-health-os/blob/main/import_all.py): `import_all.py`

### Analysis

- [Scheduled jobs](https://github.com/larrynovsky/larry-health-os/blob/main/jobs/scheduled.py): `jobs/scheduled.py`
- [Morning brief](https://github.com/larrynovsky/larry-health-os/blob/main/brief_pipeline.py): `brief_pipeline.py`
- [Health intelligence](https://github.com/larrynovsky/larry-health-os/blob/main/hai_core.py): `hai_core.py`
- [Correlation checks](https://github.com/larrynovsky/larry-health-os/blob/main/correlation_gate.py): `correlation_gate.py`
- [Hypotheses](https://github.com/larrynovsky/larry-health-os/blob/main/hai_hypotheses.py): `hai_hypotheses.py`
- [Tasks and follow-up](https://github.com/larrynovsky/larry-health-os/blob/main/task_agent.py): `task_agent.py`

### Proactive delivery

- [Bot actions](https://github.com/larrynovsky/larry-health-os/blob/main/bot/actions.py): `bot/actions.py`
- [Notifications](https://github.com/larrynovsky/larry-health-os/blob/main/notify.py): `notify.py`

### Internal platform

- [LLM client](https://github.com/larrynovsky/larry-health-os/blob/main/llm_client.py): `llm_client.py`
- [Time seam](https://github.com/larrynovsky/larry-health-os/blob/main/_time_inject.py): `_time_inject.py`
- [System configuration](https://github.com/larrynovsky/larry-health-os/blob/main/config_db.py): `config_db.py`
- [Interface language](https://github.com/larrynovsky/larry-health-os/blob/main/i18n.py): `i18n.py`

### Other components

- **Person**
- **Telegram**
- **Health sources**
- **Medical documents**
- **Wearables**
- **Genome files**
- **macOS Reminders**
- **LLM service**

## Connections

- Person → Telegram: sends data
- Telegram → Bot intake: routes replies (evidence: `handlers/messages.py`)
- Bot intake → Local health database: records health data (evidence: `handlers/messages.py`)
- Person → Medical documents: provides records
- Medical documents → Local health database: ingests records
- Health sources → Wearables: supplies measurements
- Wearables → Health imports: imports data
- Health imports → Local health database: stores data
- Person → Genome files: provides file
- Genome files → Genome intake: uploads file
- Genome intake → Genome processing: dispatches processing (evidence: `genome_intake.py`)
- Genome intake → Local health database: records data (evidence: `genome_intake.py`)
- Person → Local dashboard: reviews data
- Local dashboard → Lab review: reviews labs (evidence: `dashboard_routers/api_lab_review.py`)
- Lab review → Lab records: reads and updates (evidence: `dashboard_routers/api_lab_review.py`)
- Local health database → Scheduled jobs: feeds analysis (evidence: `jobs/scheduled.py`)
- Scheduled jobs → Morning brief: schedules brief
- Morning brief → Health intelligence: requests analysis (evidence: `brief_pipeline.py`)
- Health intelligence → LLM client: uses client (evidence: `llm_client.py`)
- LLM client → LLM service: sends requests (evidence: `llm_client.py`)
- Scheduled jobs → Correlation checks: checks correlations
- Scheduled jobs → Hypotheses: runs consilium
- Scheduled jobs → Tasks and follow-up: creates follow-up (evidence: `jobs/scheduled.py`)
- Tasks and follow-up → Local health database: stores tasks (evidence: `task_agent.py`)
- Scheduled jobs → Telegram: delivers brief
- Scheduled jobs → Notifications: sends alerts (evidence: `jobs/scheduled.py`)
- Notifications → Telegram: delivers messages (evidence: `notify.py`)
- Person → Bot actions: answers prompts
- Bot actions → Bot intake: routes replies (evidence: `handlers/messages.py`)
- Tasks and follow-up → macOS Reminders: syncs reminders (evidence: `task_agent.py`)
- Scheduled jobs → Time seam: reads current time (evidence: `jobs/scheduled.py`)
- Scheduled jobs → System configuration: reads settings (evidence: `jobs/scheduled.py`)
- Bot actions → Interface language: localizes replies (evidence: `bot/actions.py`)
