Skip to content

DhanushN2005/EcoPluse-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฟ EcoPulse AI: Real-Time Environmental Intelligence

EcoPulse Hero Banner

EcoPulse AI CI Python Version License: MIT Code Style: Black Streaming Broker

EcoPulse AI is a next-generation environmental health awareness platform. It combines high-performance streaming analytics with Generative AI to provide "living" city intelligenceโ€”interpreting complex sensor data into actionable human safety protocols.

Explore Documentation ยท Report Bug ยท Request Feature


๐Ÿ“‘ Table of Contents


๐ŸŒŽ Project Overview

Traditional environmental monitoring systems provide static, historical data. EcoPulse AI bridges the gap by treating environmental data as a continuous stream. It doesn't just tell you the AQI was bad 2 hours ago; it uses Pathway to detect momentum peaks as they happen and OpenAI GPT-4o to issue immediate, intelligent safety mandates.

The system is designed for city administrators, health officials, and citizens who need real-time, scientifically-backed environmental guidance.


๐Ÿ—๏ธ System Architecture

Our architecture is designed for low-latency event processing and scientific reasoning.

graph TD
    subgraph "Data Generation Layer"
        P[Kafka Producer Simulator] -->|JSON Telemetry| K[Apache Kafka]
    end

    subgraph "Processing Layer (Pathway)"
        K -->|Poll Stream| PW[Pathway CEP Engine]
        PW -->|Feature Extraction| AN[Analytics Module]
        AN -->|Volatility/Momentum| DB[(Live State)]
    end

    subgraph "Intelligence Layer"
        DB -->|Context| COP[Climate Copilot RAG]
        COP -->|Reasoning| API[Flask Web Service]
    end

    subgraph "Consumer Layer"
        API -->|Dashboards| UI1[City Admin View]
        API -->|PDF Reports| UI2[Gov Reporting]
    end
Loading

๐Ÿš€ Key Features

  • โšก Real-Time Stream Processing: Sub-second analysis of AQI, PM2.5, CO2, and Meteorological factors using Pathway.
  • ๐Ÿง  Climate Copilot (RAG Integration): A context-aware AI safety officer that interprets live data to provide human-readable advice.
  • ๐Ÿ“‰ Root Cause Attribution: Scientifically calculates the percentage impact of Traffic vs. Industry on current pollution levels.
  • ๐Ÿฆ Gov-Grade Reporting: Export professional "Mayor Briefings" or "Full Environmental Audits" in PDF format instantly.
  • ๐ŸŒก๏ธ Adaptive Alerts: Dynamic thresholds that adjust based on peak hours and historical volatility.
  • ๐Ÿ”ฎ Urban Simulations: "What-if" scenarios to predict AQI based on hypothetical traffic reductions or industrial restrictions.

๐Ÿ“‚ Folder Structure Explanation

The repository follows an enterprise-grade modular structure:

  • ecopulse_ai/: Root package.
    • api/: The Presentation Layer. Contains Flask routes, user models, and the orchestration factory (app.py).
    • analytics/: The Core logic. Standalone scientific modules for calculating health scores, alerts, and time-series predictions.
    • kafka/: Infrastructure. Contains the producer script that simulates a multi-sensor city-wide mesh.
    • streaming/: The Data Backbone. Contains the Pathway pipeline logic and the "Windows Shim" for local development compatibility.
    • rag/: AI Intelligence. Prompt definitions and LLM orchestration for the Climate Copilot.
    • reports/: Documentation Layer. Logic for PDF generation and muni-report styling.
    • templates/ & static/: Frontend assets for the Flask web application.
    • tests/: Quality Assurance. Organized into unit and integration suites.

๐Ÿงฉ Modular Design Principles

EcoPulse AI adheres to strict Senior Engineering standards:

  1. Separation of Concerns: Analytics logic is decoupled from transport layers (Kafka/Pathway).
  2. Stateless API: The Web layer acts as a pure proxy to the streaming state, ensuring horizontal scalability.
  3. Defensive Programming: All telemetry inputs are validated and cast safely before computation.
  4. Logging > Printing: Industry-standard logging is used across all modules for a professional audit trail.

๐Ÿ› ๏ธ Tech Stack

Layer Tools
Streaming Engine Pathway (Complex Event Processing)
Data Broker Apache Kafka (High-throughput Messaging)
Logic Server Flask 3.x, Python 3.10+
AI Reasoning OpenAI GPT-4o, Custom RAG Orchestration
Frontend Vanilla CSS (Glassmorphism), Chart.js 4.0, Leaflet.js
Reporting fpdf2 (High-precision document generation)

๐Ÿš€ Getting Started

1. Prerequisites

  • Python 3.10+
  • A running Kafka broker (Local or Cloud-based)
  • OpenAI API Key (for Copilot and Planner features)

2. Installation

# Clone the repository
git clone https://github.com/DhanushN2005/EcoPluse-AI.git
cd EcoPluse-AI

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

3. Configuration

Create a .env file in the root directory:

OPENAI_API_KEY=sk-xxxx...
KAFKA_BOOTSTRAP_SERVERS=localhost:9092
DEBUG=True

๐Ÿ–ฅ๏ธ Example Usage

Launching the System

Launch the unified orchestrator to start all micro-services simultaneously:

python main.py

Typical Workflow

  1. Monitor: Observe the live AQI gauges on the dashboard.
  2. Simulate: Use the "What-if" slider to see how a 50% reduction in traffic would affect city-wide health scores.
  3. Query: Ask the Copilot: "Should schools in the Industrial North district stay open today?"
  4. Report: Push the "Generate Audit" button to export a signed PDF briefing for legislative review.

๐Ÿ”ฎ Future Improvements

  • ๐Ÿ“ก IoT Edge Support: Direct MQTT ingestion for real-world sensor integration.
  • ๐Ÿ“ฑ Mobile Companion: React Native App for citizen-level push notifications.
  • ๐ŸŒฆ๏ธ Weather Integration: Correlation models between humidity/pressure and pollutant entrapment.
  • ๐Ÿ›๏ธ Blockchain Archiving: Immutable storage of environmental incident logs for policy accountability.

๐Ÿงช Development & Quality

We maintain a strict Elite Quality Standard:

  • Linting: Strict PEP8 adherence via Flake8.
  • Format: Automated Black formatting.
  • Type Safety: 100% coverage with Python Type Hints.
  • Testing: Run pytest tests/ to ensure numerical accuracy of analytics.

โš–๏ธ License

Distributed under the MIT License. See LICENSE for details.


Built with โค๏ธ by Dhanush N
Empowering Cities with Real-Time Environmental Vision.


This repository has undergone a Final Quality Review and Senior Engineering Refactor (Feb 2026).

About

EcoPluse AI is a real-time environmental intelligence platform that predicts air pollution before it becomes critical, generating AI-powered action plans for proactive smart city decision-making.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors