# kakumanu-harshitha/medintel-ai architecture

> Architecture diagram of the GitHub repository kakumanu-harshitha/medintel-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kakumanu-harshitha/medintel-ai
- Repository: https://github.com/kakumanu-harshitha/medintel-ai

## Overview

AI Health Assistant is a React/FastAPI health companion: users authenticate, submit text or voice and optional images/reports, receive informational clinical analysis, and can review saved history and reports. The backend harmonizes multimodal inputs, routes clinical questions through intent/RAG and LLM reasoning, and stores assessments and conversation history. Separate branches cover profile/authentication, report generation, and administrator monitoring. Edges reflect the sampled entry points and explicit README capabilities; several feature routers and integrations were not sampled, so their internal wiring is left out.

Main entry points: [`backend/app/main.py`](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/main.py) (FastAPI app), [`backend/app/api/query_service.py`](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/query_service.py) (Multimodal endpoint), [`backend/app/services/llm_service.py`](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/llm_service.py) (Clinical reasoning), [`backend/app/admin/dashboard_service.py`](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/admin/dashboard_service.py) (Owner monitoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Patient experience"]
  node_app["React routes<br/>[App.jsx]"]
  node_chat["Assessment chat<br/>[Chat.jsx]"]
  node_client["API client<br/>[api.js]"]
  node_reportui["Reports page<br/>[Reports.jsx]"]
end

subgraph group_access["Identity and profiles"]
  node_auth["Authentication<br/>[auth.py]"]
  node_profile["Profile API<br/>[profile_router.py]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_clinical["Clinical assessment"]
  node_server["FastAPI app<br/>[main.py]"]
  node_query["Multimodal endpoint<br/>[query_service.py]"]
  node_reasoner["Clinical reasoning<br/>[llm_service.py]"]
  node_intent["Intent and RAG routing<br/>[rag_router.py]"]
  node_speech["Speech processing<br/>[speech_service.py]"]
  node_reportproc["Report extraction"]
  node_groq{{"Groq LLM"}}
end

subgraph group_knowledge["Knowledge and memory"]
  node_retrieval["Medical retrieval<br/>[rag_service.py]"]
  node_pinecone[("Pinecone vectors")]
  node_ingester["Medical data ingestion"]
  node_mongo[("MongoDB history<br/>[mongo_memory.py]")]
end

subgraph group_oversight["Reports and oversight"]
  node_reports["Report API<br/>[report_router.py]"]
  node_feedback["Feedback API<br/>[feedback_router.py]"]
  node_dashboard["Owner monitoring"]
end

node_patient(("Patient"))
node_specialist(("Medical specialists"))

node_patient -->|"uses"| node_app
node_app -->|"routes"| node_chat
node_chat -->|"submits query"| node_client
node_client -->|"API requests"| node_server
node_server -->|"mounts routes"| node_auth
node_server -->|"mounts routes"| node_profile
node_server -->|"mounts routes"| node_query
node_server -->|"mounts routes"| node_reports
node_server -->|"mounts routes"| node_feedback
node_server -->|"mounts routes"| node_dashboard
node_auth -->|"reads and writes"| node_postgres
node_profile -->|"reads and writes"| node_postgres
node_query -->|"transcribes audio"| node_speech
node_query -->|"extracts report"| node_reportproc
node_query -->|"requests analysis"| node_reasoner
node_reasoner -->|"routes clinical intent"| node_intent
node_intent -->|"selects retrieval"| node_retrieval
node_retrieval -->|"searches vectors"| node_pinecone
node_reasoner -->|"requests generation"| node_groq
node_query -->|"stores conversation"| node_mongo
node_ingester -->|"indexes medical sources"| node_pinecone
node_reports -->|"reads saved reports"| node_mongo
node_reportui -->|"requests reports"| node_client
node_feedback -->|"records feedback"| node_postgres
node_dashboard -->|"reads audit and profile data"| node_postgres
node_dashboard -->|"reads history and reports"| node_mongo
node_reasoner -.->|"flags escalation"| node_specialist

click node_app "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/App.jsx"
click node_chat "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/pages/Chat.jsx"
click node_client "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/services/api.js"
click node_server "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/main.py"
click node_auth "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/auth/logic/auth.py"
click node_profile "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/profile_router.py"
click node_query "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/query_service.py"
click node_reasoner "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/llm_service.py"
click node_intent "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/rag_router.py"
click node_retrieval "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/rag/rag_service.py"
click node_ingester "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/medical_ingester.py"
click node_mongo "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/database/mongo_memory.py"
click node_speech "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/speech_service.py"
click node_reportproc "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/report_processor.py"
click node_reports "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/report_router.py"
click node_reportui "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/pages/Reports.jsx"
click node_feedback "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/feedback_router.py"
click node_dashboard "https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/admin/dashboard_service.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_chat,node_client,node_reportui toneBlue
class node_auth,node_profile,node_postgres toneAmber
class node_server,node_query,node_reasoner,node_intent,node_speech,node_reportproc,node_groq toneMint
class node_retrieval,node_pinecone,node_ingester,node_mongo toneRose
class node_reports,node_feedback,node_dashboard,node_patient,node_specialist toneIndigo
```

## Components

### Patient experience

- [React routes](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/App.jsx): `frontend_react/src/App.jsx`
- [Assessment chat](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/pages/Chat.jsx): `frontend_react/src/pages/Chat.jsx`
- [API client](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/services/api.js): `frontend_react/src/services/api.js`
- [Reports page](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/frontend_react/src/pages/Reports.jsx): `frontend_react/src/pages/Reports.jsx`

### Identity and profiles

- [Authentication](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/auth/logic/auth.py): `backend/app/auth/logic/auth.py`
- [Profile API](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/profile_router.py): `backend/app/api/profile_router.py`
- **PostgreSQL**

### Clinical assessment

- [FastAPI app](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Multimodal endpoint](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/query_service.py): `backend/app/api/query_service.py`
- [Clinical reasoning](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/llm_service.py): `backend/app/services/llm_service.py`
- [Intent and RAG routing](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/rag_router.py): `backend/app/api/rag_router.py`
- [Speech processing](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/speech_service.py): `backend/app/services/speech_service.py`
- [Report extraction](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/services/report_processor.py): `backend/app/services/report_processor.py`
- **Groq LLM**

### Knowledge and memory

- [Medical retrieval](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/rag/rag_service.py): `backend/app/rag/rag_service.py`
- **Pinecone vectors**
- [Medical data ingestion](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/medical_ingester.py): `backend/medical_ingester.py`
- [MongoDB history](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/database/mongo_memory.py): `backend/app/database/mongo_memory.py`

### Reports and oversight

- [Report API](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/report_router.py): `backend/app/api/report_router.py`
- [Feedback API](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/api/feedback_router.py): `backend/app/api/feedback_router.py`
- [Owner monitoring](https://github.com/kakumanu-harshitha/medintel-ai/blob/main/backend/app/admin/dashboard_service.py): `backend/app/admin/dashboard_service.py`

### Other components

- **Patient**
- **Medical specialists**

## Connections

- Patient → React routes: uses
- React routes → Assessment chat: routes
- Assessment chat → API client: submits query
- API client → FastAPI app: API requests
- FastAPI app → Authentication: mounts routes
- FastAPI app → Profile API: mounts routes
- FastAPI app → Multimodal endpoint: mounts routes
- FastAPI app → Report API: mounts routes
- FastAPI app → Feedback API: mounts routes
- FastAPI app → Owner monitoring: mounts routes
- Authentication → PostgreSQL: reads and writes
- Profile API → PostgreSQL: reads and writes
- Multimodal endpoint → Speech processing: transcribes audio
- Multimodal endpoint → Report extraction: extracts report
- Multimodal endpoint → Clinical reasoning: requests analysis
- Clinical reasoning → Intent and RAG routing: routes clinical intent
- Intent and RAG routing → Medical retrieval: selects retrieval
- Medical retrieval → Pinecone vectors: searches vectors
- Clinical reasoning → Groq LLM: requests generation
- Multimodal endpoint → MongoDB history: stores conversation
- Medical data ingestion → Pinecone vectors: indexes medical sources
- Report API → MongoDB history: reads saved reports
- Reports page → API client: requests reports
- Feedback API → PostgreSQL: records feedback
- Owner monitoring → PostgreSQL: reads audit and profile data
- Owner monitoring → MongoDB history: reads history and reports
- Clinical reasoning → Medical specialists: flags escalation
