# vharichandana/jiva architecture

> Architecture diagram of the GitHub repository vharichandana/jiva, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vharichandana/jiva
- Repository: https://github.com/vharichandana/jiva

## Overview

JIVA is a Streamlit research-screening application: users choose a modality or the agent workflow, submit patient media, and receive analysis findings with downloadable reports. The agent path validates and routes inputs, executes selected modality adapters, and synthesizes results. The README also documents VOC explainability and benchmarking, audio/X-ray assisted reads, video rPPG, and the scoped Ask JIVA assistant. Relationships below rely on the README and shown source/index references; some modality internals were not sampled, so uncertain wiring is omitted.

Main entry points: [`streamlit_app.py`](https://github.com/vharichandana/jiva/blob/master/streamlit_app.py) (Application routing), [`agent/module_registry.py`](https://github.com/vharichandana/jiva/blob/master/agent/module_registry.py) (Adapter registry), [`agent/orchestrator.py`](https://github.com/vharichandana/jiva/blob/master/agent/orchestrator.py) (Execution controller), [`pages/agent_page.py`](https://github.com/vharichandana/jiva/blob/master/pages/agent_page.py) (Agent interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Streamlit experience"]
  node_app["Application routing<br/>[streamlit_app.py]"]
  node_home["Home and chat<br/>[home.py]"]
  node_chatbot["Ask JIVA<br/>[chatbot.py]"]
end

subgraph group_modalities["Screening modalities"]
  node_voc["Breath VOC<br/>[voc_analysis.py]"]
  node_audio["Audio analysis<br/>[audio_analysis.py]"]
  node_xray["Chest X-ray<br/>[xray_analysis.py]"]
  node_video["Video rPPG<br/>[video_analysis.py]"]
  node_vocadapter["VOC adapter<br/>[voc_adapter.py]"]
  node_audioadapter["Audio adapter<br/>[audio_adapter.py]"]
  node_xrayadapter["X-ray adapter<br/>[xray_adapter.py]"]
  node_videoadapter["Video adapter<br/>[video_adapter.py]"]
end

subgraph group_agent["Agent workflow"]
  node_agentpage["Agent interface<br/>[agent_page.py]"]
  node_input["Input validation<br/>[input_analyzer.py]"]
  node_router["Decision routing<br/>[router.py]"]
  node_laya["Laya decisions<br/>[laya_engine.py]"]
  node_registry["Adapter registry<br/>[module_registry.py]"]
  node_orchestrator["Execution controller<br/>[orchestrator.py]"]
  node_contracts["Result contracts<br/>[schemas.py]"]
  node_aggregator["Result aggregation"]
  node_summary["Summary synthesis"]
end

subgraph group_models["Models and knowledge"]
  node_videoengine["Video processing<br/>[video_processor.py]"]
  node_physformer["PhysFormer network<br/>[Physformer.py]"]
  node_knowledge["JIVA knowledge<br/>[jiva_knowledge.py]"]
end

subgraph group_reporting["Results and reports"]
  node_reports["PDF reports<br/>[pdf_report.py]"]
  node_reportgen["Agent reports"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_voc
node_app -->|"routes"| node_audio
node_app -->|"routes"| node_xray
node_app -->|"routes"| node_video
node_app -->|"routes"| node_agentpage
node_home -->|"renders"| node_chatbot
node_chatbot -->|"uses knowledge"| node_knowledge
node_agentpage -->|"submits inputs"| node_input
node_agentpage -->|"requests routing"| node_router
node_router -->|"requests decisions"| node_laya
node_router -->|"checks adapters"| node_registry
node_orchestrator -->|"fetches adapters"| node_registry
node_orchestrator -->|"aggregates outputs"| node_aggregator
node_orchestrator -->|"synthesizes summary"| node_summary
node_orchestrator -->|"uses contracts"| node_contracts
node_registry -->|"registers"| node_vocadapter
node_registry -->|"registers"| node_audioadapter
node_registry -->|"registers"| node_xrayadapter
node_registry -->|"registers"| node_videoadapter
node_vocadapter -->|"returns output"| node_contracts
node_audioadapter -->|"returns output"| node_contracts
node_videoadapter -->|"delegates processing"| node_videoengine
node_xrayadapter -->|"uses inspection"| node_xray
node_videoengine -->|"runs network"| node_physformer
node_voc -->|"generates report"| node_reports
node_audio -->|"generates report"| node_reports
node_xray -->|"generates report"| node_reports
node_video -->|"generates report"| node_reports
node_agentpage -->|"generates report"| node_reportgen

click node_app "https://github.com/vharichandana/jiva/blob/master/streamlit_app.py"
click node_home "https://github.com/vharichandana/jiva/blob/master/pages/home.py"
click node_voc "https://github.com/vharichandana/jiva/blob/master/pages/voc_analysis.py"
click node_audio "https://github.com/vharichandana/jiva/blob/master/pages/audio_analysis.py"
click node_xray "https://github.com/vharichandana/jiva/blob/master/pages/xray_analysis.py"
click node_video "https://github.com/vharichandana/jiva/blob/master/pages/video_analysis.py"
click node_agentpage "https://github.com/vharichandana/jiva/blob/master/pages/agent_page.py"
click node_input "https://github.com/vharichandana/jiva/blob/master/agent/input_analyzer.py"
click node_router "https://github.com/vharichandana/jiva/blob/master/agent/router.py"
click node_laya "https://github.com/vharichandana/jiva/blob/master/agent/laya_engine.py"
click node_registry "https://github.com/vharichandana/jiva/blob/master/agent/module_registry.py"
click node_orchestrator "https://github.com/vharichandana/jiva/blob/master/agent/orchestrator.py"
click node_contracts "https://github.com/vharichandana/jiva/blob/master/agent/schemas.py"
click node_aggregator "https://github.com/vharichandana/jiva/blob/master/agent/result_aggregator.py"
click node_summary "https://github.com/vharichandana/jiva/blob/master/agent/summary_generator.py"
click node_vocadapter "https://github.com/vharichandana/jiva/blob/master/agent/adapters/voc_adapter.py"
click node_audioadapter "https://github.com/vharichandana/jiva/blob/master/agent/adapters/audio_adapter.py"
click node_xrayadapter "https://github.com/vharichandana/jiva/blob/master/agent/adapters/xray_adapter.py"
click node_videoadapter "https://github.com/vharichandana/jiva/blob/master/agent/adapters/video_adapter.py"
click node_videoengine "https://github.com/vharichandana/jiva/blob/master/utils/video_processor.py"
click node_physformer "https://github.com/vharichandana/jiva/blob/master/models/physformer/Physformer.py"
click node_knowledge "https://github.com/vharichandana/jiva/blob/master/components/jiva_knowledge.py"
click node_chatbot "https://github.com/vharichandana/jiva/blob/master/components/chatbot.py"
click node_reports "https://github.com/vharichandana/jiva/blob/master/utils/pdf_report.py"
click node_reportgen "https://github.com/vharichandana/jiva/blob/master/agent/report_generator.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_app,node_home,node_chatbot,node_user toneBlue
class node_voc,node_audio,node_xray,node_video,node_vocadapter,node_audioadapter,node_xrayadapter,node_videoadapter toneAmber
class node_agentpage,node_input,node_router,node_laya,node_registry,node_orchestrator,node_contracts,node_aggregator,node_summary toneMint
class node_videoengine,node_physformer,node_knowledge toneRose
class node_reports,node_reportgen toneIndigo
```

## Components

### Streamlit experience

- [Application routing](https://github.com/vharichandana/jiva/blob/master/streamlit_app.py): `streamlit_app.py`
- [Home and chat](https://github.com/vharichandana/jiva/blob/master/pages/home.py): `pages/home.py`
- [Ask JIVA](https://github.com/vharichandana/jiva/blob/master/components/chatbot.py): `components/chatbot.py`

### Screening modalities

- [Breath VOC](https://github.com/vharichandana/jiva/blob/master/pages/voc_analysis.py): `pages/voc_analysis.py`
- [Audio analysis](https://github.com/vharichandana/jiva/blob/master/pages/audio_analysis.py): `pages/audio_analysis.py`
- [Chest X-ray](https://github.com/vharichandana/jiva/blob/master/pages/xray_analysis.py): `pages/xray_analysis.py`
- [Video rPPG](https://github.com/vharichandana/jiva/blob/master/pages/video_analysis.py): `pages/video_analysis.py`
- [VOC adapter](https://github.com/vharichandana/jiva/blob/master/agent/adapters/voc_adapter.py): `agent/adapters/voc_adapter.py`
- [Audio adapter](https://github.com/vharichandana/jiva/blob/master/agent/adapters/audio_adapter.py): `agent/adapters/audio_adapter.py`
- [X-ray adapter](https://github.com/vharichandana/jiva/blob/master/agent/adapters/xray_adapter.py): `agent/adapters/xray_adapter.py`
- [Video adapter](https://github.com/vharichandana/jiva/blob/master/agent/adapters/video_adapter.py): `agent/adapters/video_adapter.py`

### Agent workflow

- [Agent interface](https://github.com/vharichandana/jiva/blob/master/pages/agent_page.py): `pages/agent_page.py`
- [Input validation](https://github.com/vharichandana/jiva/blob/master/agent/input_analyzer.py): `agent/input_analyzer.py`
- [Decision routing](https://github.com/vharichandana/jiva/blob/master/agent/router.py): `agent/router.py`
- [Laya decisions](https://github.com/vharichandana/jiva/blob/master/agent/laya_engine.py): `agent/laya_engine.py`
- [Adapter registry](https://github.com/vharichandana/jiva/blob/master/agent/module_registry.py): `agent/module_registry.py`
- [Execution controller](https://github.com/vharichandana/jiva/blob/master/agent/orchestrator.py): `agent/orchestrator.py`
- [Result contracts](https://github.com/vharichandana/jiva/blob/master/agent/schemas.py): `agent/schemas.py`
- [Result aggregation](https://github.com/vharichandana/jiva/blob/master/agent/result_aggregator.py): `agent/result_aggregator.py`
- [Summary synthesis](https://github.com/vharichandana/jiva/blob/master/agent/summary_generator.py): `agent/summary_generator.py`

### Models and knowledge

- [Video processing](https://github.com/vharichandana/jiva/blob/master/utils/video_processor.py): `utils/video_processor.py`
- [PhysFormer network](https://github.com/vharichandana/jiva/blob/master/models/physformer/Physformer.py): `models/physformer/Physformer.py`
- [JIVA knowledge](https://github.com/vharichandana/jiva/blob/master/components/jiva_knowledge.py): `components/jiva_knowledge.py`

### Results and reports

- [PDF reports](https://github.com/vharichandana/jiva/blob/master/utils/pdf_report.py): `utils/pdf_report.py`
- [Agent reports](https://github.com/vharichandana/jiva/blob/master/agent/report_generator.py): `agent/report_generator.py`

### Other components

- **User**

## Connections

- User → Application routing: opens (evidence: `README.md`)
- Application routing → Home and chat: routes (evidence: `streamlit_app.py`)
- Application routing → Breath VOC: routes (evidence: `streamlit_app.py`)
- Application routing → Audio analysis: routes (evidence: `streamlit_app.py`)
- Application routing → Chest X-ray: routes (evidence: `streamlit_app.py`)
- Application routing → Video rPPG: routes (evidence: `streamlit_app.py`)
- Application routing → Agent interface: routes (evidence: `streamlit_app.py`)
- Home and chat → Ask JIVA: renders (evidence: `pages/home.py`)
- Ask JIVA → JIVA knowledge: uses knowledge (evidence: `components/chatbot.py`)
- Agent interface → Input validation: submits inputs (evidence: `pages/agent_page.py`)
- Agent interface → Decision routing: requests routing
- Decision routing → Laya decisions: requests decisions (evidence: `agent/router.py`)
- Decision routing → Adapter registry: checks adapters (evidence: `agent/router.py`)
- Execution controller → Adapter registry: fetches adapters (evidence: `agent/orchestrator.py`)
- Execution controller → Result aggregation: aggregates outputs (evidence: `agent/orchestrator.py`)
- Execution controller → Summary synthesis: synthesizes summary (evidence: `agent/orchestrator.py`)
- Execution controller → Result contracts: uses contracts (evidence: `agent/orchestrator.py`)
- Adapter registry → VOC adapter: registers (evidence: `agent/module_registry.py`)
- Adapter registry → Audio adapter: registers (evidence: `agent/module_registry.py`)
- Adapter registry → X-ray adapter: registers (evidence: `agent/module_registry.py`)
- Adapter registry → Video adapter: registers (evidence: `agent/module_registry.py`)
- VOC adapter → Result contracts: returns output (evidence: `agent/adapters/voc_adapter.py`)
- Audio adapter → Result contracts: returns output (evidence: `agent/adapters/audio_adapter.py`)
- Video adapter → Video processing: delegates processing (evidence: `agent/adapters/video_adapter.py`)
- X-ray adapter → Chest X-ray: uses inspection (evidence: `agent/adapters/xray_adapter.py`)
- Video processing → PhysFormer network: runs network (evidence: `utils/video_processor.py`)
- Breath VOC → PDF reports: generates report (evidence: `pages/voc_analysis.py`)
- Audio analysis → PDF reports: generates report (evidence: `pages/audio_analysis.py`)
- Chest X-ray → PDF reports: generates report (evidence: `pages/xray_analysis.py`)
- Video rPPG → PDF reports: generates report (evidence: `pages/video_analysis.py`)
- Agent interface → Agent reports: generates report
