AWS Builder Center
72 hours, one question: why and when does good food become garbage?

72 hours, one question: why and when does good food become garbage?

Good food gets dumped when a glut crashes its price, not because it has gone bad. In 72 hours we built a router that diverts produce away from gluts, rescues unsold stock at Delhi’s Azadpur mandi, and sends what can’t be eaten to biogas or compost instead of the dump.

Picture a tomato farmer near Kolar in early 2025. Picking and trucking a 15 kg box costs him about Rs 70. At the mandi, the same box sells for as little as Rs 30 ( Outlook Business ). So he leaves the crop in the field.
Elsewhere that year, tomatoes from Udumalaipettai were dumped by the roadside while the same box sold for about five times more across the Kerala border ( Onmanorama ).
Same food. Different place. Different value. That gap is what we had 72 hours to attack at the WeMakeDevs x AWS Environmental Hacks.

Hour 0: the problem is a decision, not a fridge

India loses 4.87-11.61% of its vegetables and 6.02-15.05% of its fruit every year ( Rajya Sabha, Feb 2025 ). The instinct when you hear those numbers is infrastructure: build more cold storage. That was ours too. But cold chains serve only about 10% of fresh produce, and over 75% of that capacity was built for potatoes ( NCCD, 2025 ). And tomato loss is 8.37% on the farm against 3.25% at the market.
That shifted the question. Much of the loss isn't food becoming unusable; it's its market value collapsing while the food is still fine. The decision that matters comes before any fridge: someone picks a mandi on yesterday's price and a trader's word.
So we didn't build hardware. We built a router: tell it what you're sending, and it tells you where to send it and what you'll actually earn after freight, fees and spoilage
Prevent, Rescue, Recover - one engine, three entry points


Hour 6: the data said no

Initially, our idea was to retrieve live mandi data via government APIs. However, both of these rejected the request for connection from AWS. For some time, we thought that is how our story ends. But later we found the same information in bulk form on India Data Portal and finally, the most recent one - price feed for last week, which actually responded to our request from AWS Mumbai region.

Hour 14: the backtest killed our best line

This one worked for us: "AnnaSetu warns you of a crash days in advance." And hence it became the first to be tested. Among 1,818 instances of crashes close to Kolar, increased arrivals were not consistently followed by falling prices and this particular pitch was put in the dustbin.

Hour 24: the router

The engine is plain Python with no machine learning. For each load it estimates the price on arrival, the share that spoils given the temperature and hours on the road, the freight and the market's fees, and ranks every reachable mandi by net value per kg, as a range rather than one confident number.
One truck was straightforward. A farmer group wasn't. If AnnaSetu tells everyone Bengaluru pays best today, AnnaSetu helps turn Bengaluru into tomorrow's glut. So the router adds each allocated load to that market's projected arrivals and moves to the next-best market before it tips. The recommender had to account for people actually following its recommendations. That became the anti-herding rule.
It runs on AWS as three Lambda functions behind API Gateway: recommendations, voice and ingest. DynamoDB holds market state and plans; S3 holds crop history and short-lived voice clips. EventBridge starts the nightly update and SQS fans it out one crop at a time, so failures retry on their own; one template, deployed with the AWS SAM CLI. Amazon Location turns a typed village into a real truck route and drive time, because a bad distance becomes a bad freight cost and then a bad recommendation. Amazon Transcribe takes voice in 12 Indian languages.



The AWS architecture was never the product. Its job was to let the product survive the messy edges around the decision: unreliable data, asynchronous ingest, voice, routing, and a phone that never holds AWS credentials.

Hour 32: the AI layer disappeared

Our voice flow had one more piece. Amazon Bedrock would turn speech into load details and explain the advice, behind a guard that blocks any number not in the recommendation. Then our AWS account was refused model access. With under two days left, we replaced the parser with rules and the explanations with templates. The engine kept working.
That made explicit a decision we hadn't made consciously: AI can help AnnaSetu communicate a decision, but it shouldn't be required to make one. The Bedrock wiring waits for access; the core doesn't.

Hour 36: the city changes the story

Since this is a hackathon in Delhi, we decided to follow the food and enter the city. For Azadpur, for example, if there is an inventory left by a trader at the end of the day, the trader may reduce prices or simply waste them. So we decided to include Rescue, where the engine assesses the viability and sends them to other mandis within 100km, which are willing to pay, or a food bank. The non-viable food items go to feed, biogas, and compost.
Unsold stock and the Impact tab, from the live API in Demo mode (29 Sep 2023 replay).


Hour 50: then we put it on a real phone

And then, we installed the APK. Voice said "could not understand"; the Android upload was delivering an empty file. "Harvested two days ago," not "harvested two hours ago." "Money saved" is the total money made, rather than how much AnnaSetu brought in. Both of these were solved on the same day; both highlighted the fact that a working system may ask a wrong question.

Hour 66: did it actually work?

Being error-free does not necessarily imply giving sound advice. Therefore, we re-run the released algorithm for each of the days in March to May 2026 based on simulated loads on realistic prices, weather, and routing. In total, 1,380 loads without any errors:
  • Estimated money saved: Rs 2.20 crore (likely 1.73-2.96 crore).
  • Diverted loads where the next real price confirmed the advice, after freight: 1,248 of 1,279
  • (a retrospective check, not a field trial).
  • Simulated unsold stock that found a paying mandi within 100 km: 169 t of 184 t.


The flaws were also there: The cauliflower from Delhi was available only 14 out of 35 times, and wastage was less even on normal days due to the increased travel distance.

What 1% would mean

India loses about 19.3 Mt of fruit and vegetables a year; 1% of that is about 193,000 tonnes of food. We don't claim AnnaSetu saves that; we haven't measured it with farmers yet. Next: farmer-group interviews to replace placeholder costs, partnerships with the outlets we mapped, and native-speaker review of all 21 languages.
The 72 hours changed our idea several times: storage, then forecasting, then an API that refused us, a backtest that killed our pitch, an AI layer we lost and a phone that asked the wrong question. What remained was simpler: one truck, today's information, and a better decision about where it should go.
The data to stop a glut is already public. It just never reached the person loading the truck.
Built in 72 hours with Claude Code as our AI coding tool.
Best, Utkarsh Along with the help of @lakshya19.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article