# gitakhileshyadav/ai-medical-assistant architecture

> Architecture diagram of the GitHub repository gitakhileshyadav/ai-medical-assistant, 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/gitakhileshyadav/ai-medical-assistant
- Repository: https://github.com/gitakhileshyadav/ai-medical-assistant

## Overview

This is a FastAPI medical-image analysis assistant. The documented user journey is image upload and optimization, backend validation and session handling, AI interpretation, and a structured response that users can discuss in follow-up turns. The graph preserves those product stages and the JSON-processing module. Relationship evidence is limited: the README documents the workflow, and app.py’s indexed references include json_pipeline.py and Pillow; other implementation details were not shown.

Main entry points: [`app.py`](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py) (FastAPI application), [`static/js/app.js`](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/static/js/app.js) (Web interface), [`json_pipeline.py`](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/json_pipeline.py) (JSON processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_frontend["Web interface<br/>[app.js]"]
  node_imageprep["Image preparation<br/>[app.js]"]
end

subgraph group_backend["Request handling"]
  node_api["FastAPI application<br/>[app.py]"]
  node_validation["Image validation<br/>[app.py]"]
end

subgraph group_analysis["AI analysis"]
  node_pipeline["JSON processing<br/>[json_pipeline.py]"]
  node_groq{{"Groq LLM"}}
  node_response["Structured insights<br/>[app.py]"]
end

subgraph group_session["Conversation state"]
  node_history[("Session conversation<br/>[app.py]")]
end

node_professional(("Healthcare professional"))

node_professional -->|"submits image"| node_frontend
node_frontend -->|"prepares image"| node_imageprep
node_imageprep -->|"uploads image"| node_api
node_api -->|"validates input"| node_validation
node_api -->|"manages session"| node_history
node_api -->|"processes JSON"| node_pipeline
node_api -->|"requests analysis"| node_groq
node_groq -->|"returns insights"| node_response
node_response -->|"shows results"| node_frontend
node_frontend -->|"sends follow-up"| node_api
node_api -->|"uses context"| node_history

click node_frontend "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/static/js/app.js"
click node_imageprep "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/static/js/app.js"
click node_api "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py"
click node_validation "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py"
click node_pipeline "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/json_pipeline.py"
click node_response "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py"
click node_history "https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.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_frontend,node_imageprep toneBlue
class node_api,node_validation toneAmber
class node_pipeline,node_groq,node_response toneMint
class node_history toneRose
class node_professional toneIndigo
```

## Components

### Client experience

- [Web interface](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/static/js/app.js): `static/js/app.js`
- [Image preparation](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/static/js/app.js): `static/js/app.js`

### Request handling

- [FastAPI application](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py): `app.py`
- [Image validation](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py): `app.py`

### AI analysis

- [JSON processing](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/json_pipeline.py): `json_pipeline.py`
- **Groq LLM**
- [Structured insights](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py): `app.py`

### Conversation state

- [Session conversation](https://github.com/gitakhileshyadav/ai-medical-assistant/blob/main/app.py): `app.py`

### Other components

- **Healthcare professional**

## Connections

- Healthcare professional → Web interface: submits image
- Web interface → Image preparation: prepares image (evidence: `static/js/app.js`)
- Image preparation → FastAPI application: uploads image
- FastAPI application → Image validation: validates input (evidence: `app.py`)
- FastAPI application → Session conversation: manages session (evidence: `app.py`)
- FastAPI application → JSON processing: processes JSON (evidence: `app.py`)
- FastAPI application → Groq LLM: requests analysis
- Groq LLM → Structured insights: returns insights
- Structured insights → Web interface: shows results
- Web interface → FastAPI application: sends follow-up
- FastAPI application → Session conversation: uses context (evidence: `app.py`)
