Skip to content

WIBD-Vadodara/Genex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WeatherWise AI - Intelligent Weather-Aware Activity Planner

Team Name: Genex

WiBD GenAI Hackathon 2026


Problem Statement

Problem Statement Number: 5

Problem Statement Title: AI-Powered Weather-Aware Activity Planning System

Project Overview

WeatherWise is an intelligent conversational agent that solves the problem of uncertainty in outdoor activity planning due to unpredictable weather conditions.

What problem are we solving?

People often struggle to decide whether weather conditions are suitable for their planned outdoor activities, leading to:

  • Cancelled events due to poor weather
  • Safety risks from inadequate preparation
  • Missed opportunities on perfect weather days

Who is it for?

  • Outdoor enthusiasts planning recreational activities
  • Event organizers scheduling outdoor events
  • Families planning picnics, trips, and gatherings
  • Sports teams scheduling practices and games

Why is it useful?

  • Real-time risk assessment with 0-100 risk scores
  • Personalized recommendations based on activity type and weather
  • Smart packing lists tailored to conditions
  • Backup plan suggestions when weather is unfavorable
  • Natural conversation interface - no complex forms
  • Instant validation - rejects past dates and fictional locations

WeatherWise transforms weather data into actionable decisions using a backend-controlled conversation state machine that gathers information incrementally, validates inputs deterministically, and generates comprehensive plans with professional dashboard visualization.

Key Features

State Machine Conversation

  • Backend controls all conversation logic (NO LLM conversation control)
  • Incremental information gathering (activity β†’ location β†’ date)
  • Partial updates allowed (fill in missing pieces naturally)
  • LLM called only once when all inputs are complete
  • Follow-up questions answered without LLM calls
  • Context-aware conversations with session memory

Intelligent Architecture

  • Regex-based entity extraction (NO LLM for parsing)
  • Deterministic input validation (past dates, >7 days, invalid cities)
  • Structured response format: {status, chat_reply, dashboard}
  • Session state tracking: WAITING_ACTIVITY β†’ WAITING_LOCATION β†’ WAITING_DATE β†’ READY
  • Efficient LLM usage with strict JSON prompts

Professional Dashboard

  • 2-Column Layout: Live chat interface + Real-time analytics
  • Weather Summary Card: Temperature, humidity, wind speed, precipitation
  • Feasibility Assessment: Excellent/Good/Moderate/Poor/Not Recommended
  • Risk Analysis: Score (0-100) with identified risk factors
  • Best Time Recommendations: Optimal time windows based on conditions
  • Smart Packing List: Activity + weather-based suggestions
  • Backup Plan Card: Alternative options for risky conditions

Weather Risk Calculation

  • LLM-generated risk scores based on activity type and weather
  • Risk factors identified (heat, rain, wind, humidity)
  • Verdict with clear explanation
  • Activity-specific feasibility assessment

Smart Date Handling

  • Natural language date resolution (today, tomorrow, this weekend)
  • Past date rejection with clear messaging
  • 7-day forecast limit enforcement
  • ISO format date storage (YYYY-MM-DD)

Real-Time Weather Data

  • Open-Meteo API integration (free, no API key)
  • Geocoding for 47+ Indian cities
  • Multi-day forecast support
  • Comprehensive hourly weather metrics

Architecture / Approach

System Design

WeatherWise uses a deterministic state machine architecture where the backend controls all conversation logic, ensuring predictable behavior and efficient LLM usage.

User Message
    ↓
[1] Entity Extraction (Regex-based, NO LLM)
    ↓
[2] Session Update (Partial updates allowed)
    ↓
[3] Location Validation (API-based, with blacklist)
    ↓
[4] Date Validation (Past rejection, 7-day limit)
    ↓
[5] Completeness Check
    ↓
β”œβ”€ Missing field? β†’ Ask clarification (Backend decides)
β”œβ”€ Invalid input? β†’ Return error (Deterministic rules)
└─ Complete? β†’ [6] Weather API β†’ [7] LLM (ONCE) β†’ [8] Formatted Plan

