# palak-poddar12/satquery architecture

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

- Interactive diagram: https://gitdiagram.com/palak-poddar12/satquery
- Repository: https://github.com/palak-poddar12/satquery

## Overview

SatQuery AI is presented as a natural-language remote-sensing assistant: users submit imagery and a question, an agent selects an analysis task, and the system returns an explanation with confidence and execution details. The tree also contains a separate secure FastAPI service and multilingual/voice wrappers. The sampled backend query endpoint still returns a placeholder and does not call the ML pipeline; README-described RS-LLaVA training/API modules are absent from the tree, so they are not mapped. Some ML task implementations are only partially sampled, so uncertain dispatch links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/palak-poddar12/satquery/blob/main/backend/app/main.py) (FastAPI Service), [`ml/pipeline.py`](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py) (Task Routing), [`models/change_detection.py`](https://github.com/palak-poddar12/satquery/blob/main/models/change_detection.py) (Change Wrapper), [`ml/voice_assistant.py`](https://github.com/palak-poddar12/satquery/blob/main/ml/voice_assistant.py) (Voice I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Secure API"]
  node_api["FastAPI Service<br/>[main.py]"]
  node_auth["API Key And Limits<br/>[security.py]"]
  node_upload["Upload Validation<br/>[uploads.py]"]
  node_audit["Event Logging<br/>[logging_config.py]"]
  node_config["Upload Settings<br/>[config.py]"]
end

subgraph group_agent["Analysis Agent"]
  node_ml_agent["Task Routing<br/>[pipeline.py]"]
  node_ml_image["Image Preparation<br/>[pipeline.py]"]
end

subgraph group_analysis["Image Analysis"]
  node_vqa["Visual Q&amp;A<br/>[pipeline.py]"]
  node_caption["Captioning<br/>[pipeline.py]"]
  node_grounding["Visual Grounding<br/>[pipeline.py]"]
  node_change["Change Detection<br/>[pipeline.py]"]
  node_sar["Optical SAR Fusion<br/>[pipeline.py]"]
  node_model_registry["Model Registry<br/>[pipeline.py]"]
  node_model_base["CLIP Inference<br/>[base_inference.py]"]
  node_model_caption["Caption Wrapper<br/>[captioning.py]"]
  node_model_change["Change Wrapper"]
  node_model_grounding["Grounding Stub<br/>[grounding.py]"]
end

subgraph group_accessibility["Language And Voice"]
  node_multilingual["Language Translation<br/>[multilingual.py]"]
  node_voice["Voice I/O<br/>[voice_assistant.py]"]
end

node_user(("Analyst"))
node_external_speech["Speech Services"]

node_user -->|"submits query or image"| node_api
node_api -->|"verifies and limits"| node_auth
node_api -->|"saves uploaded image"| node_upload
node_upload -->|"reads limits and paths"| node_config
node_api -->|"logs events"| node_audit
node_api -->|"returns placeholder query result"| node_user
node_ml_agent -->|"prepares inputs"| node_ml_image
node_ml_agent -->|"runs low-confidence fallback"| node_caption
node_vqa -->|"loads inference model"| node_model_registry
node_caption -->|"loads caption model"| node_model_registry
node_model_caption -->|"calls inference"| node_model_base
node_model_change -->|"captions both images"| node_model_caption
node_model_change -->|"asks combined question"| node_model_base
node_multilingual -->|"runs translated question"| node_vqa
node_voice -->|"sends transcription"| node_multilingual
node_voice -.->|"transcribes or synthesizes"| node_external_speech

click node_api "https://github.com/palak-poddar12/satquery/blob/main/backend/app/main.py"
click node_auth "https://github.com/palak-poddar12/satquery/blob/main/backend/app/security.py"
click node_upload "https://github.com/palak-poddar12/satquery/blob/main/backend/app/uploads.py"
click node_audit "https://github.com/palak-poddar12/satquery/blob/main/backend/app/logging_config.py"
click node_config "https://github.com/palak-poddar12/satquery/blob/main/backend/app/config.py"
click node_ml_agent "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_ml_image "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_vqa "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_caption "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_grounding "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_change "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_sar "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_model_registry "https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py"
click node_model_base "https://github.com/palak-poddar12/satquery/blob/main/models/base_inference.py"
click node_model_caption "https://github.com/palak-poddar12/satquery/blob/main/models/captioning.py"
click node_model_change "https://github.com/palak-poddar12/satquery/blob/main/models/change_detection.py"
click node_model_grounding "https://github.com/palak-poddar12/satquery/blob/main/models/grounding.py"
click node_multilingual "https://github.com/palak-poddar12/satquery/blob/main/ml/multilingual.py"
click node_voice "https://github.com/palak-poddar12/satquery/blob/main/ml/voice_assistant.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_api,node_auth,node_upload,node_audit,node_config toneBlue
class node_ml_agent,node_ml_image toneAmber
class node_vqa,node_caption,node_grounding,node_change,node_sar,node_model_registry,node_model_base,node_model_caption,node_model_change,node_model_grounding toneMint
class node_multilingual,node_voice toneRose
class node_user,node_external_speech toneIndigo
```

## Components

### Secure API

- [FastAPI Service](https://github.com/palak-poddar12/satquery/blob/main/backend/app/main.py): `backend/app/main.py`
- [API Key And Limits](https://github.com/palak-poddar12/satquery/blob/main/backend/app/security.py): `backend/app/security.py`
- [Upload Validation](https://github.com/palak-poddar12/satquery/blob/main/backend/app/uploads.py): `backend/app/uploads.py`
- [Event Logging](https://github.com/palak-poddar12/satquery/blob/main/backend/app/logging_config.py): `backend/app/logging_config.py`
- [Upload Settings](https://github.com/palak-poddar12/satquery/blob/main/backend/app/config.py): `backend/app/config.py`

### Analysis Agent

- [Task Routing](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [Image Preparation](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`

### Image Analysis

- [Visual Q&A](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [Captioning](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [Visual Grounding](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [Change Detection](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [Optical SAR Fusion](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [Model Registry](https://github.com/palak-poddar12/satquery/blob/main/ml/pipeline.py): `ml/pipeline.py`
- [CLIP Inference](https://github.com/palak-poddar12/satquery/blob/main/models/base_inference.py): `models/base_inference.py`
- [Caption Wrapper](https://github.com/palak-poddar12/satquery/blob/main/models/captioning.py): `models/captioning.py`
- [Change Wrapper](https://github.com/palak-poddar12/satquery/blob/main/models/change_detection.py): `models/change_detection.py`
- [Grounding Stub](https://github.com/palak-poddar12/satquery/blob/main/models/grounding.py): `models/grounding.py`

### Language And Voice

- [Language Translation](https://github.com/palak-poddar12/satquery/blob/main/ml/multilingual.py): `ml/multilingual.py`
- [Voice I/O](https://github.com/palak-poddar12/satquery/blob/main/ml/voice_assistant.py): `ml/voice_assistant.py`

### Other components

- **Analyst**
- **Speech Services**

## Connections

- Analyst → FastAPI Service: submits query or image
- FastAPI Service → API Key And Limits: verifies and limits
- FastAPI Service → Upload Validation: saves uploaded image
- Upload Validation → Upload Settings: reads limits and paths
- FastAPI Service → Event Logging: logs events
- FastAPI Service → Analyst: returns placeholder query result
- Task Routing → Image Preparation: prepares inputs
- Task Routing → Captioning: runs low-confidence fallback
- Visual Q&A → Model Registry: loads inference model
- Captioning → Model Registry: loads caption model
- Caption Wrapper → CLIP Inference: calls inference
- Change Wrapper → Caption Wrapper: captions both images
- Change Wrapper → CLIP Inference: asks combined question
- Language Translation → Visual Q&A: runs translated question
- Voice I/O → Language Translation: sends transcription
- Voice I/O → Speech Services: transcribes or synthesizes
