-
-
Overview: live air for the chosen city, with the smog-lid hours marked
-
Routine: free actions ranked by how much they cut the family dose
-
Neighbourhood bulletin in Hindi, ready for a WhatsApp group
-
Assistant: Gemini answers with the family live numbers
-
Impact: PM2.5 not inhaled, cigarette-equivalents and CO2e saved
Live app: https://exhale-air.vercel.app · Code: https://github.com/Thanatos9404/exhale · Track: Sustainability
Inspiration
Every winter, cities across North India sit under a temperature inversion: a lid of warm air that traps smoke a few dozen metres above the ground. PM2.5 climbs to many times the WHO guideline, and the WHO attributes about 6.7 million premature deaths a year to outdoor and household air pollution.
What struck me is that families get only one number, the AQI, and no plan. Nobody tells them that the lid lifts around midday, that the 7 am walk is the worst hour of the day, that a mosquito coil in a closed bedroom can be the largest dose a child gets, or that the metro would cut both their dose and their emissions. And the people at most risk, a child with asthma or a grandparent with a heart condition, need different limits from everyone else. I wanted to build the tool that answers "what should my family do today, and how much does each choice matter?"
What it does
Exhale is a working web app at https://exhale-air.vercel.app. No sign-up.
- Sees the smog lid. Live CAMS air-quality and boundary-layer data for any city, on the India NAQI or US EPA scale, hour by hour, with the lid hours detected and explained in a 3D air column and an animated diagram.
- Simulates the family's day. A deterministic engine models every member's next 24 hours: where they are, how hard they breathe and what they breathe, with personal limits for age and health conditions.
- Re-plans it. It moves window-airing and exercise to the cleanest hour, switches the commute when it helps and removes indoor smoke sources. It never keeps a change that makes anyone worse off.
- Measures every choice. Each action shows micrograms of PM2.5 not inhaled, cigarette-equivalents avoided and kilograms of CO2e saved. Switch choices on and off and the day recomputes instantly.
- Explains it. Gemini explains each action for this specific family and answers questions with their live numbers, optionally grounded in Google Search for current local advisories.
- Reaches the neighbourhood. One tap turns the day's air into a bulletin for a residents' or school WhatsApp group, in English or Hindi.
- Fixes the room you are in. An indoor-air lab models one room with windows, purifier, cooking, incense and coils.
For a sample three-generation family on a synthetic Delhi-like winter day, the plan cuts the household's inhaled PM2.5 from 3,545 to 2,334 µg (34% less, 7.8 cigarette-equivalents avoided) and saves 19.5 kg of CO2e a week by moving the commute from a petrol car to the metro with an N95. A test in the repo recomputes these numbers on every build.
How we built it
How it uses AI. Exhale separates deciding from explaining.
- A deterministic TypeScript engine computes every number: US EPA and CPCB AQI breakpoints, EPA breathing rates, a single-zone indoor mass-balance model and Berkeley Earth's cigarette equivalence.
- Gemini (Google Gen AI SDK) receives the finished plan and writes a headline, a personal reason for each action, three indoor hacks and three low-emission swaps, using structured output with a JSON schema. The server validates the reply with zod and attaches it to the engine's actions by id, so the model can never change a figure.
- The assistant streams answers grounded in the family's live plan, with optional Google Search grounding and cited https sources.
- Resilience: Gemini calls are hedged across models and keys with a circuit breaker. If they fail, Claude Haiku answers; if that fails, a rules engine does. One 50-second deadline covers each request.
Stack. React 19, TypeScript (strict), Vite, Tailwind, React Three Fiber and three.js, GSAP, TanStack Query, zod, Vercel Functions, Open-Meteo (CAMS) data.
Quality. 1,338 unit, property-based and API tests at 98.9% statement coverage of the engine, server and API code; 91 end-to-end tests in real Chrome on a desktop size and a phone size; axe accessibility checks on every page; a bundle budget that keeps first-load JavaScript at 138.6 kB.
AI coding assistance (disclosure). I used Claude Code (Anthropic) as an AI coding assistant throughout the build: it wrote most of the code, tests and docs from my prompts, and every commit in the repository is marked as co-authored with it. I directed the product, reviewed the results and tested the app. The README says the same.
Open-source data and libraries credited: Open-Meteo (CAMS, CC BY 4.0), BigDataCloud reverse geocoding, Geist fonts (SIL OFL), Lucide icons (ISC), and the libraries above.
Challenges we ran into
- Trustworthy numbers with a generative model. A language model must not invent a dose. The fix was architectural: the model only fills
{ id, why }pairs in a schema, and anything that does not match an engine action is dropped. - Never harming the most sensitive person. A change that helps the parent can hurt the child. Every candidate change is scored by re-simulating the whole day for each member, and a guard refuses any change that raises anyone's dose or the household's CO2e. Property-based tests with fast-check try to break this rule with generated households and forecasts.
- Making an inversion visible. People have never seen a boundary layer. I showed it with a 3D particle column and an animated diagram, then made sure the same facts are in text for screen readers and the 3D code loads only when the browser is idle.
- Staying up when AI is down. Overloaded or rate-limited models are normal. Hedged requests, a circuit breaker, a second provider and an offline rules engine keep answers coming inside one deadline.
Accomplishments that we're proud of
- It is live, works for any city and needs no account.
- The do-no-harm rule is checked by property tests, not just promised.
- The worked example in the docs is checked against the engine's real output on every build, so the docs cannot drift from the code.
- Exhale scored 96.85 out of 100 in the Hack2skill and Google for Developers PromptWars AI evaluation (Challenge 6, Urban Air Quality Assistant).
- The neighbourhood bulletin works in Hindi and carries no household data.
What we learned
- Atmospheric science I did not know before. How a temperature inversion and a shallow boundary layer trap pollution, and why the early afternoon is often the cleanest window. Turning that into a rule (boundary layer under 300 m and wind under 12 km/h) taught me to read weather data, not just pollution data.
- Exposure is a dose, not a number on a screen. Concentration times breathing rate times time, with breathing rates that change with age and activity. Indoor air needs its own mass-balance model.
- Property-based testing. Writing invariants such as "the plan never raises any member's dose" and letting fast-check search for counter-examples covers households and forecasts I would never have written by hand.
- Designing around AI's weak spots. Using the model for language and the engine for facts, validating every model reply, and planning for the model to be unavailable.
- Accessibility as engineering. Computing contrast in tests, keyboard patterns, live regions and text versions of every chart.
- Working with an AI coding assistant. Directing it with precise requirements and checking its output with tests, rather than trusting it.
What I would do differently: test with real families early instead of a sample household; compare the model's air data with nearby CPCB ground stations; and do a manual screen-reader pass, which the automated checks cannot replace.
What's next for Exhale
- Push alerts when the lid is about to close over the family's home.
- School and residents'-association dashboards built on the same bulletin.
- Low-cost sensor input to replace the regional model where a street sensor exists.
- More Indian languages for the bulletin and the assistant.
Before this hackathon (required disclosure)
Exhale was built in November 2026 for Hack2skill and Google for Developers' PromptWars (Challenge 6, Urban Air Quality Assistant). Everything described above existed when I entered STEM2Connect, and it is submitted as built.
Built With
- axe-core
- claude
- fast-check
- gemini
- google-gen-ai-sdk
- gsap
- open-meteo
- playwright
- react
- tailwindcss
- tanstack-query
- three.js
- typescript
- vercel
- vite
- vitest
- zod