Key Design Principles

  1. Backend-Controlled State Machine

    • NO LLM for conversation control
    • 4 states: WAITING_ACTIVITY β†’ WAITING_LOCATION β†’ WAITING_DATE β†’ READY
    • Deterministic transitions based on entity presence
  2. Regex-Based Entity Extraction

    • Activity: 14+ outdoor activities (picnic, hiking, beach, etc.)
    • Location: 47+ Indian cities with geocoding validation
    • Date: Natural language (today, tomorrow, this saturday, etc.)
    • Time Preference: morning, afternoon, evening, night
  3. Strict Validation Rules

    • Past time detection: "yesterday", "last week", "2 days ago"
    • Far future rejection: >7 days ahead
    • Fictional city blacklist: wakanda, asgard, narnia, hogwarts, etc.
    • Real location validation via geocoding API
  4. Efficient LLM Usage

    • LLM called ONLY ONCE when all inputs complete
    • Strict JSON response format enforced
    • Follow-up questions answered from stored plan (NO LLM)
  5. Multi-Provider Fallback

    • Primary: Google Gemini Pro
    • Fallback 1: Groq Llama 3.3 70B
    • Fallback 2: Ollama (local)

Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User      β”‚
β”‚  (Browser)  β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚ HTTP
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  dashboard.html β”‚ ◄── Frontend (Vanilla JS)
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚ POST /ask
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   FastAPI       β”‚
β”‚   api.py        β”‚ ◄── REST API
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Conversation Manager            β”‚
β”‚  (State Machine Controller)      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β€’ Entity Extractor (Regex)      β”‚
β”‚ β€’ Validator (Rules)              β”‚
β”‚ β€’ Response Formatter             β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚
      β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ί Weather Fetcher ──► Open-Meteo API
      β”‚
      └──────────► Planner Service ──► Gemini / Groq / Ollama
                   (LLM - ONCE)

Repository Structure

weather_wise/
β”œβ”€β”€ api.py                          # FastAPI backend server
β”œβ”€β”€ dashboard.html                  # Professional dashboard UI
β”œβ”€β”€ requirements.txt                # Python dependencies
β”œβ”€β”€ .env                            # Environment variables (not in git)
β”œβ”€β”€ .env.example                    # Template for API keys
β”œβ”€β”€ .gitignore                      # Git ignore rules
β”œβ”€β”€ README.md                       # Project documentation
β”œβ”€β”€ SETUP.md                        # Quick setup guide
β”‚
β”œβ”€β”€ core/                           # Core business logic
β”‚   β”œβ”€β”€ conversation_manager.py    # State machine controller
β”‚   β”œβ”€β”€ entity_extractor.py        # Regex-based entity extraction
β”‚   β”œβ”€β”€ validator.py               # Input validation rules
β”‚   β”œβ”€β”€ planner_service.py         # Weather + LLM planning
β”‚   β”œβ”€β”€ response_formatter.py      # Response schema formatter
β”‚   β”œβ”€β”€ weather_fetcher.py         # Open-Meteo API client
β”‚   β”œβ”€β”€ response_generator.py      # Legacy response module
β”‚   β”œβ”€β”€ risk_calculator.py         # Risk scoring logic
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ config/                         # Configuration
β”‚   └── settings.py                # Environment config
β”‚
β”œβ”€β”€ utils/                          # Utility functions
β”‚   β”œβ”€β”€ helpers.py                 # Date parsing, validation
β”‚   β”œβ”€β”€ intent_classifier.py       # Intent classification
β”‚   β”œβ”€β”€ memory.py                  # Session management
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ prompts/                        # LLM prompt templates
β”‚   β”œβ”€β”€ intent_extraction.txt
β”‚   β”œβ”€β”€ response_generation.txt
β”‚   └── weather_advisor.txt
β”‚
β”œβ”€β”€ data/                           # Data storage
β”‚   └── conversations.json         # Conversation logs
β”‚
└── test_state_machine.py          # State machine tests

πŸ‘₯ Team Members

Team Genex

  1. Niyati Shah - @ShahNiyati | shahniyati349@gmail.com
  2. Dhairyati Pandya - @Dhairyati | pandyadhairyati@gmail.com
  3. Ishita Prajapati - @IshitaPrajapati01 | ishitaprajapati024@gmail.com
  4. Pia Patel - @Pia-07 | 23cs073@charusat.edu.in
  5. Jayti Shah - @jaytishah | jaytishah20@gmail.com


πŸ“ Notes / Assumptions

Assumptions

  • Users plan activities within 7-day forecast window
  • Activity types are limited to 14 outdoor categories
  • Indian cities primarily supported (47+ cities)
  • Sessions stored in-memory (single user demo)

Limitations

  • Weather API provides data for 16 days maximum
  • Gemini Pro may have rate limits on free tier
  • Session data cleared on server restart
  • No user authentication system

Future Improvements

  • Multi-user support with Redis session storage
  • User authentication and saved preferences
  • Historical weather data analysis
  • Mobile app with push notifications
  • Integration with calendar apps
  • Support for international cities
  • Weather alerts and warnings
  • Activity recommendation engine based on user history

πŸš€ Setup Instructions

Prerequisites

  • Python 3.13+ (recommended) or Python 3.10+
  • pip package manager
  • Google API key (for Gemini)
  • Groq API key (optional, for fallback)

Steps to Run Locally

1. Clone the repository

git clone https://github.com/YOUR_USERNAME/weather_wise.git
cd weather_wise

2. Install dependencies

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

3. Add environment variables

