“Helping farmers make smarter selling decisions with AI.”
Forecast crop prices, compare markets, estimate revenue, and make data-driven decisions — explained in plain language, in English · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം, by touch or by voice. Then sell to real buyers through the built-in farmer marketplace.
Most Indian farmers decide when and where to sell with yesterday's mandi gossip. Prices for perishables swing 20–40 % within weeks; selling into a trough or hauling to the wrong market erases a season's margin.
No guaranteed-income claims: forecasts are estimates and the bundled data is synthetic.
Everything below was produced by the running app's own API (captured , demo dataset). Pick a case; change the quantity to see revenue scale. This is the same data the live dashboard shows.
Quantity (kg): · revenue scales with quantity; holding cost includes crop-specific spoilage
| Horizon | Estimate | 80 % range | Change | Advice | Net revenue |
|---|
| Model | MAE | RMSE | MAPE | R² | Skill | Dir. acc. |
|---|
| Market | Today | 7-day est. | Change | Confidence | Advice | Net today | Net in 7 d |
|---|
Net = expected revenue − transport − storage − spoilage. Transport costs are per market and editable in the app; here they are 0, so ranking follows price × quantity after holding losses.
A complete decision-support flow: crop → location → market → quantity → period → forecast → dashboard → compare → decide → sell.
7 / 14 / 30-day estimates with an 80 % prediction interval, trend direction and a High / Medium / Low confidence label — never presented as a guarantee.
Rules over current price, estimate, trend, volatility, uncertainty, quantity, shelf life and storage cost. Every verdict comes with reasons and caveats.
Expected revenue − transport − storage − spoilage per market, so the best price is also the best profit.
Gross → spoilage → transport → storage → other costs → net; break-even price; waterfall chart.
Rule-based assistant grounded in the same prediction numbers: "Should I sell my tomatoes today?", "What if price falls 10 %?", "Which market pays most?"
Speak in English, Tamil, Telugu, Kannada or Malayalam: the app runs predictions, compares markets, opens pages, switches language, pre-fills a listing — and reads the answer aloud.
Whole UI, recommendation and explanation texts, advisor and voice. One type-checked dictionary per language.
List produce at an AI-suggested asking price, buyers call / WhatsApp / send interest; owner view with inquiries; admin moderation. No payments handled.
Recent % change, seasonal pattern, arrivals, similar historical periods, model confidence, top model drivers.
Upload CSV / Excel / JSON, column auto-mapping, cleaning report, data-quality view, retrain, model registry, prediction history. Agmarknet-compatible.
Input validation, upload sanitising, token-protected admin, secrets via env vars, synthetic data labelled on every screen.
One-click examples (Tomato, Onion, Potato, Rice, Wheat) that render instantly — no API keys needed.
Many farmers prefer to ask. The floating mic understands spoken commands in five languages and operates the app — then reads the grounded answer aloud.
POST /api/voice/command parses intent + entities (crop, market, quantity, horizon, language) and returns a structured action: predict · compare · navigate · set_language · sell_online · chat · stop · repeat.Whole UI, recommendation and “why” texts, advisor and voice. One type-checked dictionary file per language — the compiler rejects a missing key. Numbers and dates use the matching Indian locale.
The forecast tells the farmer when to sell; the marketplace helps with to whom. Currently 8 active sample listings · 17,850 kg.
Pre-filled from today's mandi modal price and the 7-day estimate, with the range, trend and confidence shown — a starting point, not advice.
Call, WhatsApp, or an “I'm interested” form with offer and quantity. Phone numbers are masked unless the seller opts in.
One-time edit key, inquiries list, mark as sold, remove, WhatsApp share. Admin moderation tab with full details.
No payments, escrow or logistics; on-page safety notice; rate limits, input sanitising, Indian mobile validation.
A real, reproducible pipeline — no random numbers. Every number in the UI traces back to a trained, evaluated model stored with its metrics.
| Model | MAE ₹/kg | RMSE | MAPE | R² | Skill vs naive | Best in |
|---|---|---|---|---|---|---|
| Naive (last price) | 2.58 | 3.38 | 8.9 % | 0.19 | — | 1 / 25 |
| Linear Regression (Ridge) | 1.78 | 2.27 | 6.1 % | 0.43 | +33 % | 7 / 25 |
| Random Forest | 1.75 | 2.36 | 6.0 % | 0.40 | +30 % | 14 / 25 |
| Gradient Boosting (HistGB) | 1.88 | 2.54 | 6.5 % | — | — | 2 / 25 |
| XGBoost | 1.84 | 2.47 | 6.3 % | — | — | 1 / 25 |
Selected models: mean MAPE 6.0 %, mean skill +42 %; 24 of 25 series beat naive by more than 2 % RMSE. Full per-series table in the README and notebook.
| Crop | MAPE | Skill | Model |
|---|---|---|---|
| 🧅 Onion | 4.9 % | +79 % | Random Forest (all 5 markets) |
| 🥔 Potato | 5.7 % | +21 % | Ridge (all 5 markets) |
| 🌾 Rice (Paddy) | 1.6 % | +17 % | Ridge / RF; Thanjavur honestly falls back to naive |
| 🍅 Tomato | 12.7 % | +63 % | HistGB, Ridge, XGBoost (per market) |
| 🌾 Wheat | 2.5 % | +27 % | Random Forest (all 5 markets) |
Tomato is the hardest (volatile, perishable) and is where skill over naive is largest; Rice/Thanjavur is the one series where the honest naive fallback wins.
Spoilage = daily loss × days (tomato 1 %/day, shelf life 7 d · onion 0.25 %/day, 60 d · potato 0.2 %/day, 75 d · rice/wheat 0.02 %/day). Net expected change = (estimate × qty × (1 − spoilage) − storage − revenue now) ÷ revenue now. WAIT when net gain ≥ 5 %, downside of the 80 % band better than −8 % and confidence not low · SELL NOW when net ≤ −2 % or past shelf life with no gain · otherwise MONITOR. Every verdict lists its reasons and caveats and is never framed as certainty.
React + TypeScript + Tailwind + Recharts in front; FastAPI + Pandas/NumPy/scikit-learn/XGBoost behind; SQLite (PostgreSQL-ready via DATABASE_URL); joblib model registry. Single process in production: FastAPI serves the built frontend.
| Method | Route | Purpose |
|---|---|---|
GET | /api/crops · /api/markets · /api/locations | catalogue with history coverage |
POST | /api/predict | forecast + recommendation + explanation + model metrics |
POST | /api/compare-markets | net revenue by market after transport & holding costs |
POST | /api/calculate-revenue | profit calculator arithmetic |
GET | /api/price-history · /api/model-metrics | cleaned history, registry metrics |
POST | /api/chat | AgriAdvisor (grounded, 5 languages, TTS-ready text) |
POST | /api/voice/command | transcript → structured UI action + spoken reply |
GET/POST | /api/marketplace/… | price suggestion, listings, inquiries, status, stats |
POST | /api/upload-data 🔒 · /api/admin/… 🔒 | ingestion, dataset, retrain, moderation (X-Admin-Token) |
Explicit errors: 404 unknown crop/market · 422 “Not enough historical data is available for this crop and market. Please select another market or prediction period.” · 401 admin · 400/413 bad or oversized upload.
Captured from the running app with Playwright (1366 px and 390 px). Click to enlarge.
Or ADMIN_TOKEN=secret docker compose up --build. Voice input needs https:// or localhost (browser microphone policy).
Built as an original hackathon project by the AgriPrice AI team. Edit the cards below with your names and roles.