DEV Community

Cover image for Fertilizer Market Intelligence Agent Blueprint
FDE at Trida AI for Trida AI

Posted on Edited on Originally published at trida.ai

Fertilizer Market Intelligence Agent Blueprint

Originally published at Trida AI.

Every fertilizer company in India plans its season on demand numbers, and almost none of those numbers can be re-derived from anything the company actually stored. They arrive as a district demand estimate: a single figure, confident and unconnected, with no drivers, no sources, and no stated gaps. When a spike appears, or a supply position is questioned, there is nowhere to walk back to. This is not a problem of modelling power. It is a problem of provenance: estimates with no lineage, prices with no trail, supply with no reconciliation, and field signals with no author.

This open blueprint, the Fertilizer Market Intelligence Agent, holds two crop years across twelve districts and both seasons — cropped area by crop, crop mix, monsoon deviation, soil nutrient status, product and feedstock prices, import arrivals, domestic production against plan, competitor series, policy events and structured field reports — in a store that only accepts new facts: writes are insert-only, so a corrected figure is a new fact under a new date and history is never rewritten. Its compute engines run on LangGraph; the pattern follows the Farmioc DataStore shape of one governed ontology under the analysis.

Consumption you can re-derive

The foundation is a discipline most market models skip: historical consumption is not an input someone hands the model, but an estimate derived from stored inputs — nutrient demand per crop, cropped area, a substitution curve between products, and a seasonal pattern — with every step recorded. For DAP in one Punjab district, the sample season's consumption breaks down in the open: nutrient demand, crop mix, area, substitution and seasonality, and the residual sits visible as “model residual”, not buried in an adjustment. One quarter back, the same district's consumption estimate says something the polished version never does: it was partial, because the soil test data for that quarter was missing, and the gap is stated as a shortfall against the full input set. Views are read-only; no estimate on this system can be edited in place. The store gives the desk something it did not have before: a consumption number that a second person can rebuild from the inputs it names.

An estimate that shows its drivers

A demand estimate carries its construction on its face. The DAP estimate for one Punjab district for the sample season is shown not as a total but as its parts — price elasticity, monsoon and crop mix, the district's own prior-year pattern, and the seasonal shape — each with a value and a weight, so the desk can see what moved it and by how much. Its arithmetic is the point: a district demand estimate for the sample season is expressed as a base from the district's history, plus elasticity, monsoon and crop mix, plus seasonality, and the total is printed next to those parts. The structure is not a flourish; it is the audit trail, in the same place as the number.

Just as telling is the same district's prior-year estimate: it is partial. Two drivers — price elasticity and monsoon and crop mix — are missing, and the record says so, naming them as gaps rather than estimating around them. The record keeps a version log: the estimate was created, then twice amended — once when the district's crop-mix data arrived, and once when the price series was corrected — and each amendment is a new entry that names the changed driver and the figure it replaced. Estimates are never overwritten; they accumulate versions, and the prior version stays available.

The estimate's construction, on its face — and the prior year's gaps named, not patched.

The estimate's construction, on its face — and the prior year's gaps named, not patched.

An outlook that adds up

The season outlook rolls 72 district-product estimates into one view — in the sample season, about 7.4 lakh tonnes in total — and then refuses to leave it as a total. The season's headline, which in the sample is roughly 7.4 lakh tonnes, is accompanied by the full composition underneath: a 40% monsoon-driven downside for one district-product line, a large DAP share from one district, a stated gap for another district's seasonal view, and one district-product line whose estimate was left out of the printed total because its own data was missing. The headline is not presented alone; the composition that makes it up is printed beside it, including the line that was excluded and why. A total with its exceptions named is a different kind of number from a total that hides them.

The watch that cries once

Prices are watched by a rule pack, and its manners are the point. A pass over the sample series compares each price with its own trailing mean and deviation — for DAP in one district in the sample, a price of ₹4,450 against a mean of ₹4,020 and a deviation of ₹180, a 2.4-sigma move — and produces eighteen alerts from one pass, each with a distinct trigger and trigger detail. A spike fires once: when the same price crosses the same rule again on the next reading, no new alert is raised, because the event already exists; instead, the existing alert's history gains a second reading. What the desk gets is not a stream of alarms but a ledger: eighteen distinct events, each with its own trigger, and the repeats folded into the event they belong to rather than becoming new noise.

An alert then lives by acts, not edits: the desk lead acknowledges it, and later closes it with a reason, and both acts are recorded as events with dates rather than overwriting the alert. The closing reason is what turns an alert into a record: the desk closed the DAP spike not with a shrug but with a stated reason — the price was unwinding, and the desk chose to wait for the next reading rather than act. The alert's story is complete when it is closed; an unclosed alert stays an open question, and its open status is itself visible to the desk.

One pass, eighteen alerts; the spike fires once, and its unwind stays quiet.

One pass, eighteen alerts; the spike fires once, and its unwind stays quiet.

A supply position that reconciles

Imports and production are tracked as a position chain: twenty-four months in the sample, each month carrying its own opening stock, imports, production, offtake and closing stock, and each month's opening stock is the prior month's closing stock, so the chain cannot drift. The position view reconciles across the full chain: for DAP in the sample, opening stock, plus imports and production, minus offtake, equals closing stock, and the arithmetic closes for the quarter as a whole. The desk can also walk the chain one link at a time: one month's opening stock equals the prior month's closing stock, and the walk continues across the whole series without a break. A position that reconciles is not a report; it is a chain whose links can be checked.

Field signals, capped and attributed

The human layer is governed too. A field report is an artefact with a named reporter, not a number whispered into a spreadsheet: aggregation shows the reports it is built from, and a single unverified report cannot move an estimate beyond a stated cap, however confident it sounds. Competitor and policy figures carry source and date, and staleness is a stated rule: a figure past its freshness window is labelled stale wherever it appears, never silently presented as current.

What this is not

One boundary is worth stating as plainly as the system states it: nothing here advises a farmer. There is no agronomy-advice surface — no crop recommendations, no dosage guidance. This is a business-intelligence tool for the input company's own teams, about markets: demand, prices, supply, competitors, policy. Keeping that line bright is part of the design, not a disclaimer pasted over it.

For the data underneath: an intelligence desk starts with the underlying data. For India agriculture data — prices, arrivals, production, trade and policy across India's agricultural markets, with provenance on every figure — use Farmioc DataStore.

Work with us

If your season planning runs on folklore with decimals — estimates nobody can re-derive, spikes discovered late, a supply gap explained only in hindsight — the governed version is buildable: consumption derived from stored inputs, estimates that show their drivers and name their gaps, a watch that fires once per event, and a position chain that reconciles. Bring the problem through Trida AI's intake and we will scope what a market intelligence agent for your teams should, and should not, be allowed to claim.

Get the Code on GitHub: github.com/tridaai/blueprint-fertilizer-market-intelligence

Top comments (0)