Create a .env file in the project root:

cp .env.example .env

Edit .env and add your API keys:

# Get API key from https://makersuite.google.com/app/apikey
GOOGLE_API_KEY=your_google_api_key_here

# Optional: Get from https://console.groq.com/
GROQ_API_KEY=your_groq_api_key_here

4. Run the application

python api.py

The API will start at http://localhost:8000

5. Open the dashboard

Open dashboard.html in your browser:

open dashboard.html  # macOS
start dashboard.html  # Windows
xdg-open dashboard.html  # Linux

Or manually navigate to:

file:///path/to/weather_wise/dashboard.html

API Endpoints

  • POST /ask - Send user query, receive plan
  • GET /health - Check session state
  • GET /reset - Reset conversation session
  • GET /docs - FastAPI interactive documentation

Quick Test

curl -X POST http://localhost:8000/ask \
  -H "Content-Type: application/json" \
  -d '{"query": "plan picnic tomorrow in Mumbai"}'

πŸ’‘ Usage Examples

Incremental Conversation

User: "I want to plan a picnic"
Bot: "Where are you planning this picnic?"
User: "Mumbai"
Bot: "When are you planning this picnic in Mumbai?"
User: "Tomorrow"
Bot: βœ… [Fetches weather, calls LLM once, returns plan]

Complete Input

User: "Plan hiking tomorrow in Bangalore"
Bot: βœ… [Extracts all entities, fetches weather, calls LLM once, returns plan]

Follow-up Questions (NO LLM)

User: "Plan beach visit in Chennai tomorrow"
Bot: βœ… [Returns plan with dashboard]
User: "Why?"
Bot: "Here's why: High UV index, Hot temperature, Low wind"
User: "What should I carry?"
Bot: "You should carry: Sunscreen, Hat, Water bottle, Sunglasses"
User: "Backup plan?"
Bot: "Visit in early morning (6-9 AM) when temperatures are cooler"
User: "What should I pack?"
β†’ Generates activity + weather-based packing list from stored plan

City Comparison

User: "Should I go hiking in Denver or Boulder tomorrow?"
β†’ Fetches weather for both cities, compares risk scores

Conversational Follow-ups

User: "Plan picnic tomorrow in Mumbai"
Agent: "βœ… Analysis complete..."
User: "Why not the day after?"
β†’ Explains reasoning for date recommendation

πŸ”§ Tech Stack

Programming Language

  • Python 3.13.3 - Core backend development

Frameworks / Libraries

  • FastAPI - RESTful API backend
  • Uvicorn - ASGI server
  • Pydantic - Data validation
  • Requests - HTTP client

LLMs / APIs

  • Google Gemini Pro - Primary LLM for plan generation
  • Groq Llama 3.3 70B - Fallback LLM provider
  • Ollama - Local LLM fallback (offline support)
  • Open-Meteo API - Weather data and geocoding (free, no auth required)

Frontend

  • Vanilla JavaScript - Interactive dashboard
  • HTML5/CSS3 - Modern UI with dark theme
  • TailwindCSS concepts - Responsive design

Database / Vector Store

  • In-memory session storage - Demo implementation (production: Redis recommended)

Deployment

  • Local development - Python FastAPI server
  • Production ready - Can be deployed to Heroku, Railway, or Docker

🎨 Dashboard Features

Dark Gradient Theme

  • Colors: #0B1026 β†’ #121A3A β†’ #1B2A6B
  • Effects: Glass morphism, neon borders, hover animations
  • Typography: Modern sans-serif with proper hierarchy

Responsive Cards

  • Weather Summary (4-metric grid)
  • Suitability Score (circular gauge with color coding)
  • Agent Reasoning (step-by-step transparency)
  • Best Time (time window recommendations)
  • What to Carry (dynamic packing list)
  • Backup Plan (shown only when risk > 60)

πŸ›‘οΈ Security

  • βœ… All API keys stored in .env (git-ignored)
  • βœ… No hardcoded credentials in source code
  • βœ… Environment variable validation at runtime
  • βœ… .env.example provides safe template
  • βœ… Comprehensive .gitignore for sensitive files

🀝 Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ“œ Submission Declaration

This project was developed as part of WiBD GenAI Hackathon 2026.

All code was written during the hackathon period by Team Genex. We confirm that:

  • The solution is original and developed from scratch
  • All external APIs and libraries are properly credited
  • The codebase follows best practices and is production-ready
  • Documentation is comprehensive and accurate

πŸ™ Acknowledgments

  • Open-Meteo - Free weather API with no authentication
  • Google Gemini - Advanced LLM capabilities
  • Groq - Fast LLM inference
  • FastAPI - Modern Python web framework
  • WiBD - Organizing the GenAI Hackathon 2026

Built with by Team Genex for WiBD GenAI Hackathon 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors