Inspiration

India has 126 million farming households, and over 90% of their produce flows through ~4,367 traditional APMC mandis (agricultural markets). Every day, these mandis publish prices — but farmers have no intelligent tool to analyze them. A tomato farmer in Kolar selling at ₹18/kg has no way to know that Bangalore, just 68 km away, is paying ₹32/kg on the same day.

Platforms like Ninjacart and DeHaat have raised hundreds of millions, but they're marketplaces — they buy produce and control the supply chain. For the vast majority of farmers selling through open markets, there's no independent advisor. This information asymmetry costs farmers an estimated 15–30% of potential income every harvest.

One of our team members researches post-harvest supply chains for small farmers in Karnataka as part of their PhD work. We knew the data existed. What was missing was the intelligence layer.

What it does

Mandi Intelligence Agent is an AI-powered advisory system for Farmer Producer Organizations (FPOs) — cooperatives where 50–500 small farmers pool produce for collective selling.

An FPO manager asks: "We have 20 tonnes of tomatoes in Kolar. Prices seem low. What should we do?"

The agent:

  • Scans prices across major Karnataka APMC mandis in seconds
  • Detects anomalies (Kolar crashed 28%, Bangalore spiked 15%)
  • Calculates net revenue per mandi after transport costs
  • Analyzes whether the crash is temporary (supply glut) or structural
  • Recommends a split strategy: send 12 tonnes to Bangalore today, hold 8 tonnes at Kolar for a predicted 2-day recovery

Result: ₹1.98 lakh additional income for the FPO — approximately ₹4,000 per farmer from a single batch decision.

The split-strategy recommendation is something no existing platform provides. It balances certainty (selling at a confirmed high price) against opportunity (betting on local price recovery) while factoring in perishability and wastage risk.

How we built it

We used Elastic Agent Builder with a multi-agent architecture:

  • Market Analyst — finds the best price across mandis right now, calculates net revenue after transport
  • Historical Analyst — examines price trends and arrival patterns, identifies temporary vs structural price movements
  • Coordinator — resolves disagreements between analysts using crop-specific constraints (shelf life, wastage rate, transport capacity) and can recommend sell/hold/split strategies

The data layer uses Elasticsearch with ES|QL analytics running against 45 days of Karnataka mandi price data (modeled on Agmarknet, the Government of India's agricultural market information portal). Crop profiles store perishability data, transport distances, and historical recovery patterns.

Advisories are stored with structured batch-level economics — each recommendation includes per-batch revenue, transport cost, wastage cost, and net gain calculations.

Challenges we ran into

Making AI agents genuinely disagree. The Market Analyst and Historical Analyst need to reach different conclusions for the split-strategy to emerge. Designing prompts and data that consistently produced divergent but valid economic interpretations required careful calibration.

Keeping the math honest. Every number the agent produces — transport costs, wastage, net revenue — must be internally consistent and traceable to the source data. We built strict rules: deterministic distance lookups (no guessing), explicit date-bucketing for "today" (no timezone drift), and mandatory crop-profile checks before any perishability claim.

The split-strategy logic. Recommending "send part here, hold part there" requires balancing multiple competing factors simultaneously: perishability windows, transport capacity (~10T/truck), price volatility risk during transit, and market absorption effects. Making this deterministic rather than open-ended required explicit quantity thresholds and decision rules.

What we learned

The information asymmetry in Indian agricultural markets isn't just a theoretical problem — it's quantifiable. Running our agent against mandi price data reveals systematic, avoidable economic losses that vary predictably by crop perishability and market geography.

We also learned that the most impactful AI isn't the most complex. The split-strategy — our most powerful recommendation — emerges from a simple principle: when two valid perspectives conflict, the optimal answer often isn't choosing one, but combining them.

What's next

  • WhatsApp bot pilot with 5 FPOs in Kolar district, Karnataka
  • Expand to all Karnataka mandis using live Agmarknet data feeds
  • Field validation comparing FPO selling outcomes with the agent vs historical baselines
  • Academic publication quantifying information-asymmetry-driven post-harvest economic loss using our computational framework

The data already exists. The FPOs are already organized. We're building the bridge between open government data and smarter farmer decisions.

Built With

Share this project:

Updates