๐ AirSense โ Multi-Agentic Air Quality Trends Analysis System
AirSense is a full-stack air quality monitoring and analytics platform designed to transform fragmented environmental data into actionable insights.
The system aggregates multi-source PM2.5 and PM10 data, performs comparative analytics, delivers AI-powered forecasts, and enables natural-language analytics through an LLM-based planning agent.
This project was developed as a collaborative group project at SLIIT for the Information Retrieval and Web Analytics (IT3041) module.

๐ Key Features

๐ Multi-Source Data Aggregation
- Scrapes hourly air quality data from Open-Meteo, OpenAQ, IQAir, and WAQI
- Applies weighted aggregation with outlier trimming to ensure reliable data
- Persists clean, aggregated time-series data in MySQL
๐ Advanced Analytics
- Multi-city comparison with KPIs (mean, min, max PM levels)
- Best vs worst city ranking
- Part-to-whole and trend-based analysis
๐ AI-Powered Forecasting
- Time-series forecasting using SARIMAX
- Confidence intervals and backtesting (MAE, RMSE)
- Single-city and multi-city prediction support
๐ค LLM-Based Planning Agent (Enterprise Tier)
- Natural-language queries converted into executable analysis plans
- Uses a critic-based reflection pattern to ensure security and capability limits
- Transparent execution traces for explainability
๐ Security & Tiered Access
- JWT-based authentication with bcrypt password hashing
- Subscription tiers: Free, Pro, Enterprise
- Plan-based enforcement of data windows, city limits, and forecast horizons
๐งพ Professional Reporting
- Auto-generated PDF reports with charts and KPI tables
- Server-side rendering using ReportLab
๐งฑ System Architecture
AirSense follows a four-layer architecture:
- Presentation Layer โ React SPA with interactive charts
- Application Layer โ FastAPI backend with modular routers
- Data Layer โ MySQL + SQLAlchemy ORM
- Intelligent Agent Layer โ LLM planner with MCP-style tool orchestration
This architecture enables scalability, security, and clear separation of concerns :contentReference[oaicite:1]{index=1}.
๐ ๏ธ Tech Stack
- Frontend: React, Tailwind CSS, Recharts
- Backend: FastAPI (Python), Uvicorn
- Database: MySQL, SQLAlchemy
- AI / Analytics: SARIMAX, LLM (Ollama / Gemma), Agent Planning
- Security: JWT, bcrypt
- Reporting: ReportLab (PDF generation)
๐ง Responsible AI Practices
- Fairness: Multi-source aggregation to reduce sensor bias
- Explainability: Interpretable SARIMAX models + execution traces
- Transparency: Visible data sources, KPIs, and agent steps
- Privacy: No personal location tracking; secure credential handling







๐ฅ Team & Leadership
Team Leader & Full-Stack Integration Architect:
Hirusha D G A D (IT23183018)
Key contributions include:
- AI forecasting engine & backtesting
- LLM agent design and orchestration
- Authentication & tier enforcement
- System-wide integration and documentation leadership
(Full contribution breakdown available in the final report) :contentReference[oaicite:2]{index=2}.
๐ฏ Academic Context
- Institution: Sri Lanka Institute of Information Technology (SLIIT)
- Module: IT3041 โ Information Retrieval and Web Analytics
- Year: 2025
- Project Type: Group Project (Industry-oriented system)
๐ Future Enhancements
- Real-time alerts for pollution thresholds
- Additional data sources & ML models
- Extended agent reasoning capabilities
- Cloud deployment and CI/CD pipelines
๐ License
This project is released for academic and learning purposes.