MMetiss AI|Docs

Savings Insight

The Savings Insight service takes a customer's electricity usage history and address, then produces a personalised solar savings report — combining real roof data, state-specific rates, and Gemini-generated content into a PDF delivered to the customer by email.

Processing pipeline

STEP 1Usage DataMonthly kWhhistory fromUtility Bill AISTEP 2Roof AnalysisGoogle Solar API— area, sunshinehours & panelsSTEP 3CalculateSystem size,savings & stateincentivesSTEP 4Gemini ReportAI generatespersonalisedHTML sectionsSTEP 5PDF & EmailReport renderedas PDF, emailedto customer

Inputs

InputSourceUsed for
Monthly usage historyUtility Bill AIAnnual kWh total, seasonal patterns, and sizing the solar system to offset ~100% of consumption.
Service addressWidget / customer inputGeocoded to lat/lng for Google Solar API lookup and state rate selection.
Customer nameWidget / customer inputPersonalises the Gemini-generated report content.
State ratesMetiss databaseState average electricity rate ($/kWh) and escalator rate, used in financial projections.
Google Solar APIGoogle Building InsightsRoof area (m²), max sunshine hours/year, panel capacity, and yearly energy potential (DC kWh).

Calculations

The service performs all financial modelling before handing off to Gemini:

MetricHow it is calculated
Total annual kWhSum of the 12 monthly usage values from the utility bill extraction.
Annual electricity costTotal annual kWh × state average electricity rate.
Proposed system sizeTargeted at 10 kW DC, adjusted to offset approximately 100% of annual usage based on roof yield data.
Gross system costSystem size (W) × state average solar cost per watt.
Net system costGross cost after 30% Federal Investment Tax Credit (ITC).
Net annual savingsAnnual electricity cost offset by the solar system, adjusted for state-specific program charges.
Payback periodNet system cost ÷ net annual savings.

Report sections

Gemini generates a JSON response containing HTML-formatted sections. The service validates the structure before rendering it to PDF.

SectionContent
I — Executive SummaryOverview of the customer's current electricity spend, solar opportunity, and key headline savings figure. References state-specific efficiency programmes (e.g. Mass Save®, Energize CT).
II — Usage AnalysisBreakdown of the customer's monthly and annual consumption patterns, peak months, and year-on-year cost projection.
III — Solar RecommendationRecommended system size, annual production estimate, financial analysis (gross cost, ITC, net cost, payback), projected annual savings, additional benefits (property tax exemption, net metering), financing options, and battery storage incentives — all state-specific where known.
State-specific content:Gemini is given the customer's state abbreviation and instructed to use known local rates, programme names, and incentives. For states where Gemini lacks specific data, nationally applicable averages and generic programme descriptions are used.

API endpoints

Method & pathPurposeReturns
POST /savings-insight-reportFull pipeline — calculates, generates report, and triggers email + PDF.Report JSON + transaction ID.
POST /generate-savings-insightsLLM report generation only. Skips solar calculation — caller provides pre-computed data.Validated report sections JSON.
POST /generate-pdf-reportRenders an existing LLM response to a PDF and returns it as a stream.PDF binary stream.
GET /healthHealth check.{'status': 'ok'}

Report response structure

{
  "data": {
    "items": [
      {
        "report": {
          "sections": [
            {
              "sequence": "I",
              "title": "Executive Summary",
              "text": "<p>Based on your usage of ...</p>"
            },
            {
              "sequence": "II",
              "title": "Usage Analysis",
              "text": "..."
            },
            {
              "sequence": "III",
              "title": "Solar Recommendation & Financial Analysis",
              "text": "..."
            }
          ]
        }
      }
    ]
  }
}
Section text is HTML. The text field in each section contains HTML markup (<p>, <ul>, <strong>, etc.) ready to render directly in the PDF template or a web view.