Chris Parmer

Chris Parmer

November 16, 2026

Oil well surveillance and decline curve analysis app

A data app example built with Dash and an AI coding agent in 15 minutes

TL;DR

  • Building data apps with AI coding agents in Python and managing them on Dash Enterprise or Plotly Cloud is the modern alternative to BI. At Plotly, many of our customers are migrating away from point-and-click tools like Spotfire, Tableau, and Power BI toward code-backed tools powered by AI. This example showcases the types of apps that you can create.
  • This app covers production surveillance and decline curve analysis for every well in the federal Gulf of America, from public BOEM data. A coding agent built it from one prompt in about 15 minutes.
  • You can go from the whole basin to a field to a single well by clicking, and every page has its own link you can send to a colleague.
  • The decline curve refits live in Python as you move the fit window or change the economic limit, and the remaining reserves and EUR update with it.
  • The full prompt is below, so you can build the same kind of app on your own data and run it on Dash Enterprise behind your firewall or have it hosted for you on Plotly Cloud.

Walkthrough

The app is built the way an asset team thinks about production: the basin, then a field, then a well. Each level is its own page with its own URL, so the back button works and a link to a well opens that well.

See where the basin's production comes from

The app's overview page for the Gulf of America: headline numbers for oil, gas, deepwater share, and producing wells, annual oil split by water depth, a map of producing wells, a ranked table of fields, and a Pareto chart of oil by field

The overview answers the first questions anyone asks about a basin: how much it produces, whether that's going up or down, and which fields matter most. Each headline number is compared with the year before and has a small trend line under it.

Annual oil is stacked by water depth, which shows three decades of shift from the shelf to deepwater in one chart. A map shows every producing well, sized by production and colored by water depth.

The field table is sorted by production, and clicking a row opens that field. A Pareto chart next to it shows how few fields make up half of the basin's oil.

Compare a field's wells with a type curve

A field page: production history with the number of producing wells on a second axis, a type curve with P10, P50, and P90 bands across the field's wells, and a table of every well in the field

A field page puts the field's production history next to the number of wells producing, so you can tell whether a rise came from new wells or from the wells already there.

Next to it is a type curve: every well's oil rate lined up by its producing month, with P10, P50, and P90 bands. It's the chart you'd use to sanity-check a new well against its neighbors or to set expectations for the next one.

Under the charts, the wells table lists every well with its first oil, cumulative oil, peak rate, and water depth. Clicking a row opens the well.

Fit a decline curve and watch the reserves change

A well page: monthly oil rate on a log scale with an Arps hyperbolic fit and a forecast to the economic limit, with cumulative oil, remaining oil, and EUR above it, a slider for the start of the fit, and an input for the economic limit

This is the page a reservoir engineer would spend the most time on. Monthly oil rate is on a log scale, with an Arps hyperbolic decline fitted to it and a forecast out to the economic limit.

Move the slider for where the fit starts, or change the economic limit, and the app refits the Arps decline curve in Python with SciPy. The fit parameters, the remaining oil, and the estimated ultimate recovery (EUR) update with it.

The economic limit is labeled as an assumption, so nobody mistakes it for a fact about the well. Water cut and gas-oil ratio sit under the fit, from the same monthly records.

Look up a term without leaving the app

The glossary page, defining BOEM, OGOR-A, API number, field code, water depth, oil rate, decline curve, the Arps hyperbolic decline, economic limit, and EUR in plain words

A glossary page defines every term in the app in plain words, from the Arps decline and EUR to the field codes BOEM uses. It makes the app usable by people outside the reservoir team, such as finance or land, without someone having to explain it.

A glossary page is also a natural home for your semantic layer: the functions and formulas behind each metric, written out in plain words next to the code that computes them.

What else could you add?

The prompt is a starting point. These are the kinds of things teams usually ask for next, and each one is a sentence or two more in the prompt:

  • Read from your own production database or historian instead of BOEM's files, and refresh on a schedule
  • Save an engineer's chosen fit back to a database, so forecasts are reviewed and versioned instead of living in someone's file
  • Compare the fitted EUR with booked reserves and flag the wells that disagree
  • Add gas and water declines, or a multi-segment decline for wells with a change in behavior
  • Alert the team when a well falls off its forecast

How is this different from Spotfire and other BI tools?

If you're comparing Spotfire alternatives or other BI tools, the main differences come down to five things:

  1. With AI, apps like this can be built quickly and cheaply by anyone, including the engineers who know the data best.
  2. The apps are backed by code, which you can version control, manage, and update more easily than a fleet of point-and-click dashboards, especially when AI is making the changes.
  3. The apps can go much further than a traditional BI tool, with multiple pages, write-back to databases, custom simulations, AI chart building inside the app, MCP endpoints, and more.
  4. You have full control over the app: the look and feel, the controls, filters, and buttons, and every computation. You aren't fighting a tool to get what you want.
  5. The apps can connect to several data sources at once, and to the other systems your team already uses.

