🍕 It started with a pizza box

There we were, hovering over the bins with a greasy pizza box, when someone said the magic words: "just toss it in recycling, they'll sort it out."

They won't. That's wishcycling — and it's quietly breaking recycling. Roughly 1 in 4 items Americans put in the blue bin isn't recyclable, and a single grease-soaked box can downgrade an entire batch to landfill. Food buried in landfill then releases methane ($\text{CH}_4$), a greenhouse gas ~28× more potent than $\text{CO}_2$. The kicker? The right answer depends on condition, not category: a clean pizza box recycles perfectly well.

Nobody asks the real question at the bin — not "what is this?" but "is this too contaminated to recycle?" So we built SortCall: the judgment call, made for you, in three seconds, with your city's rules, in plain language.

🔍 What it does

  • Snap & Sort — photograph (or describe) any item → one clear verdict: Recycle · Compost · Landfill · E-Waste · Hazardous · Store drop-off, with a "why" a 12-year-old could repeat
  • Contamination verdict engine — same item, different fates: clean box ♻️, greasy box 🗑️ … but 🌱 compost in San Francisco, where food-soiled paper legally belongs in the green cart
  • Local rules — Generic US, San Francisco, and NYC rule sets with condition-level overrides, because "is this recyclable?" has no universal answer
  • SortLab — a contamination playground where you flip conditions and regions and watch verdicts flip live
  • Impact log — every sort logs estimated CO₂e avoided, builds a streak, and generates a shareable impact card. Fully on-device: no accounts, no tracking
  • It refuses to break — no internet? The offline rulebook keeps answering

🛠️ How we built it

Next.js 14 + TypeScript + Tailwind, deployed on Vercel. The verdict pipeline has three layers:

  1. Gemini vision — via the Vercel AI SDK's generateObject with a strict Zod schema, the model returns a machine-checkable verdict (item, condition, contamination level, suggested bin) as structured JSON. The API key never leaves the server.
  2. A deterministic rule engine — a hand-built dataset of 20 conditional rules across 3 regions applies condition- and region-level overrides on top of the AI's suggestion and computes impact (e.g., $0.18\,\text{kg CO}_2\text{e}$ avoided per recycled item).
  3. A fallback chain — AI unreachable → 15s hard timeout → second model attempt → offline rulebook → helpful message. The demo cannot die on stage.

😅 Challenges we ran into

Making an LLM shut up. Early prompts returned beautiful essays and unusable data — a verdict isn't prose, it's a decision. Constraining output with a Zod schema turned the model into something we could merge with a rule engine like any function call.

Contamination is hard to encode. We read real municipal guidelines for three cities and found flat contradictions — the same greasy box is landfill in most of the US and compost in SF. The contradiction became the feature: condition-level, region-level overrides.

Our AI provider fell over — twice — mid-build. We started on Claude vision, hit the fresh-account credit wall on the very first call, and rebuilt the layer on Gemini's free tier. Then Google retired the exact model we were using, and requests hung for minutes on a congested tier. We survived with auto-updating model aliases, hard timeouts, and a two-model fallback chain.

Honest failure states are harder than fake ones. When the AI is down, SortCall says so ("answered from the rulebook instead") rather than faking confidence. Designing graceful degradation took more discipline than the happy path — and it's why we could test the demo with the wifi off. On purpose.

🏆 Accomplishments we're proud of

The pizza box demo: one object, two conditions, two bins, zero hand-waving. A deployed app where pulling the network cable mid-demo changes nothing. And impact math on every verdict — turning a utility into a habit loop.

📚 What we learned

The interesting problems in "AI + social good" aren't the model — they're everything around it: encoding real-world rules, fusing probabilistic output with deterministic logic, and designing for failure as a first-class case. Also, we now know far too much about municipal composting. Ask us about chip bags.

🔭 What's next

  • More regions — the rule set is just JSON; contributors can add their city in one file
  • Barcode lookup for ambiguous packaging
  • Community mis-sort leaderboards for schools running zero-waste competitions

SortCall — make the right call at the bin. 🌍

Built With

  • canvas-api
  • climate-tech
  • gemini
  • google-ai-studio
  • json-rule-engine
  • localstorage
  • machine-learning
  • nextjs
  • recycling
  • social-good
  • sustainability
  • tailwindcss
  • typescript
  • vercel
  • vercel-ai-sdk
  • waste-management
  • zod
Share this project:

Updates

Submission history