# renuraman93/healthcare-agentic-ai architecture

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

- Interactive diagram: https://gitdiagram.com/renuraman93/healthcare-agentic-ai
- Repository: https://github.com/renuraman93/healthcare-agentic-ai

## Overview

This repository implements an educational healthcare chatbot with document-grounded answers, clinical extraction, summarization, and general health responses. Users interact through a Streamlit frontend and FastAPI API; document uploads are indexed, and chat requests are handled by a routed LangGraph workflow whose agents use LLM and retrieval capabilities. The graph preserves the documented workflow branches and ingestion stages. Some runtime wiring is dynamic or lies in unsampled excerpts, so those relationships are omitted or marked unverified rather than asserted.

Main entry points: [`app/graph/workflow.py`](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/graph/workflow.py) (Healthcare workflow), [`app/main.py`](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/main.py) (FastAPI application), [`app/services/document_service.py`](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/services/document_service.py) (Document ingestion service), [`app/llm/llm_factory.py`](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/llm/llm_factory.py) (LLM provider factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_frontend["Streamlit UI<br/>[streamlit_app.py]"]
  node_api_client["API client<br/>[api_client.py]"]
end

subgraph group_api["API and orchestration"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_chat_api["Chat API<br/>[chat.py]"]
  node_document_api["Document API<br/>[documents.py]"]
  node_health_api["Health API<br/>[health.py]"]
  node_workflow["Healthcare workflow<br/>[workflow.py]"]
  node_memory[("Conversation memory<br/>[memory.py]")]
  node_schemas["Workflow state and results<br/>[schemas.py]"]
end

subgraph group_agents["Healthcare agents"]
  node_supervisor["Route supervisor"]
  node_document_agent["Document search agent<br/>[document_agent.py]"]
  node_reasoning_agent["Document reasoning agent<br/>[reasoning_agent.py]"]
  node_clinical_agent["Clinical extraction agent<br/>[clinical_agent.py]"]
  node_summarization_agent["Summarization agent"]
  node_general_agent["General answer agent<br/>[general_agent.py]"]
  node_response_agent["Response composer<br/>[response_agent.py]"]
end

subgraph group_rag["Document retrieval"]
  node_document_service["Document ingestion service"]
  node_loaders["Document loaders<br/>[loaders.py]"]
  node_cleaning["Text cleaning<br/>[cleaning.py]"]
  node_chunking["Text chunking<br/>[chunking.py]"]
  node_retriever["Semantic retriever<br/>[retriever.py]"]
  node_vector_store[("Chroma vector store<br/>[vector_store.py]")]
end

subgraph group_providers["Model providers"]
  node_embeddings["Gemini embeddings<br/>[embeddings.py]"]
  node_llm_factory["LLM provider factory<br/>[llm_factory.py]"]
  node_gemini_llm["Gemini language model<br/>[gemini_llm.py]"]
end

node_user(("Chat user"))
node_gemini_service{{"Google Gemini API"}}

node_user -.->|"asks questions"| node_frontend
node_frontend -->|"uses"| node_api_client
node_api_client -.->|"sends requests"| node_fastapi
node_fastapi -->|"routes requests"| node_chat_api
node_fastapi -->|"routes requests"| node_document_api
node_fastapi -->|"routes requests"| node_health_api
node_fastapi -->|"initializes"| node_workflow
node_fastapi -->|"initializes"| node_document_service
node_chat_api -.->|"invokes"| node_workflow
node_document_api -->|"delegates"| node_document_service
node_workflow -->|"reads and updates"| node_memory
node_workflow -->|"routes through"| node_supervisor
node_workflow -->|"searches with"| node_document_agent
node_workflow -->|"delegates reasoning"| node_reasoning_agent
node_workflow -->|"delegates extraction"| node_clinical_agent
node_workflow -->|"delegates summary"| node_summarization_agent
node_workflow -->|"delegates answers"| node_general_agent
node_workflow -->|"composes result"| node_response_agent
node_document_agent -->|"retrieves context"| node_retriever
node_document_service -->|"loads documents"| node_loaders
node_document_service -->|"cleans text"| node_cleaning
node_document_service -->|"chunks text"| node_chunking
node_document_service -->|"stores chunks"| node_vector_store
node_retriever -->|"embeds query"| node_embeddings
node_retriever -->|"queries"| node_vector_store
node_vector_store -->|"embeds chunks"| node_embeddings
node_embeddings -->|"requests embeddings"| node_gemini_service
node_clinical_agent -->|"gets provider"| node_llm_factory
node_reasoning_agent -->|"gets provider"| node_llm_factory
node_general_agent -->|"gets provider"| node_llm_factory
node_summarization_agent -->|"gets provider"| node_llm_factory
node_llm_factory -->|"creates provider"| node_gemini_llm
node_gemini_llm -.->|"generates text"| node_gemini_service

click node_frontend "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/frontend/streamlit_app.py"
click node_api_client "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/frontend/api_client.py"
click node_fastapi "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/main.py"
click node_chat_api "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/api/chat.py"
click node_document_api "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/api/documents.py"
click node_health_api "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/api/health.py"
click node_workflow "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/graph/workflow.py"
click node_memory "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/graph/memory.py"
click node_schemas "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/models/schemas.py"
click node_document_service "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/services/document_service.py"
click node_loaders "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/loaders.py"
click node_cleaning "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/cleaning.py"
click node_chunking "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/chunking.py"
click node_retriever "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/retriever.py"
click node_vector_store "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/vector_store.py"
click node_embeddings "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/embeddings.py"
click node_supervisor "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/supervisor_agent.py"
click node_document_agent "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/document_agent.py"
click node_reasoning_agent "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/reasoning_agent.py"
click node_clinical_agent "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/clinical_agent.py"
click node_summarization_agent "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/summarization_agent.py"
click node_general_agent "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/general_agent.py"
click node_response_agent "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/response_agent.py"
click node_llm_factory "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/llm/llm_factory.py"
click node_gemini_llm "https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/llm/gemini_llm.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_api_client,node_user toneBlue
class node_fastapi,node_chat_api,node_document_api,node_health_api,node_workflow,node_memory,node_schemas toneAmber
class node_supervisor,node_document_agent,node_reasoning_agent,node_clinical_agent,node_summarization_agent,node_general_agent,node_response_agent,node_gemini_service toneMint
class node_document_service,node_loaders,node_cleaning,node_chunking,node_retriever,node_vector_store toneRose
class node_embeddings,node_llm_factory,node_gemini_llm toneIndigo
```

## Components

### User interface

- [Streamlit UI](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/frontend/streamlit_app.py): `frontend/streamlit_app.py`
- [API client](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/frontend/api_client.py): `frontend/api_client.py`

### API and orchestration

- [FastAPI application](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/main.py): `app/main.py`
- [Chat API](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/api/chat.py): `app/api/chat.py`
- [Document API](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/api/documents.py): `app/api/documents.py`
- [Health API](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/api/health.py): `app/api/health.py`
- [Healthcare workflow](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/graph/workflow.py): `app/graph/workflow.py`
- [Conversation memory](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/graph/memory.py): `app/graph/memory.py`
- [Workflow state and results](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/models/schemas.py): `app/models/schemas.py`

### Healthcare agents

- [Route supervisor](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/supervisor_agent.py): `app/agents/supervisor_agent.py`
- [Document search agent](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/document_agent.py): `app/agents/document_agent.py`
- [Document reasoning agent](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/reasoning_agent.py): `app/agents/reasoning_agent.py`
- [Clinical extraction agent](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/clinical_agent.py): `app/agents/clinical_agent.py`
- [Summarization agent](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/summarization_agent.py): `app/agents/summarization_agent.py`
- [General answer agent](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/general_agent.py): `app/agents/general_agent.py`
- [Response composer](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/agents/response_agent.py): `app/agents/response_agent.py`

### Document retrieval

- [Document ingestion service](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/services/document_service.py): `app/services/document_service.py`
- [Document loaders](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/loaders.py): `app/rag/loaders.py`
- [Text cleaning](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/cleaning.py): `app/rag/cleaning.py`
- [Text chunking](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/chunking.py): `app/rag/chunking.py`
- [Semantic retriever](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/retriever.py): `app/rag/retriever.py`
- [Chroma vector store](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/vector_store.py): `app/rag/vector_store.py`

### Model providers

- [Gemini embeddings](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/rag/embeddings.py): `app/rag/embeddings.py`
- [LLM provider factory](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/llm/llm_factory.py): `app/llm/llm_factory.py`
- [Gemini language model](https://github.com/renuraman93/healthcare-agentic-ai/blob/main/app/llm/gemini_llm.py): `app/llm/gemini_llm.py`

### Other components

- **Chat user**
- **Google Gemini API**

## Connections

- Chat user → Streamlit UI: asks questions
- Streamlit UI → API client: uses (evidence: `frontend/streamlit_app.py`)
- API client → FastAPI application: sends requests
- FastAPI application → Chat API: routes requests (evidence: `app/main.py`)
- FastAPI application → Document API: routes requests (evidence: `app/main.py`)
- FastAPI application → Health API: routes requests (evidence: `app/main.py`)
- FastAPI application → Healthcare workflow: initializes (evidence: `app/main.py`)
- FastAPI application → Document ingestion service: initializes (evidence: `app/main.py`)
- Chat API → Healthcare workflow: invokes
- Document API → Document ingestion service: delegates (evidence: `app/api/documents.py`)
- Healthcare workflow → Conversation memory: reads and updates (evidence: `app/graph/workflow.py`)
- Healthcare workflow → Route supervisor: routes through (evidence: `app/graph/workflow.py`)
- Healthcare workflow → Document search agent: searches with (evidence: `app/graph/workflow.py`)
- Healthcare workflow → Document reasoning agent: delegates reasoning (evidence: `app/graph/workflow.py`)
- Healthcare workflow → Clinical extraction agent: delegates extraction (evidence: `app/graph/workflow.py`)
- Healthcare workflow → Summarization agent: delegates summary (evidence: `app/graph/workflow.py`)
- Healthcare workflow → General answer agent: delegates answers (evidence: `app/graph/workflow.py`)
- Healthcare workflow → Response composer: composes result (evidence: `app/graph/workflow.py`)
- Document search agent → Semantic retriever: retrieves context (evidence: `app/agents/document_agent.py`)
- Document ingestion service → Document loaders: loads documents (evidence: `app/services/document_service.py`)
- Document ingestion service → Text cleaning: cleans text (evidence: `app/services/document_service.py`)
- Document ingestion service → Text chunking: chunks text (evidence: `app/services/document_service.py`)
- Document ingestion service → Chroma vector store: stores chunks (evidence: `app/services/document_service.py`)
- Semantic retriever → Gemini embeddings: embeds query (evidence: `app/rag/retriever.py`)
- Semantic retriever → Chroma vector store: queries (evidence: `app/rag/retriever.py`)
- Chroma vector store → Gemini embeddings: embeds chunks (evidence: `app/rag/vector_store.py`)
- Gemini embeddings → Google Gemini API: requests embeddings (evidence: `app/rag/embeddings.py`)
- Clinical extraction agent → LLM provider factory: gets provider (evidence: `app/agents/clinical_agent.py`)
- Document reasoning agent → LLM provider factory: gets provider (evidence: `app/agents/reasoning_agent.py`)
- General answer agent → LLM provider factory: gets provider (evidence: `app/agents/general_agent.py`)
- Summarization agent → LLM provider factory: gets provider (evidence: `app/agents/summarization_agent.py`)
- LLM provider factory → Gemini language model: creates provider (evidence: `app/llm/llm_factory.py`)
- Gemini language model → Google Gemini API: generates text
