Flare

Spots the failure before it burns.

Flare reads raw sensor data, forecasts the shutdown, prices every response, and walks the technician through the fix, on their phone or through Meta Ray-Ban glasses, until the ticket is closed and the next shift is briefed.


Inspiration

It's 2 a.m. A pump fails at a produced-water facility. The tank starts filling, and in a few hours it hits capacity. The wells shut in, and production stops.

One operator is watching dozens of facilities. The nearest technician is asleep, driving, or under another pump. Every minute spent working out what failed and what to do brings the facility closer to an expensive shutdown.

The data to make the right call already exists. Nobody is turning it into a decision, and getting it to the person who can act, fast enough.

We built Flare to close that gap.


Flare loop strip

Forecast → detect → countdown → plan → text → glasses → approve → report → ticket → handoff → retrain. One loop, one shared state, every step on the record.


What it does

  • Detect. Pump failures, pipeline leaks and worn pumps from telemetry alone. Baselines are learned from each dataset, so unseen networks need no tuning. Every alert carries a confidence score and the readings that justify it.
  • Forecast. A trend fit on worn pumps gives "fails in ~N hours." An eight-feature early-warning model flags trouble before the rules do. Every failed pump gets a live countdown to shutdown.
  • Decide. Every response simulated and priced: trucks, early well shut-ins, mixes, or nothing. Trucks are shared across the system, so simultaneous failures are planned together.
  • Reach. Plans go out by iMessage, by phone to an AI night engineer the technician can call any time, and by Gemini Live video on a phone or Meta Ray-Ban glasses. Unanswered alerts escalate. Approvals sync to the console.
  • Close the loop. A step-by-step plan of action the technician ticks off live, an incident report built from what they saw, a GitHub ticket for the follow-up, a morning handoff, and a nightly retrain from recorded outcomes.

🛢️ Built for EOG Technicians & Operators

EOG's challenge comes down to three questions: What's failing, how long do we have, and what's the cheapest way to keep production running? Flare answers all three by turning raw sensor data into actionable decisions across an entire facility network.

Flare detects pump failures, pipeline leaks, and degrading equipment using healthy operating baselines learned directly from each dataset. Every alert includes a confidence score and an explanation of what changed. Failed pumps get live shutdown countdowns, worn pumps get failure forecasts, and pipeline leaks trigger urgent inspections.

But detecting a failure is only half the problem. The real challenge is deciding what to do about it. Flare simulates tank levels, evaluates emergency trucks and selective well shut-ins, and calculates the total cost of every viable response. In EOG's opening scenario, it recommends a $905 truck instead of accepting $5,016 in shutdown losses, avoiding $4,111 in potential costs.

The optimization gets harder when several pumps fail simultaneously and compete for the same limited trucks. Rather than making isolated decisions, Flare optimizes across the entire network. In EOG's multi-failure scenario, it allocates two available trucks across three failed pumps and selectively shuts in a well at the remaining facility, matching the challenge's reference plan.

And none of it is hardcoded. Flare reads operational constraints from ops.json and learns healthy baselines from each dataset. Give it an unseen network, and it automatically builds the facility map, detects failures, predicts shutdowns, and generates optimized response plans. It also exports events.json in the required challenge format.

Operators can compare sensor trends, visualize tank levels under different plans, stress-test limited resources, and replay historical scenarios to see what Flare would have recommended.

Flare doesn't just tell operators something is wrong. It tells them what to do, why it's the best option, and how much it could save.


🔥 How we built it

Flare System Architecture

At Flare's core is a pure TypeScript engine responsible for anomaly detection, shutdown prediction, and cost optimization. The operations console, messaging agent, phone agent and field assistant share the same engine, keeping every decision synchronized. Time travel is just the engine run with an earlier "now".

Flare takes three inputs: network.json for facility topology, ops.json for costs and operational constraints, and telemetry.csv for sensor readings. It learns healthy operating baselines from the data rather than relying on predefined thresholds or facility-specific logic.

The optimizer simulates tank levels minute by minute, evaluates truck dispatches and well shut-ins, and selects the lowest-cost response that keeps tanks below their shutdown limits. When facilities share a truck fleet, Flare optimizes their responses together to minimize total network cost.

