DEV Community

Vlad
Vlad

Posted on

From Metrics to Meaning: Building WellInsightEngine with Gemini

Built with Google Gemini: Writing Challenge

This is a submission for the Built with Google Gemini: Writing Challenge

WellInsightEngine AI platform analyzing oil well telemetry with dashboards showing KPI metrics (avg, min, max), emergency shut-in alerts, and an engineer monitoring data

What I Built with Google Gemini

During a recent hackathon I built WellInsightEngine, a system that converts oil well telemetry into AI-generated operational insights.

I shared a short project overview on LinkedIn:

Well Insight Engine: MODUS X / DTEK Hackathon Project | Vlad Timchenko

Hey community! Spent a couple of intense weekends building a hackathon project. Thank you DEV Challenge, MODUS X, and DTEK for an intense and valuable experience 🚀 We worked as a small team: my teammate Andrii Savka focused on the frontend, while I handled the backend, data pipeline, and insight logic. Great collaboration throughout the event. Project repositories: Backend - https://lnkd.in/g63TJNEu Frontend - https://lnkd.in/giaCJNB2

favicon linkedin.com

In the oil and gas industry, wells continuously produce telemetry data such as pressure, flow rate, and choke positions. Engineers often analyze thousands of datapoints manually through dashboards. The problem is that metrics alone rarely explain what is actually happening.

WellInsightEngine solves this by combining:

  • TimescaleDB for time-series storage
  • Continuous aggregates for KPI calculation
  • Operational events recorded by field engineers
  • Google Gemini for reasoning and insight generation

Instead of asking the AI to calculate metrics directly from raw telemetry, the system prepares structured KPIs first.

Telemetry is aggregated into metrics such as:

  • average
  • minimum
  • maximum

These KPIs are calculated using TimescaleDB continuous aggregates at different intervals like 30 minutes, 1 hour, or 1 day.

Gemini then analyzes:

  • aggregated KPIs
  • operational events
  • well context

and produces insights like:

  • operational instability
  • abnormal operational patterns
  • recommended investigation steps

This turns thousands of telemetry datapoints into a short operational explanation engineers can act on.


Demo

Live application running on Google Cloud Run:

If you'd like to open the demo in a separate tab:

👉 Launch WellInsightEngine Live Demo

You can also watch the demo video walkthrough here:

The platform organizes wells using a realistic industrial hierarchy:

Company → Region → Field → Pad → Well

Users can explore telemetry using multiple time intervals powered by TimescaleDB continuous aggregates.

Engineers can also see Well Actions, which are events recorded in the field such as:

  • inspections
  • maintenance
  • choke adjustments
  • emergency shut-ins

When generating insights, Gemini analyzes both telemetry KPIs and operational events.

Healthy wells generate insights like:

No critical alerts or significant deviations were detected.

Deviant wells may produce explanations like:

Multiple emergency shut-ins occurred throughout the period and frequent choke adjustments due to instability were observed.

This allows engineers to understand the situation without manually inspecting charts and raw data.


What I Learned

The biggest insight I gained while building this project was:

AI agents are not calculators. They are analyzers.

Initially I experimented with letting Gemini compute metrics directly from raw telemetry data. This approach quickly produced problems such as:

  • hallucinated values
  • inconsistent calculations
  • unreliable reasoning

The solution was to prepare the metrics first.

TimescaleDB calculates KPIs using continuous aggregates:

  • avg
  • min
  • max

Gemini then receives a structured and compact dataset instead of raw telemetry streams.

This architecture dramatically improved the quality and reliability of insights.

The final flow became:

Raw Telemetry → TimescaleDB Continuous Aggregates → KPI Metrics → Gemini Reasoning → Human Insight

This separation works extremely well because:

  • databases are great at precise calculations
  • AI models are great at interpretation and explanation

Combining the two reduces hallucinations and improves reasoning.


Google Gemini Feedback

Gemini worked particularly well when analyzing structured KPI datasets combined with operational events.

Even when using Gemini Flash, a lightweight model, the reasoning quality remained surprisingly strong.

Originally the system was tested with a larger Gemini model, but the architecture based on precomputed KPI aggregations made it possible to switch to a lightweight model without losing insight quality.

Because the platform sends:

  • aggregated KPIs
  • operational events
  • structured well context

Gemini focuses entirely on analysis and reasoning rather than computation.

The main friction occurred when too much raw telemetry data was provided. Large unstructured datasets increased the chance of hallucinations.

The key lesson was:

Design the system so the AI analyzes meaning rather than performs calculations.

Once the data was prepared in a clean, consumable format, Gemini produced much more consistent insights.


What's Next

The next steps for WellInsightEngine include:

  • automated anomaly detection
  • well health scoring
  • predictive maintenance recommendations
  • real-time operational alerts

The goal is to move engineers from monitoring metrics to understanding what those metrics actually mean.

Top comments (0)