A GenAI-powered advisory system for Karnataka farmers.
# 🌾 AI Mandi Price Forecaster – Karnataka
A GenAI-powered advisory system for Karnataka farmers.
It ingests historical Mandi price data, runs a 7‑day price forecast, and generates a Kannada sell/hold advisory (with optional voice output).
---
## 🔍 Problem Statement
Farmers in Karnataka often sell produce without knowing upcoming market prices, leading to distress sales.
This project:
- Ingests historical Mandi price data from CSV
- Runs short-term (7‑day) price forecasts (Prophet)
- Generates a plain-language advisory in Kannada
- Highlights the best mandi based on recent prices
Supported demo crops:
- Tomato
- Onion
- Maize
---
## 🧱 Tech Stack
- **Frontend**: Streamlit
- **Data**: pandas, numpy
- **Forecasting**: Prophet
- **Charting**: Plotly
- **Text Advisory**: Groq LLM (Kannada)
- **Language**: Python 3.9+
---
## 🚀 Setup & Run (Local)
### 1. Clone the repository
```bash
git clone
github.com
cd
```
---
### 2. Create and activate a virtual environment (recommended)
```bash
python -m venv .venv
source .venv/bin/activate
```
---
### 3. Install dependencies
```bash
pip install --upgrade pip
pip install -r requirements.txt
```
---
### 4. Configure environment variables
The app uses two API keys:
- `GROQ_API_KEY` – for Kannada advisory text
Set this in your shell:
```bash
export GROQ_API_KEY="your_groq_key_here"
```
---
### 5. Ensure the data file is in place
The main dataset should be:
```bash
data/karnataka_3crops_clean.csv
```
If you are running this from a fresh clone, make sure this file exists and has the expected columns:
- `Arrival_Date`
- `State`
- `District`
- `Market`
- `Commodity`
- `Modal_Price`
---
### 6. Run the Streamlit app
```bash
streamlit run app.py
```
Streamlit will start a local server and show a URL like:
```text
Local URL:
localhost
```
Open that in your browser.
---
## 🌐 Using the Web App
1. **Select Crop** (Tomato, Onion, Maize) from the sidebar.
2. …