# shyamsanjayg/agrivision-smart-farming architecture

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

- Interactive diagram: https://gitdiagram.com/shyamsanjayg/agrivision-smart-farming
- Repository: https://github.com/shyamsanjayg/agrivision-smart-farming

## Overview

This is a Streamlit smart-agriculture consultant. A user can chat for agriculture-focused advice, optionally informed by live farm weather, or upload GeoJSON to inspect a mapped, zoned plot. The excerpts show the app entry point, weather HTTP lookup, chat prompt enrichment, GeoJSON parsing, and map rendering in one file. Other implementation details are omitted because the source is only partially sampled; the graph keeps the distinct capabilities without assuming unseen internal calls.

Main entry points: [`chatbot.py`](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py) (Streamlit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Agriculture app"]
  node_streamlit["Streamlit interface<br/>[chatbot.py]"]
  node_chat["Agri-Guru chat<br/>[chatbot.py]"]
  node_weather["Weather lookup<br/>[chatbot.py]"]
  node_plot["GeoJSON plot analysis<br/>[chatbot.py]"]
  node_zones["Plot zoning<br/>[chatbot.py]"]
  node_map["Interactive farm map<br/>[chatbot.py]"]
end

subgraph group_integrations["External services"]
  node_groq{{"Groq LLM"}}
  node_agro{{"AgroMonitoring API"}}
end

node_farmer(("Farmer"))

node_farmer -->|"uses"| node_streamlit
node_streamlit -->|"routes chat"| node_chat
node_chat -->|"requests advice"| node_groq
node_streamlit -->|"fetches weather"| node_weather
node_weather -->|"requests conditions"| node_agro
node_streamlit -->|"parses upload"| node_plot
node_plot -->|"splits polygon"| node_zones
node_streamlit -->|"renders zones"| node_map
node_weather -->|"enriches prompt"| node_chat
node_zones -->|"maps zones"| node_map

click node_streamlit "https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py"
click node_chat "https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py"
click node_weather "https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py"
click node_plot "https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py"
click node_zones "https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py"
click node_map "https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.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_streamlit,node_chat,node_weather,node_plot,node_zones,node_map toneBlue
class node_groq,node_agro toneAmber
class node_farmer toneIndigo
```

## Components

### Agriculture app

- [Streamlit interface](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py): `chatbot.py`
- [Agri-Guru chat](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py): `chatbot.py`
- [Weather lookup](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py): `chatbot.py`
- [GeoJSON plot analysis](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py): `chatbot.py`
- [Plot zoning](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py): `chatbot.py`
- [Interactive farm map](https://github.com/shyamsanjayg/agrivision-smart-farming/blob/main/chatbot.py): `chatbot.py`

### External services

- **Groq LLM**
- **AgroMonitoring API**

### Other components

- **Farmer**

## Connections

- Farmer → Streamlit interface: uses (evidence: `README.md`)
- Streamlit interface → Agri-Guru chat: routes chat (evidence: `chatbot.py`)
- Agri-Guru chat → Groq LLM: requests advice (evidence: `chatbot.py`)
- Streamlit interface → Weather lookup: fetches weather (evidence: `chatbot.py`)
- Weather lookup → AgroMonitoring API: requests conditions (evidence: `chatbot.py`)
- Streamlit interface → GeoJSON plot analysis: parses upload (evidence: `chatbot.py`)
- GeoJSON plot analysis → Plot zoning: splits polygon (evidence: `chatbot.py`)
- Streamlit interface → Interactive farm map: renders zones (evidence: `chatbot.py`)
- Weather lookup → Agri-Guru chat: enriches prompt (evidence: `chatbot.py`)
- Plot zoning → Interactive farm map: maps zones (evidence: `chatbot.py`)