We built the console using Next.js, TypeScript, Tailwind, and Zustand, with Recharts, Leaflet, and Three.js for sensor visualization, network maps, and a digital twin of each facility. We also wrote 172 automated tests, including checks against EOG's reference plans, to validate the underlying decisions.


📈 Forecasting and Decision Intelligence

Flare Forecasting and Decision Architecture

Flare is built to catch problems before they become expensive, with math an operator can check on paper.

Detection is ratios against a baseline the data teaches us. A healthy pipeline receives what the pump sends, so receive_flow ÷ pump_flow ≈ 1.00; a leak drifts it to 0.96, then 0.90, and pipeline pressure drops about 30 psi. A healthy pump delivers its rating, so pump_flow ÷ max_flow ≈ 1.00; a worn pump drifts to 0.97, then 0.85, and discharge pressure sags. A failed pump is unambiguous: status flips to fault, flow goes to zero, discharge collapses to disposal pressure, and the tank climbs. The normal band for each ratio is the median and spread of that facility's own healthy history, so an unseen network calibrates itself. How far outside the band, and for how long, becomes the confidence score.

Countdown is arithmetic. fill rate (%/h) = inflow_bpd ÷ 24 ÷ tank_capacity_bbl × 100, and hours to shutdown = (92 % − current level) ÷ fill rate. The current level comes from a regression over the last readings so sensor noise does not jitter the number. The limit and every capacity come from the files.

The worn-pump forecast is a line through the decline. We fit a least-squares line to the falling flow ratio while the pump runs and project when it crosses the ratio at which past pumps failed. That is the "fails in ~6 h, inspect before 12:20" line on the board.

Early warning is a small, honest model. An eight-feature multinomial logistic regression on windowed deficits (mean, max and slope of the receive deficit and the flow deficit, plus pipeline and discharge pressure deficits), trained on the week's labelled windows and synthetic variants. It raises a soft warning before the rule-based detector would. Eight features and a weight table you can read, not a neural net.

The cheapest plan is a simulation of every option. For each failed pump we simulate the tank through the repair horizon. Trucks arrive at response_min, then every cycle_min, each removing truck_capacity_bbl for cost_per_trip. Shutting in a well removes its water but costs (oil_bpd × oil price + gas_mcfd × gas price) ÷ 24 × hours shut in, so the latest shut-in start that still holds the tank under the limit is the cheapest one, found by binary search. We enumerate truck counts, trip counts and well subsets, drop anything that lets the tank trip before repair ends, and keep the lowest total. When several pumps in one system have failed, we enumerate how to split the fleet between them and take the lowest network total.

The goal isn't just predicting a failure. It's giving operators enough time and information to prevent the shutdown that follows.


🔁 It learns from the night shift

Flare is the only part of the loop that gets smarter while everyone sleeps. Every technician reply, FIXED, false alarm, resolution note and visual report is recorded as an outcome. At 03:00 a GitHub Action replays the datasets with those outcomes, re-derives the detector's healthy baselines and thresholds, retrains the eight-feature early-warning model, and opens a pull request with the new weights and a diff of what moved. A human reviews and merges it, so nothing changes silently.

The physics never retrains. Countdowns, tank simulations and costs stay deterministic arithmetic from the input files. What improves is how early Flare notices, and how rarely it cries wolf.


✨ Built on Gemini

Flare uses Gemini Live and Gemini Flash to bring the same incident intelligence to both the operations console and the technician in the field. Both are briefed with the live readings, the detected event, the priced plan and the runbook for that failure type, so they answer about this pump, not pumps in general.

Gemini Live powers hands-free field assistance. Technicians can point their phone or Meta Ray-Ban glasses at equipment and ask questions naturally. The assistant combines live video and audio with sensor readings, the detected failure, recommended response, and relevant repair runbooks, and the plan of action on the console updates live as the technician completes each step on the call. If a leak alert is accompanied by visible pooling water, Flare can connect that observation to the telemetry and record supporting evidence. When live video isn't available, Gemini Flash analyzes a photo with the same context.

