# musashi-99/sih architecture

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

- Interactive diagram: https://gitdiagram.com/musashi-99/sih
- Repository: https://github.com/musashi-99/sih

## Overview

SatQuery AI is a web-based satellite-image analysis assistant. A user uploads one image or a pair and asks a natural-language question; the server validates and analyzes the imagery, plans and checks tools for the request, then returns a measured answer with confidence and evidence, optionally rendered as an overlay. The README also describes optical–SAR fusion, audit reports, and reproducible run history. Some app and core source was only sampled, so the graph omits uncertain internal wiring rather than inferring a pipeline for it.

Main entry points: [`app.py`](https://github.com/musashi-99/sih/blob/main/app.py) (Web API), [`static/index.html`](https://github.com/musashi-99/sih/blob/main/static/index.html) (Workspace UI), [`core/ingestion.py`](https://github.com/musashi-99/sih/blob/main/core/ingestion.py) (Image Ingestion), [`core/validation.py`](https://github.com/musashi-99/sih/blob/main/core/validation.py) (Input Validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_ui["Workspace UI<br/>[index.html]"]
  node_api["Web API<br/>[app.py]"]
end

subgraph group_analysis["Image Analysis"]
  node_ingestion["Image Ingestion<br/>[ingestion.py]"]
  node_validation["Input Validation<br/>[validation.py]"]
  node_sensors["Sensor Mapping<br/>[sensors.py]"]
  node_features["Feature Extraction<br/>[features.py]"]
  node_landcover["Land Cover<br/>[landcover.py]"]
  node_objects["Object Detection<br/>[objects.py]"]
  node_change["Change Detection<br/>[change.py]"]
  node_sar["SAR Fusion<br/>[sar.py]"]
end

subgraph group_orchestration["Query Orchestration"]
  node_query["Query Planner and Answerer<br/>[query.py]"]
  node_registry["Tool Registry<br/>[registry.py]"]
  node_render["Overlay Renderer<br/>[render.py]"]
end

subgraph group_audit["Evidence and Audit"]
  node_evidence["Evidence Graph<br/>[evidence.py]"]
  node_report["Audit Reports<br/>[report.py]"]
  node_history[("Run History<br/>[history.py]")]
end

node_user(("Analyst"))

node_user -->|"asks and uploads"| node_ui
node_ui -->|"sends requests"| node_api
node_api -->|"ingests imagery"| node_ingestion
node_api -->|"validates inputs"| node_validation
node_ingestion -->|"resolves bands"| node_sensors
node_api -->|"extracts features"| node_features
node_api -->|"segments scene"| node_landcover
node_api -->|"detects objects"| node_objects
node_api -->|"compares scenes"| node_change
node_api -.->|"processes SAR"| node_sar
node_api -->|"plans and answers"| node_query
node_api -->|"checks tools"| node_registry
node_api -->|"renders overlays"| node_render
node_api -->|"records evidence"| node_evidence
node_api -->|"generates reports"| node_report
node_api -->|"records runs"| node_history
node_api -->|"returns answers"| node_ui

click node_ui "https://github.com/musashi-99/sih/blob/main/static/index.html"
click node_api "https://github.com/musashi-99/sih/blob/main/app.py"
click node_ingestion "https://github.com/musashi-99/sih/blob/main/core/ingestion.py"
click node_validation "https://github.com/musashi-99/sih/blob/main/core/validation.py"
click node_sensors "https://github.com/musashi-99/sih/blob/main/core/sensors.py"
click node_features "https://github.com/musashi-99/sih/blob/main/core/features.py"
click node_landcover "https://github.com/musashi-99/sih/blob/main/core/landcover.py"
click node_objects "https://github.com/musashi-99/sih/blob/main/core/objects.py"
click node_change "https://github.com/musashi-99/sih/blob/main/core/change.py"
click node_sar "https://github.com/musashi-99/sih/blob/main/core/sar.py"
click node_query "https://github.com/musashi-99/sih/blob/main/core/query.py"
click node_registry "https://github.com/musashi-99/sih/blob/main/core/registry.py"
click node_render "https://github.com/musashi-99/sih/blob/main/core/render.py"
click node_evidence "https://github.com/musashi-99/sih/blob/main/core/evidence.py"
click node_report "https://github.com/musashi-99/sih/blob/main/core/report.py"
click node_history "https://github.com/musashi-99/sih/blob/main/core/history.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_ui,node_api toneBlue
class node_ingestion,node_validation,node_sensors,node_features,node_landcover,node_objects,node_change,node_sar toneAmber
class node_query,node_registry,node_render toneMint
class node_evidence,node_report,node_history toneRose
class node_user toneIndigo
```

## Components

### User Interface

- [Workspace UI](https://github.com/musashi-99/sih/blob/main/static/index.html): `static/index.html`
- [Web API](https://github.com/musashi-99/sih/blob/main/app.py): `app.py`

### Image Analysis

- [Image Ingestion](https://github.com/musashi-99/sih/blob/main/core/ingestion.py): `core/ingestion.py`
- [Input Validation](https://github.com/musashi-99/sih/blob/main/core/validation.py): `core/validation.py`
- [Sensor Mapping](https://github.com/musashi-99/sih/blob/main/core/sensors.py): `core/sensors.py`
- [Feature Extraction](https://github.com/musashi-99/sih/blob/main/core/features.py): `core/features.py`
- [Land Cover](https://github.com/musashi-99/sih/blob/main/core/landcover.py): `core/landcover.py`
- [Object Detection](https://github.com/musashi-99/sih/blob/main/core/objects.py): `core/objects.py`
- [Change Detection](https://github.com/musashi-99/sih/blob/main/core/change.py): `core/change.py`
- [SAR Fusion](https://github.com/musashi-99/sih/blob/main/core/sar.py): `core/sar.py`

### Query Orchestration

- [Query Planner and Answerer](https://github.com/musashi-99/sih/blob/main/core/query.py): `core/query.py`
- [Tool Registry](https://github.com/musashi-99/sih/blob/main/core/registry.py): `core/registry.py`
- [Overlay Renderer](https://github.com/musashi-99/sih/blob/main/core/render.py): `core/render.py`

### Evidence and Audit

- [Evidence Graph](https://github.com/musashi-99/sih/blob/main/core/evidence.py): `core/evidence.py`
- [Audit Reports](https://github.com/musashi-99/sih/blob/main/core/report.py): `core/report.py`
- [Run History](https://github.com/musashi-99/sih/blob/main/core/history.py): `core/history.py`

### Other components

- **Analyst**

## Connections

- Analyst → Workspace UI: asks and uploads
- Workspace UI → Web API: sends requests
- Web API → Image Ingestion: ingests imagery
- Web API → Input Validation: validates inputs
- Image Ingestion → Sensor Mapping: resolves bands
- Web API → Feature Extraction: extracts features
- Web API → Land Cover: segments scene
- Web API → Object Detection: detects objects
- Web API → Change Detection: compares scenes
- Web API → SAR Fusion: processes SAR
- Web API → Query Planner and Answerer: plans and answers
- Web API → Tool Registry: checks tools
- Web API → Overlay Renderer: renders overlays
- Web API → Evidence Graph: records evidence
- Web API → Audit Reports: generates reports
- Web API → Run History: records runs
- Web API → Workspace UI: returns answers
