# neeraja2303/ai-powered-weather-agent architecture

> Architecture diagram of the GitHub repository neeraja2303/ai-powered-weather-agent, 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/neeraja2303/ai-powered-weather-agent
- Repository: https://github.com/neeraja2303/ai-powered-weather-agent

## Overview

AgriAid is a Streamlit farm-advisory app: a user enters location and field conditions, then receives a yield estimate, weather details, soil advice, a crop recommendation, and optimization tips. The app directly invokes each advisory module; the crop recommendation is also passed to the tips function. The repository includes model-training code and data/artifact files, but their shown paths do not match the paths used by the code, so their runtime wiring is uncertain. The README describes a weather assistant, while the sampled app implements broader crop and farm advice.

Main entry points: [`app.py`](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/app.py) (Streamlit App), [`weather_agent.py`](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/weather_agent.py) (Weather Lookup), [`optimization_agent.py`](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/optimization_agent.py) (Optimization Tips), [`yield_predictor.py`](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/yield_predictor.py) (Yield Prediction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Farm Advisor Interface"]
  node_app["Streamlit App<br/>[app.py]"]
end

subgraph group_advice["Farm Advice"]
  node_weather["Weather Lookup<br/>[weather_agent.py]"]
  node_soil["Soil Advice"]
  node_crop["Crop Recommendation<br/>[crop_advisor.py]"]
  node_tips["Optimization Tips"]
end

subgraph group_yield["Yield Modeling"]
  node_yield_prediction["Yield Prediction<br/>[yield_predictor.py]"]
  node_trainer["Model Training Script<br/>[train_model.py]"]
  node_training_data["Crop Yield Data"]
  node_model_artifact["Trained Model Artifact<br/>[trained_model.pkl]"]
end

node_farmer(("Farmer"))
node_weather_service["OpenWeatherMap"]

node_farmer -->|"enters conditions"| node_app
node_app -->|"requests estimate"| node_yield_prediction
node_app -->|"requests forecast"| node_weather
node_app -->|"requests advice"| node_soil
node_app -->|"requests crop"| node_crop
node_app -->|"requests tips"| node_tips
node_app -->|"passes crop"| node_tips
node_weather -->|"fetches conditions"| node_weather_service
node_trainer -.->|"saves model"| node_model_artifact
node_training_data -.->|"may train from"| node_yield_prediction

click node_app "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/app.py"
click node_yield_prediction "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/yield_predictor.py"
click node_weather "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/weather_agent.py"
click node_soil "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/soil_health_agent.py"
click node_crop "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/crop_advisor.py"
click node_tips "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/optimization_agent.py"
click node_trainer "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/train_model.py"
click node_training_data "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/crop_yield_data.csv"
click node_model_artifact "https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/trained_model.pkl"

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_weather,node_soil,node_crop,node_tips toneAmber
class node_yield_prediction,node_trainer,node_training_data,node_model_artifact toneMint
class node_farmer,node_weather_service toneIndigo
```

## Components

### Farm Advisor Interface

- [Streamlit App](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/app.py): `app.py`

### Farm Advice

- [Weather Lookup](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/weather_agent.py): `weather_agent.py`
- [Soil Advice](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/soil_health_agent.py): `soil_health_agent.py`
- [Crop Recommendation](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/crop_advisor.py): `crop_advisor.py`
- [Optimization Tips](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/optimization_agent.py): `optimization_agent.py`

### Yield Modeling

- [Yield Prediction](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/yield_predictor.py): `yield_predictor.py`
- [Model Training Script](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/train_model.py): `train_model.py`
- [Crop Yield Data](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/crop_yield_data.csv): `crop_yield_data.csv`
- [Trained Model Artifact](https://github.com/neeraja2303/ai-powered-weather-agent/blob/main/trained_model.pkl): `trained_model.pkl`

### Other components

- **Farmer**
- **OpenWeatherMap**

## Connections

- Farmer → Streamlit App: enters conditions (evidence: `app.py`)
- Streamlit App → Yield Prediction: requests estimate (evidence: `app.py`)
- Streamlit App → Weather Lookup: requests forecast (evidence: `app.py`)
- Streamlit App → Soil Advice: requests advice (evidence: `app.py`)
- Streamlit App → Crop Recommendation: requests crop (evidence: `app.py`)
- Streamlit App → Optimization Tips: requests tips (evidence: `app.py`)
- Streamlit App → Optimization Tips: passes crop (evidence: `app.py`)
- Weather Lookup → OpenWeatherMap: fetches conditions (evidence: `weather_agent.py`)
- Model Training Script → Trained Model Artifact: saves model
- Crop Yield Data → Yield Prediction: may train from