Gemini Flash powers Ask Flare on the console. Operators can ask questions like "Why is Facility C getting a shut-in instead of a truck?" and receive explanations grounded in the actual optimization results, including fleet availability and cost tradeoffs.

Flare's deterministic engine handles the operational calculations, while Gemini makes those decisions easier to understand, verify, and act on.


💬 Built on Photon

The cheapest plan means nothing if nobody acts on it.

Flare uses Photon's Spectrum SDK to deliver operational decisions directly through iMessage and phone calls, without requiring technicians to download an app or log in.

When a pump fails, the technician receives the shutdown countdown, recommended response, estimated cost, alternatives, and the number of the night engineer. They can reply with a single command: OMW, YES, OPT 2, HELP, or FIXED.

Every reply is validated against the latest incident state, preventing outdated plans and duplicate approvals. If nobody responds, Flare escalates from reminders to supervisors to the wider team, with urgency determined by the time remaining before shutdown.

When typing isn't practical, the technician calls the ElevenLabs-powered AI night engineer, who picks up already briefed on their open alerts, and approves a plan hands-free. The approval updates the operations console automatically.

Completed repairs, notes, and photos are saved to incident memory, while the morning crew receives a handoff showing what happened, what was decided, and what still needs attention.


🐯 Built on Tiger Data

Flare processes approximately 393,000 sensor readings per week, collected every five minutes across pumps, tanks, wells, and pipelines.

Every reading lives in a Tiger Data (TimescaleDB) hypertable with an hourly continuous aggregate, which serves the trend charts and sensor-history lookups in the console.

Incidents, every text in and out, tickets, technician verdicts and visual reports are persisted alongside the telemetry. That history powers the Analytics page (failure frequency, time between failures, cost avoided) and is what the nightly retrain reads back.

This is the foundation for comparing past recommendations with actual outcomes, helping operators understand not just what went wrong, but whether a different response could have prevented the loss.


Accomplishments that we're proud of

  • End-to-end detection, prevention, and response. Flare goes beyond monitoring. It detects failures, forecasts risks, prevents costly shutdowns through optimized response plans, and coordinates action with technicians, all in one connected workflow.
  • Action, not just alerts. Every sensor reading can lead to a concrete decision, from dispatching trucks and shutting in wells to contacting technicians, recording approvals, raising tickets, and handing off incidents to the next shift.
  • Math you can check by hand. The forecasting and pricing are arithmetic from the input files, and every alert shows its working.
  • Built to generalize. Flare works on unseen facility networks without hardcoded answers, automatically learning healthy baselines and adapting to new operating conditions.
  • Validated against EOG's reference plans. Flare matches the challenge's expected decisions, including the complex multi-failure scenario with a shared truck fleet. We also wrote 172 automated tests to validate the underlying logic.
  • Human-in-the-loop decisions. Flare handles the detection, forecasting, and optimization, but operators remain in control of every action, with approvals recorded and traceable.

What we learned

The hardest part of industrial operations software isn't detecting failures. It's deciding what to do about them quickly enough to matter.

We learned that optimizing individual problems isn't enough when facilities share limited resources, and that explainable predictions matter when an operator has to trust a recommendation with real financial consequences.

We also learned that the last mile matters just as much as the intelligence behind the decision. A perfect plan doesn't prevent a shutdown if the technician never sees it.

A good monitoring system tells you something is wrong. A great one helps you prevent what happens next.


What's next for Flare

Flare already records every outcome against the plan it recommended and retrains its detection from them nightly. Next is closing the same loop on the economics: learning real truck cycle times and repair durations from the history instead of taking ops.json at its word, and feeding Flare from a live SCADA historian rather than a folder of files. The ingest is one adapter, because every surface reads from the same engine.

We also plan to extend optimization to truck routing between facilities and bring live shutdown countdowns and repair guidance directly into Meta Ray-Ban Display glasses.

Our goal is to make Flare the system that helps operators protect production before equipment failures become expensive shutdowns.


Built with

nextjs typescript tailwind zustand recharts leaflet threejs gemini-live gemini-flash meta-ray-ban photon-spectrum elevenlabs tiger-data timescaledb postgresql github-actions vitest

Built With

Share this project:

Updates

Submission history