
India Air Advisor: asking the air before you go out
We built India Air Advisor in four days for the WeMakeDevs × AWS Environmental Hacks hackathon (Air track): a website where you ask "Should I go out today?" and get an answer about the air in your own town, not a number you have to decode.
The question behind the project
Most air-quality tools hand you an AQI and leave the thinking to you. A reading of 159 means little if you don't know the scale, and even less if you are wondering whether to go for a run, send a child to play outside, or skip the mask.
We wanted the opposite: ask in plain words, name any place in India, and get the number plus what it means for you. Three decisions shaped everything that followed:
- All of India, not one city. Any town you can search should work.
- Indian categories. Results use the CPCB scale (Good, Satisfactory, Moderate, Poor, Very poor, Severe) rather than verdicts we made up.
- One mode for everyone. We started with a school-day idea, then dropped it. The app is for any individual.
What it does
The site has two halves that feed each other: a chat advisor and a live map.
The advisor. Type "Should I go out today?" and it asks which town you mean. Say "Kharagpur" and you get the current AQI (159, Moderate, mostly PM2.5), what that means for the average person and for sensitive groups, and practical advice. It also handles quick questions like "Can I go for a run now?", "Best time to go out?" and "Do I need a mask?". Every answer says that the numbers are model estimates, not readings from a sensor near you, and that it is general information, not medical advice.
The map. A live map of India shows the AQI for cities across the country, colour-coded on the CPCB scale. You can switch the layer to PM2.5, PM10, NO₂, SO₂, O₃, CO, dust or UV, flip the map into a heatmap, or turn on NASA night-lights imagery.
Any place. Search a town, use "Near me", or click anywhere on the map. The place panel shows all six pollutants with their own index, a 24-hour average (the CPCB method), and a 96-hour chart covering the past 48 hours and the next 48.
Email alerts. Ask the advisor to alert you about a place and the site emails you about it. Each address gets up to three alerts, for 30 days.
How the pieces fit together
When you ask a question, API Gateway hands it to one Lambda, which runs the agent and calls the tools. Every 3 hours EventBridge wakes a second Lambda that scores 412 cities and stores the result, so the map reads stored data rather than waiting on a live fetch. CloudWatch alarms and SNS alerts run alongside.
How we used AWS
The whole backend is serverless and deploys from one AWS SAM template into us-east-1. There are no servers to manage.
AWS service | What it does here |
|---|---|
API Gateway | HTTP API in front of everything: the site, /stations, /lookup, /series, /alert and /chat |
Lambda (site + API + advisor) | Serves the site and API and runs the AI advisor, with a rules-engine fallback if the model is unavailable |
Lambda (ingest) | Fetches and scores 412 cities with CPCB AQI, then checks alerts |
EventBridge | A schedule rule that starts the ingest Lambda every 3 hours |
DynamoDB | Latest readings (with a TTL), alerts and daily call caps |
S3 | A snapshot of the data for the map |
SNS | Email alerts, one filtered subscription each, plus an ops topic for alarms |
Systems Manager Parameter Store | The LLM API key, stored as a SecureString |
CloudWatch | Five alarms on both Lambdas and the bill: errors, refresh stopped, traffic spike |
The parts that are not on AWS: Open-Meteo supplies the air-quality data (the Copernicus CAMS model), Groq runs the open-weight gpt-oss-120b model, and OpenStreetMap and NASA GIBS supply map tiles and night-lights imagery.
Design choices we'd defend
Ground the AI in real data. The advisor is an agent built with Strands Agents. It has five tools, and the tools fetch real data, so the model explains numbers instead of inventing them. If the model can't be reached, a rules engine still answers. A visitor never sees an empty chat.
Be honest about the data. We first looked at OpenAQ's station data for India and found most of it stale. We chose Open-Meteo's Copernicus CAMS model instead, which gives consistent coverage everywhere, including small towns with no sensor. The trade-off is that these are estimates, so the site says so in every answer: model estimates, not readings from a sensor near you.
Keep the data fresh without hammering anyone's API. The ingest Lambda refreshes 412 cities every 3 hours and the website reads the stored result. Visitors don't each trigger a fetch for the map. Single-place lookups and 48-hour series go live to Open-Meteo, and the heatmap grid is fetched by the browser directly, so nothing is stored for it.
Build a cost guard in from day one. A public site with an LLM behind it can get expensive fast. DynamoDB holds daily call caps, readings expire with a TTL, and CloudWatch alarms watch errors, a stalled refresh, traffic spikes and the bill itself. They notify us through SNS by email.
What we took away, and what's next
- Serverless fits a hackathon. One SAM template, a handful of managed services and no servers to look after meant our time went into the product.
- An AI answer is only as good as its tools. Giving the agent real data tools mattered more than the choice of model.
- Say what your data is. Labelling the numbers as model estimates costs nothing and keeps the advice honest.
Next, we want to go back to live station data from CPCB and blend it with the model so the numbers sit even closer to what's really in the air, alongside the past and future data the site already shows.
Live site: add your link here. The demo video walks through the advisor, the map and the architecture in under three minutes.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article