# ghanashyam06/vyom_agentic_gis_nepal_updated architecture

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

- Interactive diagram: https://gitdiagram.com/ghanashyam06/vyom_agentic_gis_nepal_updated
- Repository: https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated

## Overview

VYOM is an agentic GIS application for disaster analysis of Indian satellite imagery. Users ask questions in the QGIS plugin; its client sends them to the API, which invokes the safety-conscious agent to check coverage and select catalog or raster tools. Results return as text, charts, and map layers, with optional PDF reporting. Separate ingestion paths prepare optical and SAR scenes for searchable PostGIS metadata and on-disk raster assets. The graph follows the README and shown imports/calls; links for unsampled API/plugin details are limited to documented behavior.

Main entry points: [`src/vyom/ard/pipeline.py`](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/pipeline.py) (Optical ARD pipeline), [`src/vyom/ard/sar_pipeline.py`](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/sar_pipeline.py) (SAR ARD pipeline), [`src/vyom/plugin/vyom_dockwidget.py`](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/plugin/vyom_dockwidget.py) (Chat and map panel), [`src/vyom/api/app.py`](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/app.py) (REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["QGIS experience"]
  node_dock["Chat and map panel<br/>[vyom_dockwidget.py]"]
  node_client_api["HTTP client<br/>[api_client.py]"]
end

subgraph group_service["API service"]
  node_api["REST API<br/>[app.py]"]
  node_models["Request and response models<br/>[models.py]"]
  node_charts["Chart generation<br/>[charts.py]"]
end

subgraph group_reasoning["Agent reasoning"]
  node_agent["Agent orchestrator<br/>[orchestrator.py]"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
  node_llm["LLM backends<br/>[llm.py]"]
  node_tools["Tool registry<br/>[tools.py]"]
end

subgraph group_analysis["GIS analysis"]
  node_catalog[("Scene and metric catalog<br/>[postgis_server.py]")]
  node_raster["Raster analysis<br/>[gis_server.py]"]
  node_sar_tools["SAR analysis tools<br/>[sar_gis_tools.py]"]
end

subgraph group_ingest["Data preparation"]
  node_config["Shared configuration<br/>[config.py]"]
  node_optical["Optical ARD pipeline<br/>[pipeline.py]"]
  node_calibrate["Optical calibration<br/>[calibrate.py]"]
  node_indices["Spectral indices<br/>[indices.py]"]
  node_cog["COG writer<br/>[cog.py]"]
  node_band_meta["Optical metadata<br/>[band_meta.py]"]
  node_sar_pipeline["SAR ARD pipeline<br/>[sar_pipeline.py]"]
  node_sar_meta["SAR metadata<br/>[sar_meta.py]"]
  node_writer["Scene and metric writer<br/>[writer.py]"]
end

node_user(("Analyst"))
node_qgis["QGIS"]
node_database[("PostgreSQL and PostGIS")]

node_user -->|"asks question"| node_dock
node_dock -->|"sends requests"| node_client_api
node_client_api -->|"calls REST API"| node_api
node_api -->|"runs query"| node_agent
node_api -->|"validates payloads"| node_models
node_api -->|"builds charts"| node_charts
node_agent -->|"uses prompts"| node_prompts
node_agent -->|"invokes model"| node_llm
node_agent -->|"dispatches tools"| node_tools
node_tools -->|"calls catalog tools"| node_catalog
node_tools -->|"calls raster tools"| node_raster
node_tools -->|"calls SAR tools"| node_sar_tools
node_catalog -->|"queries metadata"| node_database
node_writer -->|"registers scenes"| node_database
node_dock -->|"renders layers"| node_qgis
node_dock -->|"exports PDF report"| node_qgis
node_optical -->|"reads metadata"| node_band_meta
node_optical -->|"calibrates bands"| node_calibrate
node_optical -->|"computes indices"| node_indices
node_optical -->|"writes rasters"| node_cog
node_optical -->|"registers results"| node_writer
node_sar_pipeline -->|"reads metadata"| node_sar_meta
node_sar_pipeline -->|"writes rasters"| node_cog
node_sar_pipeline -->|"caches metrics"| node_writer
node_optical -->|"loads settings"| node_config
node_sar_pipeline -->|"loads settings"| node_config

click node_dock "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/plugin/vyom_dockwidget.py"
click node_client_api "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/plugin/api_client.py"
click node_api "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/app.py"
click node_models "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/models.py"
click node_charts "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/charts.py"
click node_agent "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/orchestrator.py"
click node_prompts "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/prompts.py"
click node_llm "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/llm.py"
click node_tools "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/tools.py"
click node_catalog "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/postgis_server.py"
click node_raster "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/gis_server.py"
click node_sar_tools "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/sar_gis_tools.py"
click node_config "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/config.py"
click node_optical "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/pipeline.py"
click node_calibrate "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/calibrate.py"
click node_indices "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/indices.py"
click node_cog "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/cog.py"
click node_band_meta "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ingest/band_meta.py"
click node_sar_pipeline "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/sar_pipeline.py"
click node_sar_meta "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ingest/sar_meta.py"
click node_writer "https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/writer.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_dock,node_client_api toneBlue
class node_api,node_models,node_charts,node_database toneAmber
class node_agent,node_prompts,node_llm,node_tools toneMint
class node_catalog,node_raster,node_sar_tools toneRose
class node_config,node_optical,node_calibrate,node_indices,node_cog,node_band_meta,node_sar_pipeline,node_sar_meta,node_writer,node_user,node_qgis toneIndigo
```

## Components

### QGIS experience

- [Chat and map panel](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/plugin/vyom_dockwidget.py): `src/vyom/plugin/vyom_dockwidget.py`
- [HTTP client](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/plugin/api_client.py): `src/vyom/plugin/api_client.py`

### API service

- [REST API](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/app.py): `src/vyom/api/app.py`
- [Request and response models](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/models.py): `src/vyom/api/models.py`
- [Chart generation](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/api/charts.py): `src/vyom/api/charts.py`

### Agent reasoning

- [Agent orchestrator](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/orchestrator.py): `src/vyom/agent/orchestrator.py`
- [Agent prompts](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/prompts.py): `src/vyom/agent/prompts.py`
- [LLM backends](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/llm.py): `src/vyom/agent/llm.py`
- [Tool registry](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/agent/tools.py): `src/vyom/agent/tools.py`

### GIS analysis

- [Scene and metric catalog](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/postgis_server.py): `src/vyom/db/postgis_server.py`
- [Raster analysis](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/gis_server.py): `src/vyom/db/gis_server.py`
- [SAR analysis tools](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/sar_gis_tools.py): `src/vyom/db/sar_gis_tools.py`

### Data preparation

- [Shared configuration](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/config.py): `src/vyom/config.py`
- [Optical ARD pipeline](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/pipeline.py): `src/vyom/ard/pipeline.py`
- [Optical calibration](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/calibrate.py): `src/vyom/ard/calibrate.py`
- [Spectral indices](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/indices.py): `src/vyom/ard/indices.py`
- [COG writer](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/cog.py): `src/vyom/ard/cog.py`
- [Optical metadata](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ingest/band_meta.py): `src/vyom/ingest/band_meta.py`
- [SAR ARD pipeline](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ard/sar_pipeline.py): `src/vyom/ard/sar_pipeline.py`
- [SAR metadata](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/ingest/sar_meta.py): `src/vyom/ingest/sar_meta.py`
- [Scene and metric writer](https://github.com/ghanashyam06/vyom_agentic_gis_nepal_updated/blob/main/src/vyom/db/writer.py): `src/vyom/db/writer.py`

### Other components

- **Analyst**
- **QGIS**
- **PostgreSQL and PostGIS**

## Connections

- Analyst → Chat and map panel: asks question
- Chat and map panel → HTTP client: sends requests (evidence: `src/vyom/plugin/vyom_dockwidget.py`)
- HTTP client → REST API: calls REST API
- REST API → Agent orchestrator: runs query (evidence: `src/vyom/api/app.py`)
- REST API → Request and response models: validates payloads (evidence: `src/vyom/api/app.py`)
- REST API → Chart generation: builds charts (evidence: `src/vyom/api/app.py`)
- Agent orchestrator → Agent prompts: uses prompts (evidence: `src/vyom/agent/orchestrator.py`)
- Agent orchestrator → LLM backends: invokes model (evidence: `src/vyom/agent/orchestrator.py`)
- Agent orchestrator → Tool registry: dispatches tools (evidence: `src/vyom/agent/orchestrator.py`)
- Tool registry → Scene and metric catalog: calls catalog tools (evidence: `src/vyom/agent/tools.py`)
- Tool registry → Raster analysis: calls raster tools (evidence: `src/vyom/agent/tools.py`)
- Tool registry → SAR analysis tools: calls SAR tools (evidence: `src/vyom/agent/tools.py`)
- Scene and metric catalog → PostgreSQL and PostGIS: queries metadata
- Scene and metric writer → PostgreSQL and PostGIS: registers scenes
- Chat and map panel → QGIS: renders layers
- Chat and map panel → QGIS: exports PDF report
- Optical ARD pipeline → Optical metadata: reads metadata (evidence: `src/vyom/ard/pipeline.py`)
- Optical ARD pipeline → Optical calibration: calibrates bands (evidence: `src/vyom/ard/pipeline.py`)
- Optical ARD pipeline → Spectral indices: computes indices (evidence: `src/vyom/ard/pipeline.py`)
- Optical ARD pipeline → COG writer: writes rasters (evidence: `src/vyom/ard/pipeline.py`)
- Optical ARD pipeline → Scene and metric writer: registers results (evidence: `src/vyom/ard/pipeline.py`)
- SAR ARD pipeline → SAR metadata: reads metadata (evidence: `src/vyom/ard/sar_pipeline.py`)
- SAR ARD pipeline → COG writer: writes rasters (evidence: `src/vyom/ard/sar_pipeline.py`)
- SAR ARD pipeline → Scene and metric writer: caches metrics (evidence: `src/vyom/ard/sar_pipeline.py`)
- Optical ARD pipeline → Shared configuration: loads settings (evidence: `src/vyom/ard/pipeline.py`)
- SAR ARD pipeline → Shared configuration: loads settings (evidence: `src/vyom/ard/sar_pipeline.py`)
