Building KabadiConnect: AI-Powered Scrap Collection on Amazon Bedrock and AWS Serverless
How we built a real-time scrap pickup marketplace connecting Indian households with informal recyclers using Amazon Bedrock Nova Lite multimodal vision, DynamoDB atomic conditional writes, and AWS SAM.
Every Indian household has that one corner: stacks of old newspapers, flattened Amazon delivery boxes, and empty plastic bottles waiting for the local kabadiwala (scrap collector) to cycle down the street.
For decades, this informal recycling system has been the backbone of India’s circular economy—processing over 90% of the country’s dry waste. Yet, whenever I tried to sell scrap from my own home, the experience felt stuck in the past: haggling without knowing fair market rates, hoarding recyclables until they became an eyesore, or giving up and tossing them into mixed municipal trash.
On the flip side, local collectors spend grueling hours pedaling heavy carts through neighborhoods, shouting for scrap without any idea if a trip will earn them ₹50 or ₹500.
During this hackathon, I set out to answer a simple question: What if scheduling a scrap pickup was as effortless as booking an Uber, powered by computer vision on AWS?
Here is the story of how I built KabadiConnect, what worked, and what I learned along the way.
The Vision: Fair Prices for Homes, Worthwhile Trips for Collectors
I wanted to build a hyper-local, two-sided platform that solved three core problems:
- For Households: Take a photo of a scrap pile, let AI identify what’s in it, and show an instant, fair price estimate based on real local market rates.
- For Collectors: Receive pre-qualified pickup leads on a phone with a clear tag telling them whether a trip is worth the distance and fuel.
- For Safety: Automatically detect hazardous items like old lithium batteries or CRT monitors and divert them away from informal scrap handling to authorized e-waste centers.
Finding the Right Stack on AWS
Because I was building this in a matter of days, I didn't want to spend time configuring servers, managing Docker clusters, or worrying about infrastructure scaling. I went 100% serverless:
- Amazon Bedrock (Nova Lite): For multimodal vision.
- AWS Lambda (Python 3.12 on Graviton ARM64): For all backend business logic.
- Amazon DynamoDB: For instant, on-demand data storage.
- Amazon S3 & CloudFront: For private photo uploads and global CDN hosting.
- AWS SAM: To define and deploy the whole stack in code.
The Breakthrough: My Experience with Amazon Bedrock
My biggest worry was the computer vision. Scrap piles are messy, chaotic, and poorly lit. Would a foundation model actually recognize crushed cardboard underneath a pile of newspapers?
I used Amazon Bedrock’s Converse API with the Nova Lite (
amazon.nova-lite-v1:0 ) model.The first time I fed a real photo of scrap from my desk into Bedrock, the result blew me away. It didn’t just identify the materials—it adhered strictly to my 17-category taxonomy (
newspaper_paper , cardboard , pet_bottles ) and returned clean JSON on the very first try.The Realization About "AI Weight Estimation"
Early on, I realized something critical: no AI model can accurately tell you the exact weight of a scrap pile from a single 2D photo. Cardboard density varies, boxes can be empty or full, and pretending the AI knows the exact gram amount is misleading.
So I pivoted the UX:
- Bedrock returns a realistic weight range (
kg_lowtokg_high).
- I built an interactive slider called the RangeRuler, letting the seller tweak the estimate with their finger.
- The final payout is always settled on a physical digital scale at the doorstep.
Admitting the AI's limitations made the product ten times more honest and practical.
What Kept Me Up at Night (And How I Solved It)
Building a real-time marketplace isn't just about calling an AI model; it’s about handling edge cases.
1. The "Double-Accept" Race Condition
Imagine two collectors sitting near the same neighborhood who both open their apps and see a high-value ₹300 scrap listing. If they both tap "Accept" at the exact same millisecond, who gets it?
Instead of setting up complicated distributed locks with Redis, I used DynamoDB Conditional Writes:
Python
ConditionExpression="attribute_not_exists(collectorId) OR #status = :open"
With this single line of code, DynamoDB guarantees that only the first request succeeds. The second collector immediately sees a clean "Already accepted by another collector" alert. No double dispatches. Zero locks.
- Guarding the AWS Bill (Image Hashing) During testing, I found myself uploading the same test images repeatedly. Every vision API call costs tokens. To make the app fast and frugal, I built a SHA-256 hash check in DynamoDB: if the image hash already exists, the Lambda returns the cached analysis in under 20 milliseconds without calling Bedrock at all.
The "It Worked!" Moment
The most exciting part of this project was the two-device live test.
I had my laptop sitting on my desk acting as the Collector (Imran Ali), and my smartphone in my hand acting as the Household (Pooja Verma):
I snapped a photo of some scrap on my phone and submitted the pickup request in the DTU area.
Two seconds later, the request popped up on my laptop with a bright yellow "Worth the trip" badge.
I clicked Accept on the laptop.
Within 4 seconds, without touching my phone, the phone screen automatically flipped: "Collector Confirmed & On The Way" with the collector’s contact info and ETA.
Seeing the real-time synchronization between two devices powered purely by serverless AWS primitives was an incredible feeling.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article