# manishkondoju/health_compass architecture

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

- Interactive diagram: https://gitdiagram.com/manishkondoju/health_compass
- Repository: https://github.com/manishkondoju/health_compass

## Overview

Health Compass is a Streamlit medical-information platform whose main user flow turns a health question into a safety-checked, source-cited RAG response. Its data-preparation path collects trusted-source pages, cleans and chunks them, then indexes them for retrieval. The README also describes document analysis, profile personalization, symptom tracking, specialist matching, medication support, and health-assistant features. Some feature modules were not sampled; those branches reflect documented capabilities, and their internal calls are not inferred.

Main entry points: [`src/app.py`](https://github.com/manishkondoju/health_compass/blob/main/src/app.py) (Streamlit app), [`src/rag/rag_pipeline.py`](https://github.com/manishkondoju/health_compass/blob/main/src/rag/rag_pipeline.py) (RAG pipeline), [`src/utils/healthcare_assistant.py`](https://github.com/manishkondoju/health_compass/blob/main/src/utils/healthcare_assistant.py) (Healthcare assistant), [`src/utils/document_analyzer_enhanced.py`](https://github.com/manishkondoju/health_compass/blob/main/src/utils/document_analyzer_enhanced.py) (Medical documents)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User experience"]
  node_app["Streamlit app<br/>[app.py]"]
  node_documents["Medical documents"]
  node_assistant["Healthcare assistant"]
end

subgraph group_knowledge["Health knowledge"]
  node_rag["RAG pipeline<br/>[rag_pipeline.py]"]
  node_safety["Safety checks<br/>[safety.py]"]
  node_vectors[("Vector search<br/>[vector_db.py]")]
  node_llm["OpenRouter LLM"]
  node_processor["Text processing<br/>[text_processor.py]"]
  node_cdc["CDC scraper<br/>[cdc_scraper.py]"]
  node_medline["MedlinePlus scraper"]
end

subgraph group_guidance["Personal health guidance"]
  node_symptoms["Symptom tracker<br/>[symptom_tracker.py]"]
  node_specialist["Specialist matcher"]
  node_navigator["Symptom navigator"]
  node_healthtools["Health tools<br/>[health_tools.py]"]
  node_news["Health news<br/>[news_aggregator.py]"]
end

subgraph group_state["Personal health data"]
  node_profile[("User profile<br/>[user_profile.py]")]
  node_medications[("Medication tracker")]
  node_journal[("Health journals<br/>[health_journal.py]")]
  node_smartjournal[("Smart journal<br/>[smart_journal.py]")]
end

node_user(("Health user"))
node_sources["Health websites"]

node_user -->|"uses"| node_app
node_app -->|"submits queries"| node_rag
node_rag -->|"retrieves context"| node_vectors
node_rag -->|"generates answer"| node_llm
node_rag -->|"checks safety"| node_safety
node_rag -->|"returns citations"| node_app
node_sources -->|"provides pages"| node_cdc
node_sources -->|"provides pages"| node_medline
node_cdc -->|"stores raw pages"| node_processor
node_medline -->|"stores raw pages"| node_processor
node_processor -->|"indexes chunks"| node_vectors
node_user -->|"uploads reports"| node_documents
node_app -->|"renders analyzer"| node_documents
node_app -->|"renders assistant"| node_assistant
node_app -->|"renders tracking"| node_symptoms
node_app -->|"renders matching"| node_specialist
node_app -->|"manages profile"| node_profile
node_app -->|"offers guidance"| node_navigator
node_app -->|"tracks medications"| node_medications
node_app -.->|"offers journaling"| node_journal
node_app -.->|"offers smart journal"| node_smartjournal
node_app -.->|"offers health tools"| node_healthtools
node_app -.->|"offers health news"| node_news
node_documents -->|"queries knowledge"| node_rag
node_specialist -->|"enriches recommendations"| node_rag
node_assistant -.->|"personalizes responses"| node_profile
node_assistant -.->|"checks interactions"| node_medications

click node_app "https://github.com/manishkondoju/health_compass/blob/main/src/app.py"
click node_rag "https://github.com/manishkondoju/health_compass/blob/main/src/rag/rag_pipeline.py"
click node_safety "https://github.com/manishkondoju/health_compass/blob/main/src/utils/safety.py"
click node_vectors "https://github.com/manishkondoju/health_compass/blob/main/src/rag/vector_db.py"
click node_llm "https://github.com/manishkondoju/health_compass/blob/main/src/rag/openrouter_client.py"
click node_processor "https://github.com/manishkondoju/health_compass/blob/main/src/processors/text_processor.py"
click node_cdc "https://github.com/manishkondoju/health_compass/blob/main/src/scrapers/cdc_scraper.py"
click node_medline "https://github.com/manishkondoju/health_compass/blob/main/src/scrapers/medlineplus_scraper.py"
click node_documents "https://github.com/manishkondoju/health_compass/blob/main/src/utils/document_analyzer_enhanced.py"
click node_assistant "https://github.com/manishkondoju/health_compass/blob/main/src/utils/healthcare_assistant.py"
click node_symptoms "https://github.com/manishkondoju/health_compass/blob/main/src/utils/symptom_tracker.py"
click node_specialist "https://github.com/manishkondoju/health_compass/blob/main/src/utils/specialist_matcher.py"
click node_navigator "https://github.com/manishkondoju/health_compass/blob/main/src/utils/symptom_navigator.py"
click node_profile "https://github.com/manishkondoju/health_compass/blob/main/src/utils/user_profile.py"
click node_medications "https://github.com/manishkondoju/health_compass/blob/main/src/utils/medication_tracker.py"
click node_journal "https://github.com/manishkondoju/health_compass/blob/main/src/utils/health_journal.py"
click node_smartjournal "https://github.com/manishkondoju/health_compass/blob/main/src/utils/smart_journal.py"
click node_healthtools "https://github.com/manishkondoju/health_compass/blob/main/src/utils/health_tools.py"
click node_news "https://github.com/manishkondoju/health_compass/blob/main/src/utils/news_aggregator.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_documents,node_assistant,node_user toneBlue
class node_rag,node_safety,node_vectors,node_llm,node_processor,node_cdc,node_medline toneAmber
class node_symptoms,node_specialist,node_navigator,node_healthtools,node_news toneMint
class node_profile,node_medications,node_journal,node_smartjournal toneRose
class node_sources toneIndigo
```

## Components

### User experience

- [Streamlit app](https://github.com/manishkondoju/health_compass/blob/main/src/app.py): `src/app.py`
- [Medical documents](https://github.com/manishkondoju/health_compass/blob/main/src/utils/document_analyzer_enhanced.py): `src/utils/document_analyzer_enhanced.py`
- [Healthcare assistant](https://github.com/manishkondoju/health_compass/blob/main/src/utils/healthcare_assistant.py): `src/utils/healthcare_assistant.py`

### Health knowledge

- [RAG pipeline](https://github.com/manishkondoju/health_compass/blob/main/src/rag/rag_pipeline.py): `src/rag/rag_pipeline.py`
- [Safety checks](https://github.com/manishkondoju/health_compass/blob/main/src/utils/safety.py): `src/utils/safety.py`
- [Vector search](https://github.com/manishkondoju/health_compass/blob/main/src/rag/vector_db.py): `src/rag/vector_db.py`
- [OpenRouter LLM](https://github.com/manishkondoju/health_compass/blob/main/src/rag/openrouter_client.py): `src/rag/openrouter_client.py`
- [Text processing](https://github.com/manishkondoju/health_compass/blob/main/src/processors/text_processor.py): `src/processors/text_processor.py`
- [CDC scraper](https://github.com/manishkondoju/health_compass/blob/main/src/scrapers/cdc_scraper.py): `src/scrapers/cdc_scraper.py`
- [MedlinePlus scraper](https://github.com/manishkondoju/health_compass/blob/main/src/scrapers/medlineplus_scraper.py): `src/scrapers/medlineplus_scraper.py`

### Personal health guidance

- [Symptom tracker](https://github.com/manishkondoju/health_compass/blob/main/src/utils/symptom_tracker.py): `src/utils/symptom_tracker.py`
- [Specialist matcher](https://github.com/manishkondoju/health_compass/blob/main/src/utils/specialist_matcher.py): `src/utils/specialist_matcher.py`
- [Symptom navigator](https://github.com/manishkondoju/health_compass/blob/main/src/utils/symptom_navigator.py): `src/utils/symptom_navigator.py`
- [Health tools](https://github.com/manishkondoju/health_compass/blob/main/src/utils/health_tools.py): `src/utils/health_tools.py`
- [Health news](https://github.com/manishkondoju/health_compass/blob/main/src/utils/news_aggregator.py): `src/utils/news_aggregator.py`

### Personal health data

- [User profile](https://github.com/manishkondoju/health_compass/blob/main/src/utils/user_profile.py): `src/utils/user_profile.py`
- [Medication tracker](https://github.com/manishkondoju/health_compass/blob/main/src/utils/medication_tracker.py): `src/utils/medication_tracker.py`
- [Health journals](https://github.com/manishkondoju/health_compass/blob/main/src/utils/health_journal.py): `src/utils/health_journal.py`
- [Smart journal](https://github.com/manishkondoju/health_compass/blob/main/src/utils/smart_journal.py): `src/utils/smart_journal.py`

### Other components

- **Health user**
- **Health websites**

## Connections

- Health user → Streamlit app: uses (evidence: `readme.md`)
- Streamlit app → RAG pipeline: submits queries (evidence: `src/app.py`)
- RAG pipeline → Vector search: retrieves context (evidence: `src/rag/rag_pipeline.py`)
- RAG pipeline → OpenRouter LLM: generates answer (evidence: `src/rag/rag_pipeline.py`)
- RAG pipeline → Safety checks: checks safety (evidence: `src/rag/rag_pipeline.py`)
- RAG pipeline → Streamlit app: returns citations (evidence: `readme.md`)
- Health websites → CDC scraper: provides pages (evidence: `src/scrapers/cdc_scraper.py`)
- Health websites → MedlinePlus scraper: provides pages (evidence: `src/scrapers/medlineplus_scraper.py`)
- CDC scraper → Text processing: stores raw pages (evidence: `src/scrapers/cdc_scraper.py`)
- MedlinePlus scraper → Text processing: stores raw pages (evidence: `src/scrapers/medlineplus_scraper.py`)
- Text processing → Vector search: indexes chunks (evidence: `run_pipeline.py`)
- Health user → Medical documents: uploads reports (evidence: `readme.md`)
- Streamlit app → Medical documents: renders analyzer (evidence: `src/app.py`)
- Streamlit app → Healthcare assistant: renders assistant (evidence: `src/app.py`)
- Streamlit app → Symptom tracker: renders tracking (evidence: `src/app.py`)
- Streamlit app → Specialist matcher: renders matching (evidence: `src/app.py`)
- Streamlit app → User profile: manages profile (evidence: `src/app.py`)
- Streamlit app → Symptom navigator: offers guidance (evidence: `readme.md`)
- Streamlit app → Medication tracker: tracks medications (evidence: `readme.md`)
- Streamlit app → Health journals: offers journaling
- Streamlit app → Smart journal: offers smart journal
- Streamlit app → Health tools: offers health tools
- Streamlit app → Health news: offers health news
- Medical documents → RAG pipeline: queries knowledge (evidence: `src/utils/document_analyzer_enhanced.py`)
- Specialist matcher → RAG pipeline: enriches recommendations (evidence: `src/utils/specialist_matcher.py`)
- Healthcare assistant → User profile: personalizes responses
- Healthcare assistant → Medication tracker: checks interactions