How long did it take to build?

About 15 minutes of agent time. Claude Code (with Claude Opus 5.5) downloaded the public data, checked it, built the app, ran it, took screenshots, and fixed what looked wrong in them, all from one prompt.

Before building anything on the data, it compared the app's annual oil with the Energy Information Administration's published series for the federal Gulf, which comes from the same operator reports. They agreed to within 0.3%.

The prompt

Paste this into Claude Code, Codex, Copilot, Cursor, or another coding agent, in an empty folder. Swap in your own data source and the features you need.

Build a Dash app for production surveillance and decline curve analysis on the Gulf of America, using Polars for every query.

Data

  • Download BOEM's OGOR-A monthly production files (1996 to the latest full year) and BOEM's borehole file from data.boem.gov, and save them as Parquet.
  • Check annual oil against the EIA's federal offshore Gulf crude series before you build anything on it, and tell me how close they are.

Pages (each with its own URL, and the back button must work)

  • Overview: KPI cards for oil, gas, deepwater share and wells producing, each compared with the year before, with a sparkline. Annual oil stacked by water depth class. A bubble map of producing wells. A ranked field table where each row opens the field. A Pareto chart of oil by field.
  • /field/<code>: production history with wells producing on a second axis, a type curve with P10/P50/P90 bands, and a wells table where each row opens the well.
  • /well/<api>: a log-scale decline curve with an Arps hyperbolic fit from SciPy. A slider for where the fit starts and an input for the economic limit. Show qi, Di, b, remaining oil and EUR. Water cut and gas-oil ratio under it.
  • A glossary page that defines every term in plain words.

Design

  • A light gray page with white cards. Each card has a title and a one-sentence description, with the chart or table inset in a slightly tinted panel. Dense tables. Inter everywhere. No chart toolbars.

Run it, screenshot every page at 1600x1000, and fix anything that overflows, looks empty or doesn't match the numbers before you stop.

How do I run it on Dash Enterprise or Plotly Cloud?

Dash Enterprise runs Dash apps inside your own infrastructure, behind your firewall and even air-gapped, with single sign-on and access control for each app.

This app needs nothing special. It's a Dash app with a requirements.txt, and your coding agent can deploy it through the Dash Enterprise or Plotly Cloud command line.

Keep the Parquet files on a persistent filesystem so the app doesn't download the data again after a restart. Point the app at it with an environment variable such as DATA_DIR=/data.

If you'd rather not run any infrastructure, Plotly Cloud hosts the same app for you. We tested this one there.

Tips and tricks

These are things we like doing when we build apps like this one.

  • Ask for a page per thing. A page for each field and each well, with its own URL, makes the app feel like a website rather than a report, and lets people share exactly what they're looking at.
  • Make the agent check the data first. Ask it to compare a total with a published number before it builds the charts. That check is what lets you trust everything built on top of it.
  • Let plain Python functions be your semantic layer. The Arps model and the fit are a few lines with SciPy, and you can read them, test them, and change them, and so can the agent. Plain Python functions like these can become your semantic layer, one definition that every page, test, and agent uses.
  • Label your assumptions in the app. Mark inputs like the economic limit as assumed, so nobody mistakes them for facts.
  • Have the agent look at its own screenshots. Asking it to fix anything that overflows or looks empty catches most layout problems before you see them.
  • Wrap your Python functions in @mcp_enabled. Turn on enable_mcp=True in the Dash(...) call and mark the functions with @mcp_enabled, and chat agents like Claude, ChatGPT, or Copilot can call them over MCP and get the same numbers the app's pages show.
  • Switch on Plotly Studio Embedded. The same tools power Plotly Studio Embedded, an AI chat inside the app that answers questions with charts and tables built from your functions. It's available now on Plotly Cloud (in beta) and is planned for Dash Enterprise in Q4 2026.
Plotly Studio Embedded open beside the charts of a Dash app, answering which region grew revenue fastest with a bar chart and a table built from the app's get_revenue tool. This is our order analytics demo app with TPC-H synthetic benchmark data, not the app in this post.

FAQ

See what Dash Enterprise and Plotly Cloud can do for your team

Our customers in energy, pharma, finance, and manufacturing are building apps like this one with coding agents and running them on Dash Enterprise behind their firewall or on Plotly Cloud. Request a demo and we'll show you how it works for your team.

bluesly
x
instagram
youtube
medium
fcaebook

Product

© 2026
Plotly. All rights reserved.
Cookie Preferences
aicpa/soc2