Inspiration
One day, a vegetable vendor arrived outside my house selling onions for ₹50 per kilogram. The very next day, my mom and I visited the farmers’ market, where the same onions were being sold for ₹100 per 5 kilograms. That moment struck me deeply.
I realized there was a massive knowledge gap between hardworking farmers and everyday consumers. Farmers often don’t receive even half the value of their produce, while consumers end up paying double. This disconnect isn’t just unfair—it’s inefficient and unsustainable.
To bridge this gap, I created AgriCast, a platform that empowers farmers, vendors, and consumers with predictive insights into agri-horticultural commodity prices using machine learning and weather data. By forecasting prices up to 30 days ahead, AgriCast helps users make smarter decisions in a volatile market.
What It Does
AgriCast is a mobile-first platform that:
- Predicts future prices of key agricultural commodities using machine learning
- Visualizes historical price trends for better decision-making
- Logs every user search to MongoDB for future analytics
- Offers real-time insights through a simple and intuitive interface
- Helps users understand how market prices evolve — not just from the consumer’s perspective, but also from the farmer’s side, by modeling both farm-gate and retail price dynamics
The platform doesn’t set prices — it reflects market behavior influenced by supply, demand, location, and policy. This helps users anticipate fluctuations rather than react to them.
How We Built It
Tech Stack
- Frontend: Flutter (for cross-platform mobile UI)
- Backend: Python with FastAPI (for ML integration and API services)
- Database: MongoDB (for storing commodity and weather data)
- ML Models: Linear Regression and LSTM for time-series forecasting
Development Process
- Data Collection:
- Historical price data from government portal known as DoCA (Department of Consumer Affairs)
- Dataset Used : link
- Data Cleaning:
- Removed inconsistencies, filled missing values, and normalized formats
- Merged weather data with commodity price data using timestamps and location
- Model Training: [ \text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2} ] Trained models to forecast prices based on commodity, location, time, and weather variables (temperature, rainfall, humidity)
- API Integration:
/predictendpoint returns forecasted price/log_searchendpoint stores user queries in MongoDB
- Flutter UI:
- Commodity and state dropdowns
- Date picker
- Prediction result display
- Search logging triggered automatically
- MongoDB Logging:
- Every search is stored with:
{
"commodity": "Wheat",
"state": "Bihar",
"date": "2025-11-01",
"timestamp": "2025-10-28T14:38:00",
"device": "mobile"
}
- Viewed using MongoDB Compass
Challenges We Ran Into
Building AgriCast in just 5 days was intense. We faced:
- Data inconsistencies in public datasets, requiring extensive cleaning
- Aligning data with commodity prices across regions and timeframes
- Model tuning to balance accuracy and speed for real-time predictions
- Handling backend-frontend sync, especially with async data fetching in Flutter
- Accounting for unpredictable events like natural disasters or geopolitical shocks — while our model can’t foresee these, it can detect anomalies and flag volatility when sudden changes occur
Accomplishments That We're Proud Of
- Built a working ML-powered prediction engine from scratch
- Integrated latest data to improve prediction accuracy
- Designed a clean and intuitive mobile UI despite being new to Flutter
- Created a real-world solution that could genuinely help farmers and consumers
- Learned and applied full-stack development in under a week
What We Learned
- How to train and evaluate ML models for time-series forecasting
- How to build and deploy APIs using FastAPI
- How to connect Flutter apps to Python backends
- How to manage NoSQL databases like MongoDB
- How regional patterns influence agricultural pricing
- The importance of user-centric design and real-world impact
What’s Next for AgriCast
- Push alerts: Notify users of price spikes or drops
- Localization: Add support for regional languages
- Farmer onboarding: Create a simplified version for farmers with voice input
- Partnerships: Collaborate with local markets and agri-tech startups
- Advanced weather modeling: Use satellite data and seasonal forecasts for long-term planning
- Disaster responsiveness: Integrate global feeds to detect and respond to events like floods, droughts, or trade disruptions
Log in or sign up for Devpost to join the conversation.