# lucas34174/predicare architecture

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

- Interactive diagram: https://gitdiagram.com/lucas34174/predicare
- Repository: https://github.com/lucas34174/predicare

## Overview

PrediCare TPA is a scaffold for health-insurance fraud detection, contract-question answering with RAG, and decision support. The only demonstrated runtime workflow is a caller reaching the FastAPI health endpoint and receiving its status response. The README documents ML, RAG, PostgreSQL/pgvector, and n8n capabilities, but their implementation is not present in the supplied tree; they are shown as documented subsystems without speculative connections. The web interface is also only a placeholder.

Main entry points: [`src/predicare/api/main.py`](https://github.com/lucas34174/predicare/blob/main/src/predicare/api/main.py) (Health endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_health_api["Health endpoint<br/>[main.py]"]
end

subgraph group_fraud["Fraud detection"]
  node_fraud_pipeline["Fraud pipeline"]
end

subgraph group_contracts["Contract assistant"]
  node_rag_assistant["RAG assistant"]
  node_contract_index["Contract indexing"]
end

subgraph group_platform["Data and orchestration"]
  node_db_access["Database access"]
  node_core_services["Core services"]
  node_bi_workflows["BI workflows"]
  node_web_ui["Web interface"]
end

node_caller(("API caller"))

node_caller -->|"requests health"| node_health_api
node_health_api -->|"returns status"| node_caller

click node_health_api "https://github.com/lucas34174/predicare/blob/main/src/predicare/api/main.py"
click node_fraud_pipeline "https://github.com/lucas34174/predicare/tree/main/src/predicare/ml"
click node_rag_assistant "https://github.com/lucas34174/predicare/tree/main/src/predicare/rag"
click node_contract_index "https://github.com/lucas34174/predicare/tree/main/src/predicare/rag"
click node_db_access "https://github.com/lucas34174/predicare/tree/main/src/predicare/db"
click node_core_services "https://github.com/lucas34174/predicare/tree/main/src/predicare/core"
click node_bi_workflows "https://github.com/lucas34174/predicare/tree/main/infra/n8n"
click node_web_ui "https://github.com/lucas34174/predicare/tree/main/web"

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_health_api toneBlue
class node_fraud_pipeline toneAmber
class node_rag_assistant,node_contract_index,node_caller toneMint
class node_db_access,node_core_services,node_bi_workflows,node_web_ui toneRose
```

## Components

### API

- [Health endpoint](https://github.com/lucas34174/predicare/blob/main/src/predicare/api/main.py): `src/predicare/api/main.py`

### Fraud detection

- [Fraud pipeline](https://github.com/lucas34174/predicare/tree/main/src/predicare/ml): `src/predicare/ml`

### Contract assistant

- [RAG assistant](https://github.com/lucas34174/predicare/tree/main/src/predicare/rag): `src/predicare/rag`
- [Contract indexing](https://github.com/lucas34174/predicare/tree/main/src/predicare/rag): `src/predicare/rag`

### Data and orchestration

- [Database access](https://github.com/lucas34174/predicare/tree/main/src/predicare/db): `src/predicare/db`
- [Core services](https://github.com/lucas34174/predicare/tree/main/src/predicare/core): `src/predicare/core`
- [BI workflows](https://github.com/lucas34174/predicare/tree/main/infra/n8n): `infra/n8n`
- [Web interface](https://github.com/lucas34174/predicare/tree/main/web): `web`

### Other components

- **API caller**

## Connections

- API caller → Health endpoint: requests health (evidence: `README.md`)
- Health endpoint → API caller: returns status (evidence: `src/predicare/api/main.py`)
