# mahesh882r/agriculture-ai-assistant architecture

> Architecture diagram of the GitHub repository mahesh882r/agriculture-ai-assistant, 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/mahesh882r/agriculture-ai-assistant
- Repository: https://github.com/mahesh882r/agriculture-ai-assistant

## Overview

This is a Streamlit agricultural advisory app: farmers enter soil and climate data, plant symptoms or images, or fertilizer inputs, then receive crop, disease, or fertilizer guidance. The app is the workflow entry point and invokes the corresponding recommendation module; it also loads shared styling. Disease matching, crop scoring, and nutrient calculations are distinct domain stages within their respective modules. The README documents treatment and prevention guidance and fertilizer application instructions. Source excerpts are partial, so the graph omits uncertain internal calls and does not imply external AI or data-service integrations.

Main entry points: [`app.py`](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/app.py) (Streamlit application), [`disease_prediction.py`](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/disease_prediction.py) (Disease detection), [`crop_prediction.py`](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/crop_prediction.py) (Crop prediction), [`fertilizer_recommendation.py`](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/fertilizer_recommendation.py) (Fertilizer recommendation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Application interface"]
  node_app["Streamlit application<br/>[app.py]"]
end

subgraph group_advisory["Advisory systems"]
  node_crop["Crop prediction<br/>[crop_prediction.py]"]
  node_disease["Disease detection"]
  node_fertilizer["Fertilizer recommendation"]
end

subgraph group_shared["Shared presentation"]
  node_utils["UI styling<br/>[utils.py]"]
end

node_farmer(("Farmer"))

node_farmer -->|"enters inputs"| node_app
node_app -->|"requests crop advice"| node_crop
node_app -->|"requests disease analysis"| node_disease
node_app -->|"looks up disease details"| node_disease
node_app -->|"requests fertilizer advice"| node_fertilizer
node_app -->|"loads styling"| node_utils
node_app -->|"displays guidance"| node_farmer

click node_app "https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/app.py"
click node_crop "https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/crop_prediction.py"
click node_disease "https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/disease_prediction.py"
click node_fertilizer "https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/fertilizer_recommendation.py"
click node_utils "https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/utils.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_app toneBlue
class node_crop,node_disease,node_fertilizer toneAmber
class node_utils toneMint
class node_farmer toneIndigo
```

## Components

### Application interface

- [Streamlit application](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/app.py): `app.py`

### Advisory systems

- [Crop prediction](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/crop_prediction.py): `crop_prediction.py`
- [Disease detection](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/disease_prediction.py): `disease_prediction.py`
- [Fertilizer recommendation](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/fertilizer_recommendation.py): `fertilizer_recommendation.py`

### Shared presentation

- [UI styling](https://github.com/mahesh882r/agriculture-ai-assistant/blob/main/utils.py): `utils.py`

### Other components

- **Farmer**

## Connections

- Farmer → Streamlit application: enters inputs
- Streamlit application → Crop prediction: requests crop advice
- Streamlit application → Disease detection: requests disease analysis
- Streamlit application → Disease detection: looks up disease details
- Streamlit application → Fertilizer recommendation: requests fertilizer advice
- Streamlit application → UI styling: loads styling
- Streamlit application → Farmer: displays guidance
