Skip to content

pvishalkeerthan/ClimateOS

Repository files navigation

ClimateOS — A Decision Engine, Not a Tracker

"Climate tools don't have a data problem. They have a decision problem."

ClimateOS is a constraint-aware decision engine built to help individuals move from awareness to prioritized action. Instead of just showing you what you already did wrong (tracking), it simulates future impact and returns a ranked, resource-aware action playbook.

banner-1 banner-2


⚡️ The Core Premise

Most climate products fall into two failure modes:

  1. Carbon Trackers: Dashboards that emphasize past mistakes.
  2. Generic AI Wrappers: Unranked tips without context or constraints.

ClimateOS answers the only question that matters: Given my life, my budget, and my time — what should I do next?


🧠 The Hybrid Engine — Core Technical Decision

The defining feature of ClimateOS is its Hybrid Inference Pipeline. Pure LLMs are prone to "carbon hallucinations" (inconsistent math), while pure heuristic systems lack contextual reasoning. We split the labor:

Layer 1: Deterministic Heuristics

All emissions are computed with fixed factors before the AI ever sees the data.

  • Reproducibility: Same inputs always produce the same baseline.
  • Explainability: Every number has a traceable, non-stochastic source.
  • Math Safety: Gemini never performs arithmetic; it only reasons about the results.

Layer 2: Gemini 2.0 Flash (Reasoning Engine)

Gemini receives the computed data and performs four specific high-level tasks:

  1. Ranking: Selects top actions by impact-to-effort ratio.
  2. Constraint Filtering: Removes options outside the user’s budget or time window.
  3. Tradeoff Analysis: Surfaces real downsides (e.g., upfront costs vs. long-term savings).
  4. Rejection Reasoning: Explains why certain typical "green" tips were excluded for your specific case.

Layer 3: Real-Time Simulation

The same heuristic functions from the backend run in the browser. Slider changes trigger useMemo recalculations in sub-100ms, allowing for zero-latency exploration.


🚀 Key Features

  • The Hero Action: A single, highest-ROI change called out separately. No decision fatigue.
  • Constraint-Aware Planning: Inputs for Budget (Low/Med/High) and Time (Low/Med/High) filter the AI's reasoning.
  • Real-Time Simulator: Adjust your commute, diet, or energy mix and see your score transition (e.g., 42 → 86) instantly.
  • Collective Impact Engine: Scales personal choices to a city-wide frame ("If 10,000 people did this...").
  • Shareable Impact Card: Export a high-fidelity PNG of your plan via html-to-image.

🛠 Tech Stack

  • Frontend: Next.js 15 (App Router), React 19, Framer Motion
  • Styling: Tailwind CSS (Modern/Brutalist Aesthetic)
  • AI Layer: Google Gemini 2.0 Flash
  • Validation: Zod (Strict schema enforcement on both Input and AI Output)
  • Persistence: LocalStorage (No database overhead, instant state)
  • Export: html-to-image

🚦 Getting Started

Prerequisites

  • Node.js 18+
  • A Google AI Studio API Key (for Gemini)

Installation

  1. Clone the repository:

    git clone https://github.com/[your-username]/climateos.git
    cd climateos
  2. Install dependencies:

    pnpm install
  3. Setup environment variables: Create a .env.local file in the root:

    GEMINI_API_KEY=your_api_key_here
    AUTH0_SECRET=your_secret_here
    AUTH0_BASE_URL=http://localhost:3000
    AUTH0_ISSUER_BASE_URL=your_issuer_base_url_here
    AUTH0_CLIENT_ID=your_client_id_here
    AUTH0_CLIENT_SECRET=your_client_secret_here
  4. Run the development server:

    pnpm run dev

Open http://localhost:3000 to start your plan.


🗺 Roadmap

  • Persistent Backend: Migration to Postgres/Supabase for long-term action tracking.
  • Geo-Specific Factors: Integration with Electricity Maps API for real-time grid intensity.
  • Habit Loops: Weekly check-ins tied to your Hero Action.
  • Dynamic OG Images: Server-side generation for even better social sharing.

🛡 Security & Validation

We use Zod to enforce a strict contract between the AI and the UI. If Gemini returns malformed JSON or invalid types, the system automatically catches the error and falls back to a purely deterministic action generator, ensuring the app never breaks for the user.


About

ClimateOS is a constraint-aware decision engine that moves beyond simple carbon tracking to provide prioritized, resource-aware action plans.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages