# deveshvonteddu/agent-tara architecture

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

- Interactive diagram: https://gitdiagram.com/deveshvonteddu/agent-tara
- Repository: https://github.com/deveshvonteddu/agent-tara

## Overview

TARA is an OT cybersecurity platform for water and electricity infrastructure. Operators sign in, register assets, ingest vulnerability and telemetry data, run assessments, review risk, and manage mitigation; the web client calls a FastAPI backend that persists platform records. Separate capabilities include AI assistance, ML analytics, reporting, access policy, and a standalone simulation lab. The graph preserves these documented branches, but several API and service internals were not excerpted, so those relationships are shown only where the README or source index supports them.

Main entry points: [`backend/app/main.py`](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/main.py) (API application), [`frontend/src/App.tsx`](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/App.tsx) (Web routes), [`frontend/src/services/api.ts`](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/services/api.ts) (API client), [`backend/app/models/models.py`](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/models/models.py) (Domain records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web routes<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_assets_ui["Asset inventory<br/>[AssetsPage.tsx]"]
  node_overview_ui["Operations overview<br/>[OverviewPage.tsx]"]
  node_water_ui["Water telemetry UI<br/>[WaterPage.tsx]"]
  node_electricity_ui["Electricity UI"]
  node_sim_ui["Simulation UI"]
end

subgraph group_backend["Platform backend"]
  node_api_server["API application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_database[("Platform database<br/>[session.py]")]
  node_records["Domain records<br/>[models.py]"]
end

subgraph group_intel["Threat intelligence"]
  node_cisa["CISA KEV sync<br/>[cisa_client.py]"]
  node_nvd["NVD intelligence<br/>[nvd_client.py]"]
end

subgraph group_operations["OT monitoring"]
  node_water["Water services<br/>[water_service.py]"]
  node_electricity["Electricity analysis"]
  node_simlab["Sandbox simulator<br/>[main.py]"]
end

subgraph group_assurance["Assurance and analysis"]
  node_assessment["Rule assessment<br/>[engine.py]"]
  node_risk["Risk scoring<br/>[risk_engine.py]"]
  node_audit["Audit hash chain<br/>[audit_service.py]"]
  node_assistant["AI assistant<br/>[ai_assistant.py]"]
  node_ml["ML analytics<br/>[inference.py]"]
end

node_operator(("Operator"))
node_external(("External feeds"))

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_assets_ui
node_app -->|"routes to"| node_overview_ui
node_app -->|"routes to"| node_water_ui
node_app -->|"routes to"| node_electricity_ui
node_app -->|"routes to"| node_sim_ui
node_assets_ui -->|"requests data"| node_api_client
node_overview_ui -->|"requests data"| node_api_client
node_water_ui -->|"requests data"| node_api_client
node_electricity_ui -->|"requests data"| node_api_client
node_sim_ui -->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_api_server
node_api_server -->|"registers routes"| node_auth
node_api_server -->|"initializes"| node_database
node_auth -->|"queries"| node_database
node_auth -->|"reads users"| node_records
node_api_server -->|"records startup event"| node_audit
node_audit -->|"stores audit events"| node_records
node_assessment -->|"reads and writes"| node_records
node_assessment -->|"uses scoring"| node_risk
node_assessment -->|"uses inference"| node_ml
node_cisa -->|"fetches catalog"| node_external
node_nvd -.->|"queries CVEs"| node_external
node_water -->|"stores readings"| node_records
node_electricity -->|"stores analysis"| node_records
node_sim_ui -.->|"uses simulator"| node_simlab
node_api_server -->|"exposes assistant"| node_assistant
node_api_server -->|"exposes synchronization"| node_cisa
node_api_server -->|"exposes intelligence"| node_nvd
node_api_server -->|"exposes telemetry"| node_water
node_api_server -->|"exposes datasets"| node_electricity

click node_app "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/services/api.ts"
click node_assets_ui "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/AssetsPage.tsx"
click node_overview_ui "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/OverviewPage.tsx"
click node_water_ui "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/WaterPage.tsx"
click node_electricity_ui "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/ElectricityPage.tsx"
click node_sim_ui "https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/SimulationsPage.tsx"
click node_api_server "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/main.py"
click node_auth "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/api/auth.py"
click node_database "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/database/session.py"
click node_records "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/models/models.py"
click node_assessment "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/assessment/engine.py"
click node_risk "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/risk_engine.py"
click node_audit "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/audit_service.py"
click node_assistant "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/ai_assistant.py"
click node_ml "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/ml/inference.py"
click node_cisa "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/integrations/cisa_client.py"
click node_nvd "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/integrations/nvd_client.py"
click node_water "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/water_service.py"
click node_electricity "https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/electricity_service.py"
click node_simlab "https://github.com/deveshvonteddu/agent-tara/blob/main/simulation-lab/app/main.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_api_client,node_assets_ui,node_overview_ui,node_water_ui,node_electricity_ui,node_sim_ui toneBlue
class node_api_server,node_auth,node_database,node_records toneAmber
class node_cisa,node_nvd toneMint
class node_water,node_electricity,node_simlab toneRose
class node_assessment,node_risk,node_audit,node_assistant,node_ml,node_operator,node_external toneIndigo
```

## Components

### Web application

- [Web routes](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Asset inventory](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/AssetsPage.tsx): `frontend/src/pages/AssetsPage.tsx`
- [Operations overview](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/OverviewPage.tsx): `frontend/src/pages/OverviewPage.tsx`
- [Water telemetry UI](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/WaterPage.tsx): `frontend/src/pages/WaterPage.tsx`
- [Electricity UI](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/ElectricityPage.tsx): `frontend/src/pages/ElectricityPage.tsx`
- [Simulation UI](https://github.com/deveshvonteddu/agent-tara/blob/main/frontend/src/pages/SimulationsPage.tsx): `frontend/src/pages/SimulationsPage.tsx`

### Platform backend

- [API application](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Platform database](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/database/session.py): `backend/app/database/session.py`
- [Domain records](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/models/models.py): `backend/app/models/models.py`

### Threat intelligence

- [CISA KEV sync](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/integrations/cisa_client.py): `backend/app/integrations/cisa_client.py`
- [NVD intelligence](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/integrations/nvd_client.py): `backend/app/integrations/nvd_client.py`

### OT monitoring

- [Water services](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/water_service.py): `backend/app/services/water_service.py`
- [Electricity analysis](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/electricity_service.py): `backend/app/services/electricity_service.py`
- [Sandbox simulator](https://github.com/deveshvonteddu/agent-tara/blob/main/simulation-lab/app/main.py): `simulation-lab/app/main.py`

### Assurance and analysis

- [Rule assessment](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/assessment/engine.py): `backend/app/assessment/engine.py`
- [Risk scoring](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/risk_engine.py): `backend/app/services/risk_engine.py`
- [Audit hash chain](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/audit_service.py): `backend/app/services/audit_service.py`
- [AI assistant](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/services/ai_assistant.py): `backend/app/services/ai_assistant.py`
- [ML analytics](https://github.com/deveshvonteddu/agent-tara/blob/main/backend/app/ml/inference.py): `backend/app/ml/inference.py`

### Other components

- **Operator**
- **External feeds**

## Connections

- Operator → Web routes: uses
- Web routes → Asset inventory: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Operations overview: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Water telemetry UI: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Electricity UI: routes to (evidence: `frontend/src/App.tsx`)
- Web routes → Simulation UI: routes to (evidence: `frontend/src/App.tsx`)
- Asset inventory → API client: requests data (evidence: `frontend/src/pages/AssetsPage.tsx`)
- Operations overview → API client: requests data (evidence: `frontend/src/pages/OverviewPage.tsx`)
- Water telemetry UI → API client: requests data (evidence: `frontend/src/pages/WaterPage.tsx`)
- Electricity UI → API client: requests data (evidence: `frontend/src/pages/ElectricityPage.tsx`)
- Simulation UI → API client: requests data (evidence: `frontend/src/pages/SimulationsPage.tsx`)
- API client → API application: calls API
- API application → Authentication: registers routes (evidence: `backend/app/main.py`)
- API application → Platform database: initializes (evidence: `backend/app/main.py`)
- Authentication → Platform database: queries (evidence: `backend/app/api/auth.py`)
- Authentication → Domain records: reads users (evidence: `backend/app/api/auth.py`)
- API application → Audit hash chain: records startup event (evidence: `backend/app/main.py`)
- Audit hash chain → Domain records: stores audit events (evidence: `backend/app/services/audit_service.py`)
- Rule assessment → Domain records: reads and writes (evidence: `backend/app/assessment/engine.py`)
- Rule assessment → Risk scoring: uses scoring (evidence: `backend/app/assessment/engine.py`)
- Rule assessment → ML analytics: uses inference (evidence: `backend/app/assessment/engine.py`)
- CISA KEV sync → External feeds: fetches catalog (evidence: `backend/app/integrations/cisa_client.py`)
- NVD intelligence → External feeds: queries CVEs
- Water services → Domain records: stores readings (evidence: `backend/app/services/water_service.py`)
- Electricity analysis → Domain records: stores analysis (evidence: `backend/app/services/electricity_service.py`)
- Simulation UI → Sandbox simulator: uses simulator
- API application → AI assistant: exposes assistant
- API application → CISA KEV sync: exposes synchronization
- API application → NVD intelligence: exposes intelligence
- API application → Water services: exposes telemetry
- API application → Electricity analysis: exposes datasets
