# arulmani1826/datahub_agent architecture

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

- Interactive diagram: https://gitdiagram.com/arulmani1826/datahub_agent
- Repository: https://github.com/arulmani1826/datahub_agent

## Overview

DataHub Change Guardian is a pre-deployment governance application: users select a dataset and describe a proposed change, the system gathers DataHub evidence, assesses risk, presents findings and recommendations, and records decisions. The main dashboard path is documented in the README and partially visible in app.py; the MCP server’s DataHub queries and impact recommendations are visible in mcp_server.py. The excerpts do not establish every dashboard-to-assessment call, so documented but unsampled links are identified by README evidence.

Main entry points: [`mcp_server.py`](https://github.com/arulmani1826/datahub_agent/blob/main/mcp_server.py) (MCP tool server), [`app.py`](https://github.com/arulmani1826/datahub_agent/blob/main/app.py) (Change workflow), [`agent.py`](https://github.com/arulmani1826/datahub_agent/blob/main/agent.py) (Interactive agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Streamlit dashboard<br/>[app.py]"]
  node_workflow["Change workflow<br/>[app.py]"]
end

subgraph group_assessment["Assessment"]
  node_risk["Risk assessment<br/>[app.py]"]
  node_recommendations["Impact recommendations<br/>[mcp_server.py]"]
  node_ledger[("Decision ledger<br/>[app.py]")]
end

subgraph group_datahub["DataHub access"]
  node_evidence["Dataset evidence<br/>[app.py]"]
  node_mcp["MCP tool server<br/>[mcp_server.py]"]
end

subgraph group_agent["AI agent"]
  node_agent_cli["Interactive agent<br/>[agent.py]"]
end

node_user(("User"))
node_datahub_service["DataHub"]
node_gemini["Gemini"]

node_user -->|"submits change"| node_dashboard_ui
node_dashboard_ui -->|"starts analysis"| node_workflow
node_workflow -->|"requests context"| node_evidence
node_evidence -->|"calls tools"| node_mcp
node_mcp -->|"queries metadata"| node_datahub_service
node_datahub_service -->|"returns evidence"| node_mcp
node_workflow -->|"evaluates change"| node_risk
node_risk -->|"presents findings"| node_dashboard_ui
node_workflow -->|"stores decision"| node_ledger
node_mcp -->|"analyzes impact"| node_recommendations
node_recommendations -->|"uses lineage"| node_mcp
node_user -->|"asks question"| node_agent_cli
node_agent_cli -->|"requests reasoning"| node_gemini
node_agent_cli -->|"calls tools"| node_mcp

click node_dashboard_ui "https://github.com/arulmani1826/datahub_agent/blob/main/app.py"
click node_workflow "https://github.com/arulmani1826/datahub_agent/blob/main/app.py"
click node_evidence "https://github.com/arulmani1826/datahub_agent/blob/main/app.py"
click node_mcp "https://github.com/arulmani1826/datahub_agent/blob/main/mcp_server.py"
click node_risk "https://github.com/arulmani1826/datahub_agent/blob/main/app.py"
click node_recommendations "https://github.com/arulmani1826/datahub_agent/blob/main/mcp_server.py"
click node_ledger "https://github.com/arulmani1826/datahub_agent/blob/main/app.py"
click node_agent_cli "https://github.com/arulmani1826/datahub_agent/blob/main/agent.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_dashboard_ui,node_workflow,node_user toneBlue
class node_risk,node_recommendations,node_ledger toneAmber
class node_evidence,node_mcp toneMint
class node_agent_cli toneRose
class node_datahub_service,node_gemini toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/arulmani1826/datahub_agent/blob/main/app.py): `app.py`
- [Change workflow](https://github.com/arulmani1826/datahub_agent/blob/main/app.py): `app.py`

### Assessment

- [Risk assessment](https://github.com/arulmani1826/datahub_agent/blob/main/app.py): `app.py`
- [Impact recommendations](https://github.com/arulmani1826/datahub_agent/blob/main/mcp_server.py): `mcp_server.py`
- [Decision ledger](https://github.com/arulmani1826/datahub_agent/blob/main/app.py): `app.py`

### DataHub access

- [Dataset evidence](https://github.com/arulmani1826/datahub_agent/blob/main/app.py): `app.py`
- [MCP tool server](https://github.com/arulmani1826/datahub_agent/blob/main/mcp_server.py): `mcp_server.py`

### AI agent

- [Interactive agent](https://github.com/arulmani1826/datahub_agent/blob/main/agent.py): `agent.py`

### Other components

- **User**
- **DataHub**
- **Gemini**

## Connections

- User → Streamlit dashboard: submits change (evidence: `README.md`)
- Streamlit dashboard → Change workflow: starts analysis (evidence: `README.md`)
- Change workflow → Dataset evidence: requests context (evidence: `app.py`)
- Dataset evidence → MCP tool server: calls tools (evidence: `app.py`)
- MCP tool server → DataHub: queries metadata (evidence: `mcp_server.py`)
- DataHub → MCP tool server: returns evidence (evidence: `mcp_server.py`)
- Change workflow → Risk assessment: evaluates change (evidence: `README.md`)
- Risk assessment → Streamlit dashboard: presents findings (evidence: `README.md`)
- Change workflow → Decision ledger: stores decision (evidence: `README.md`)
- MCP tool server → Impact recommendations: analyzes impact (evidence: `mcp_server.py`)
- Impact recommendations → MCP tool server: uses lineage (evidence: `mcp_server.py`)
- User → Interactive agent: asks question (evidence: `agent.py`)
- Interactive agent → Gemini: requests reasoning (evidence: `agent.py`)
- Interactive agent → MCP tool server: calls tools (evidence: `agent.py`)
