Zing Forum

Reading

AgriTrend-DSS: An Agricultural Decision Support System Integrating Machine Learning and Generative AI

An intelligent agricultural decision support system for local farmers that combines machine learning for yield prediction and generative AI for market trend analysis to help farmers make data-driven planting decisions.

农业机器学习生成式AI决策支持系统产量预测FastAPIReact开源项目
Published 2026-06-04 08:08Recent activity 2026-06-04 08:18Estimated read 6 min
AgriTrend-DSS: An Agricultural Decision Support System Integrating Machine Learning and Generative AI
1

Section 01

AgriTrend-DSS: AI-Powered Decision Support for Local Farmers

Core Overview AgriTrend-DSS is an open-source agricultural decision support system designed for local farmers, combining machine learning (ML) for yield prediction and generative AI for market trend analysis to enable data-driven planting decisions.

Key Basics

This system addresses small farmers' information asymmetry and unreliable traditional decision-making by providing scientific tools for yield forecasting and market insights.

2

Section 02

Project Background & Problem Solved

Small farmers often face:

  • Lack of scientific yield prediction tools
  • Difficulty in grasping market dynamics
  • Unreliable decisions based on experience/intuition (exacerbated by climate change and market volatility)

AgriTrend-DSS was built as an open-source solution to these issues. It merges ML and generative AI to offer data-driven support, helping farmers decide what to plant and when to sell.

3

Section 03

Core Functional Architecture

  1. Yield Prediction Engine: Uses Random Forest algorithm on agricultural data (NPK content, temperature, humidity, pH, rainfall) to predict yield per hectare.
  2. Market Trend Classification:
    • Uptrend Potential: ≥6.5 tons/ha → expand planting
    • Stable Market:4.0-6.4 tons/ha → maintain strategy
    • Adjust Distribution: <4.0 tons/ha → find alternative markets or crops
  3. AI Insights: Integrates Google Gemini API (gemini-2.5-flash) with two modes:
    • Market-only analysis (trends, pricing)
    • Agronomic + market analysis (tech advice + market insights)
  4. Geo Coordinate Parsing: Built-in Indonesia region database to resolve lat/long via region code/name for regional analysis.
4

Section 04

Technical Stack Details

Frontend: React19, TanStack Router, Vite, TypeScript, Tailwind CSS Backend: FastAPI, Python3.12, Uvicorn Data & Auth: Supabase (PostgreSQL + auth), JWT ML & AI: scikit-learn (Random Forest), Google Gemini API, joblib (model serialization) Deployment: Vercel (backend API), Cloudflare (frontend CDN)

5

Section 05

User Workflow

  1. Data Collection: Input soil (NPK), weather (temp, humidity, rainfall), pH data.
  2. Crop Selection: Choose crop type (rice, corn etc.).
  3. Region Info: Enter region code/name for geo parsing.
  4. Analysis Mode: Select market-only or agronomic+market analysis.
  5. Smart Prediction: ML computes yield → trend classification → AI generates structured report (insights, 30-day actions, tech improvements).
  6. Decision Support: Get yield forecast, trend judgment, and actionable advice.
6

Section 06

Practical Application Value

For Small Farmers:

  • Access enterprise-level decision tools
  • Evaluate crop收益 before planting
  • Adjust sales timing based on trends
  • Get targeted agronomic advice

For Cooperatives:

  • Unified decision reference for members
  • Regional data analysis
  • Coordinate production to avoid oversupply
  • Improve bargaining power

For Policymakers:

  • Understand regional production potential
  • Design targeted agricultural policies
  • Predict food security risks
  • Optimize resource allocation
7

Section 07

Open Source & Future Outlook

Open Source:

  • License: ISC (free use, modify, distribute; commercial allowed)
  • Modular architecture: Easy to add new ML models, regional data, AI services, or mobile apps.

Future:

  • With more data and model optimization, it will play a bigger role in global food security and sustainable agriculture.
  • Invites developers/researchers to contribute to this open-source project.