What inspired us:

We noticed something simple but frustrating — everyone around us cared about the environment, but nobody changed their behavior. Not because they didn't want to, but because the information they needed was never there when they needed it. We book a cab, orders lunch, and shops online — all before 10 AM — and never once sees the environmental cost of any of it. That gap between intent and action is what EcoSense is built to close.

What we learned:

Building EcoSense taught us that the hardest part of sustainability isn't the science — it's the timing. Carbon data exists everywhere. What doesn't exist is a layer that delivers it at the exact moment a decision is still changeable. We also learned that people don't want to be lectured — they want a nudge. One clear alternative, ranked honestly, at the right moment, is worth more than a dashboard full of charts they'll never open.

We also discovered how powerful structured output is. Getting LLM to return consistent, parseable JSON format and ouput across wildly different scenario types — a flight booking, a meal order, a home appliance choice — required careful structure engineering, edge case handling, and a lot of iteration on the schema.

How we built it:

EcoSense is built on Python + Streamlit for the frontend, with Google Gemini handling all AI reasoning.

The core flow is:

User describes a real-world decision in simple language,

A structured prompt sends context — category, location, preferences — to Gemini,

Gemini returns a JSON object with EcoScore, CO₂ estimate, 3 ranked alternatives, a nudge, and a fun fact

The UI renders the result in under 2 seconds

The EcoScore is a composite index based on established Life Cycle Assessment methodology:

EcoScore= 0.5×CO2​+0.3×H2​O+0.2×Waste

Carbon data is grounded in real sources — Climatiq for grid intensity, Open Food Facts and Agribalyse for food emissions, and Google Maps for transport routing. API keys are managed securely via secrets, never hardcoded.

Challenges we faced:

Getting consistent output from the model was the biggest challenge. Early versions would occasionally return markdown-wrapped responses or incomplete schemas. We solved this with strict system prompting, fence-stripping logic, and a robust _error() fallback so the app never crashes on a bad response. Balancing convenience and sustainability in the alternatives was trickier than expected. An alternative that saves CO₂ but adds 45 minutes isn't useful — it gets ignored. We tuned the fact to factor in the user's stated convenience bias and budget sensitivity so recommendations feel realistic, not preachy. Scope creep was real. We deliberately cut everything that wasn't core to the single insight: intercept the decision before it's made.

Built With

Share this project:

Updates