CloudPilot AI: Project Story

🌟 The Inspiration

The genesis of CloudPilot AI emerged from a stark realization: cloud infrastructure costs are growing exponentially, yet most organizations lack intelligent visibility into where their money is actually going.

During research into enterprise FinOps challenges, I discovered that companies typically lose 20-35% of their cloud budgets to waste—forgotten staging environments, orphaned storage volumes, overprovisioned databases, and runaway autoscaling incidents. Most critically, manual cost optimization is reactive, not proactive. Teams spend weeks analyzing logs only to find out problems already cost them thousands.

The inspiration crystallized around a single question: What if an AI system could autonomously scan your entire multi-cloud infrastructure 24/7, detect anomalies in real-time, and provide CFO-ready optimization guidance without human intervention?

CloudPilot AI was born to answer that question.


🏗️ What We Built

CloudPilot AI is a full-stack, autonomous FinOps intelligence platform designed to:

  1. Autonomously scan multi-cloud workloads across AWS, GCP, and Azure infrastructure
  2. Detect spend anomalies through real-time telemetry and heuristic analysis
  3. Provide AI-powered optimization recommendations using Google Gemini
  4. Generate executive reports ready for CFO boardroom reviews
  5. Enable interactive advisory through an AI CFO chat terminal

See the live demo to explore the full platform.

Core Architecture

The system operates as a three-tier full-stack application:

┌────────────────────────────────────────────────────────┐
│                      Client (SPA)                      │
│ React 18 + Vite + Tailwind CSS + Lucide Icons + Motion │
└───────────┬────────────────────────────────┬───────────┘
            │                                │
            │ REST                           │ REST
            │ (Investigation)                │ (CFO Advisory Chat)
            │                                │
┌───────────▼────────────────────────────────▼───────────┐
│                     Express Server                     │
│       Dynamic Routes, CORS, Secure API proxying        │
│         Arize Phoenix OTel Tracing (Optional)          │
└──────────────────────────┬─────────────────────────────┘
                           │
                           │ @google/genai TypeScript SDK
                           │
┌──────────────────────────▼─────────────────────────────┐
│          Gemini AI Resiliency Engine (Server)          │
│  ✔ 3-Stage Auto-Retry        ✔ gemini-2.5-flash        │
│  ✔ Exponential Backoff       ✔ Fallback: gemini-2.0-flash│
│  ✔ Deterministic Local Rules Heuristics               │
└────────────────────────────────────────────────────────┘

Key Components:

  • Executive Dashboard: KPI cards, cost visualization charts, real-time agent execution timelines
  • Resource Grid: Searchable inventory of compute instances with one-click termination/scaling actions
  • Cost Anomaly Sandbox: Mock incident scenarios for safe testing and learning
  • FinOps Ledger: Actionable optimization recommendations with budget impact tracking
  • Executive Report Center: CFO-ready financial summaries with CSV export and printable templates
  • CFO Chat Terminal: Continuous-context AI dialogue for direct cost strategy consultation

For detailed architecture, see the full README.


🛠️ Technical Architecture & Implementation

Frontend Stack (98.8% TypeScript)

  • React 18 with modern hooks for state management
  • Vite for lightning-fast development and optimized production builds
  • Tailwind CSS for responsive, dark-themed UI
  • Lucide Icons for crisp, professional iconography
  • Framer Motion for smooth animations and transitions

Backend Stack

AI Intelligence Layer: The Gemini Resiliency Engine

One of the project's most sophisticated components is the Gemini Resiliency Engine—a dual-layered failover framework designed to ensure zero downtime during peak demand:

$$\text{retry_delay}(n) = \text{base_delay} \times 2^n$$

Failover Strategy:

  1. Exponential Backoff Retry: Automatically retries failed requests up to 3 times with exponential delay progression
  2. Model Failover: Falls back from gemini-2.5-flash to gemini-2.0-flash on transient failures
  3. Deterministic Local Heuristics: Uses pre-compiled rule-based recommendations when both AI services are exhausted

This architecture ensures the platform remains responsive even when:

  • Cloud APIs experience 503 rate-limit overloads
  • Peak usage patterns spike query demand
  • Network connectivity experiences temporary degradation

See server.ts for implementation details.

Observability: Arize Phoenix OTel Integration

CloudPilot includes optional Arize Phoenix OpenTelemetry tracing for production observability:

  • Automatic Tracing: Every Gemini API call is traced with full context
  • Graceful Degradation: If Phoenix collector is unavailable, system continues without impact
  • Zero Configuration Fallback: Optional dependency that never crashes the core application
  • Rich Instrumentation: Captures model name, input/output tokens, latency, and retry attempts

Example .env.example

PHOENIX_ENABLED=true

PHOENIX_COLLECTOR_ENDPOINT=https://otlp.arize.com/v1

OTEL_EXPORTER_OTLP_HEADERS=space-id=YOUR_SPACE_ID,api-key=YOUR_API_KEY

GEMINI_API_KEY=YOUR_GEMINI_API_KEY

Configuration Notes

  • Replace YOUR_SPACE_ID and YOUR_API_KEY with your Arize Phoenix credentials.
  • Replace YOUR_GEMINI_API_KEY with your Google AI Studio API key.
  • Observability is optional and can be disabled without affecting application functionality.

📚 Resources & Links

Project Links

Built With

Share this project:

Updates