PromptWars · Challenge 06 Vayu · Family Air Quality Assistant Rule Engine + Gemini 3.5 Flash-Lite

Today's air, planned around your family.

Enter your city and today's AQI, add your family profile and home setup, and get a personalised, low-emission day plan — morning to night — where the rule engine computes every number and Gemini 3.5 Flash-Lite explains it in plain language.

Honest data note: AQI values here are entered by you, chosen from indicative presets, or fetched live from Open-Meteo (a CAMS model estimate, not a ground-station sensor reading). The authoritative reading is your city's official CPCB / state board bulletin.

Your household today

Takes about 20 seconds. Everything updates the plan, prompt and theme instantly.

City — search across 42 cities

Location is used only in your browser to pick the nearest city and fetch its AQI. It is never stored or sent anywhere else.

Showing: Hyderabad · bands use the Indian CPCB scale for every city

Quick picks

Today's AQI (Indian CPCB scale, 0–500 · 500+ if beyond index)

The slider caps at 500 (top of the Indian CPCB scale). Type up to 999 in the number box — anything over 500 shows as 500+ — Beyond Index and clamps to Hazardous (401–500). .

Who is at home? (tap all that apply)

Rule engine computes all numbers locally; optional Gemini 3.5 Flash-Lite writes the summary.

118AQI · INDIAN CPCB SCALE

Unhealthy for Sensitive Groups

Hyderabad · indicative preset

What this means for your household

    Indian CPCB scale bands

    Your personalised day plan

    Built from your Indian CPCB AQI band, family profile and home setup.

    Your plan will appear herePick your city and AQI on the left, then tap "Generate my day plan". Try AQI 118 vs. 320 or 550 to see how sharply the advice adapts.

    How it works — rule engine + Gemini 3.5 Flash-Lite

    Every number is computed deterministically by the rule engine before Gemini 3.5 Flash-Lite writes the plain-language family summary.

    1. 1 · Ground the inputsCity (from 42 built-in cities), AQI value (preset, live from Open-Meteo, or manually entered), family sensitivities, commute, cooking fuel, home type and purifier access are captured as structured slots.
    2. 2 · Classify on the Indian CPCB scaleAQI 0–500 maps to six CPCB bands; readings above 500 display as "500+ — Beyond Index" and clamp to Hazardous (401–500).
    3. 3 · Compute actions & stats deterministicallyVulnerability rules layer morning, commute, indoor, evening and sustainable actions — each with a rule-computed PM2.5 %, kg CO₂, or health impact.
    4. 4 · Send exact grounded prompt to Gemini 3.5 Flash-Litegemini-3.5-flash-lite receives the exact rule-engine stats and action list shown on the right, instructed to explain in plain language without inventing numbers.
    5. 5 · Stay honest about data & estimatesPresets are labelled indicative, live AQI is labelled as a CAMS model estimate (not a ground-station reading), user-entered values are marked as such, and all impacts are labelled planning estimates.

    Exact prompt sent to Gemini 3.5 Flash-Lite

    Inspect the exact system_instruction and user prompt sent to gemini-3.5-flash-lite — updates live with every change on the left.

    
            

    README — architecture, prompt design & setup

    Vayu · PromptWars Virtual Challenge 06 · Hack2Skill × Google for Developers

    Architecture

    • Standalone web app — index.html, styles.css, rule-engine.js, gemini.js, and app.js; works directly from disk (file://) or any static host.
    • Indian CPCB rule engine — classifies 0–500 into six bands (0–50, 51–100, 101–200, 201–300, 301–400, 401–500) and clamps readings over 500 to Hazardous (401–500) as "500+ — Beyond Index".
    • Live AQI via Open-Meteo — fetches current PM2.5 & PM10, converts to Indian CPCB AQI using standard sub-index interpolation. Labelled as a CAMS model estimate, not a ground-station reading.
    • Bold solid Google theming — solid surfaces, thick ink borders, hard shadows (no glass/blur), using only #34A853, #FBBC05, #EA4335 and #4285F4, with prefers-reduced-motion support and click-ripple ring only.

    Gemini 3.5 Flash-Lite & Prompt Design

    • Rule engine computes numbers — exposure %, kg CO₂ saved, and outdoor minutes avoided are computed in rule-engine.js, never by the LLM.
    • Gemini 3.5 Flash-Lite explains & personalises — gemini.js sends the exact grounded prompt to gemini-3.5-flash-lite to produce a warm, plain-language summary.
    • Graceful fallback — works immediately with no API key using a deterministic local summary, or live with any user-provided Gemini API key stored only in browser session memory.

    Live Data & Privacy

    • Live AQI (Open-Meteo) — current PM2.5 & PM10 auto-fetched on city select and converted to Indian CPCB AQI; labelled as a CAMS model estimate, never a ground-station reading. Refresh button, manual override with "Use live AQI" restore.
    • Location detector — "Detect my location" finds the nearest city in the directory; location is used only in your browser and never stored or sent anywhere else.
    • Your key stays yours — the optional Gemini API key lives in browser session memory only and is never hardcoded, logged, or sent anywhere except the Gemini API.