
Chris Parmer
November 23, 2026
Clinical trial landscape app for GLP-1 obesity and diabetes drugs
A data app example built with Dash and an AI coding agent in 17 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 maps every obesity and diabetes trial of a glucagon-like peptide-1 (GLP-1) drug registered on ClinicalTrials.gov: the pipeline by phase, who sponsors what, and which results are due next. A coding agent built it from one prompt in about 17 minutes.
- Every trial, molecule, and sponsor has its own page, so you can click from the pipeline to a single trial and send the link to a colleague.
- The app is also an MCP server, so an AI agent can query the trials and get the same numbers the pages show.
- 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
Competitive intelligence and portfolio teams in pharma keep track of a therapeutic area by rebuilding the same competitive report every quarter. This app keeps that report live, on the public ClinicalTrials.gov registry, for GLP-1 drugs such as semaglutide, tirzepatide, and the oral and triple-agonist molecules coming behind them.
It starts with every trial in the area and lets you drill into the pipeline, a molecule, a sponsor, or a single trial.
See the whole therapeutic area at once

The overview answers the first questions in any competitive review: how much is running, how fast new trials are starting, and how the sponsors rank. Each headline number has a short trend under it.
A Sankey shows each molecule moving from phase to phase, and a bump chart ranks the sponsors by trials started each year. The Gantt at the bottom lists the phase 3 trials due to read out in the next 12 months, and clicking a bar or a site on the map opens that trial.
Follow the pipeline molecule by molecule

The pipeline page draws every active phase 2 and 3 trial from start to primary completion, grouped by molecule, with a line for today. Toggles switch between phases and between industry and all sponsors.
The molecule table underneath gives each drug's highest phase, main sponsor, and trial counts. Clicking a row opens the molecule's page.
Open any trial and see where it sits

Each trial has its own page with the registry's facts: design, eligibility, arms, primary outcomes, and a map of every site. A Gantt puts it among its molecule's other trials, so you can see which studies run alongside it and which read out first.
A link goes to the public record on ClinicalTrials.gov for anything the page doesn't show.
Track a molecule's development

A molecule's page shows its trials by phase on one timeline, how many it started each year, and where its active trials recruit. The heading says how many months it took from the first trial at one phase to the first at the next.
Sponsors get the same kind of page, so you can look at a company's whole GLP-1 program in one place.
See who is investing, year by year

The bump chart ranks industry sponsors by the trials they started each year, which shows when a company stepped up its program and when another fell back. The table underneath covers every lead sponsor, academic centers included.
Ask the app from an AI agent

The app is also an MCP server. Seven of its Python functions are marked with @mcp_enabled, so any AI tool like Claude, ChatGPT, Copilot, or Plotly Studio Embedded can ask it which phase 3 trials read out next year, what a molecule's pipeline looks like, or how the sponsors rank, and get the numbers the pages show.
The tools are landscape_summary, search_trials, trial_detail, molecule_pipeline, sponsor_rankings, upcoming_readouts, and query_data, a read-only SQL tool that runs on a DuckDB database with file and network access switched off. Each tool's type hints become its schema, and its docstring becomes the instructions the agent reads:
from dash.mcp import mcp_enabled@mcp_enabled(expose_docstring=True)def upcoming_readouts(months: int = 12, min_phase: int = 3) -> list[dict]:"""Active interventional trials of phase `min_phase` or later whose primary completion date falls within the next`months` months of the download date, soonest first. Most of these dates are the sponsor's estimates(primary_completion_type = ESTIMATED)."""return _records(glp.upcoming_readouts(min(months, 60), min_phase), 300)
Ask it inside the app with Plotly Studio Embedded

On Plotly Cloud you can switch on Plotly Studio Embedded, a chat panel that sits on top of the app and calls the same tools. We asked it which industry-sponsored phase 3 GLP-1 trials read out in the next 12 months and what that means for the competitive picture. It ran the app's upcoming_readouts tool, looked up individual trials with search_trials and trial_detail, and drew a timeline of the readouts by sponsor.
It found 35 industry-sponsored phase 3 trials due between December 2026 and November 2027, led by Eli Lilly with 12, then Amgen with six, Novo Nordisk with four, and Innovent with three. It said Amgen's MARITIME-1 and MARITIME-2, due in January 2027, are the first large readouts from a next-generation rival to Lilly and Novo Nordisk, and that several Chinese companies are running head-to-head trials against semaglutide.
The answer also warned that every date is the sponsor's own estimate, and that one entry, Vanda's trial of tradipitant for nausea in GLP-1 users, isn't a GLP-1 drug. Studio Embedded is available on Plotly Cloud now (in beta) and is planned for Dash Enterprise in Q4 2026, and every answer has a Methodology link that shows the tool calls and code behind it.

Each question is kept as a session in the panel, saved in your browser, so you can come back to the readout timeline or to a later question such as which sponsors started the most GLP-1 trials in 2025.
See how every number is defined

Counts like these depend on choices: which trials count, what phase a phase 1/2 trial is, which statuses mean active, and how to rank sponsors. The How we calculate page writes down these data definitions and methodology in the app, with the formula, the current value, and the function that computes it.
Data is often messy and ambiguous, and writing things down is a way for your app's viewers to know how you came to certain numbers.
Those functions are the app's semantic layer. The charts, the tables, and the AI tools all call the same ones, so a number means the same thing wherever it shows up.
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:
- Add your own pipeline from your clinical trial management system next to the public registry
- Refresh from the API every night and flag trials whose status, enrollment, or completion date changed
- Pull posted results and draw a forest plot of the primary endpoints across trials
- Add other registries, such as the EU Clinical Trials Register or China's registry, for trials that aren't on ClinicalTrials.gov
- Let analysts annotate a trial with notes and save them to a database
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:
- With AI, apps like this can be built quickly and cheaply by anyone, including the competitive intelligence analysts and clinical scientists who know the data best.
- 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.
- 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.
- 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.
- 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 17 minutes of agent time, from the first download to the app running on Plotly Cloud. Claude Code (with Claude Opus 5.5) downloaded the registry data, checked it, built the app, ran it, took screenshots, and fixed what looked wrong in them, all from one prompt.
Before building on the data, it compared its counts of active, completed, and phase 3 trials with the counts the ClinicalTrials.gov API returns for the same search, and all three matched exactly. It also checked one trial's enrollment against its published paper, and they matched.
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 that maps every clinical trial of GLP-1 drugs in obesity and diabetes, using DuckDB for every query.
Data
- Download every matching study from the ClinicalTrials.gov API v2, searching interventions for semaglutide, tirzepatide, liraglutide, dulaglutide, exenatide, retatrutide, orforglipron, survodutide, mazdutide, maridebart cafraglutide, and the other GLP-1 drugs you know, plus "GLP-1 receptor agonist", and conditions for obesity, overweight, or diabetes.
- Save the raw JSON pages, then flatten them with DuckDB's read_json and unnest into Parquet tables for trials, molecules per trial, sites, outcomes, and arms. Tag each trial with its molecules from a list of generic, code, and brand names.
- Before you build anything, check your active, completed, and phase 3 counts against the API's own filtered counts, and one trial's enrollment against its published paper, and tell me how close they are.
Pages (each with its own URL, and the back button must work)
- Overview: KPI cards for active trials, phase 3 trials running, participants planned, and trials started in the last 12 months, with sparklines. Trials started each year by phase. A Sankey of how each molecule moved from phase to phase. A bump chart of industry sponsors ranked by trials started each year. A Gantt of the phase 3 readouts due in the next 12 months. A map of every active trial site.
- /pipeline: a Gantt of active phase 2 and 3 trials grouped by molecule, with phase and sponsor-type toggles, and a molecule table.
- /trials: every trial in a filterable table, where clicking a row opens /trial/<nct>.
- /trial/<nct>: headline numbers, where the trial sits among its molecule's trials, the design, arms, primary outcomes, summary, and a map of its sites.
- /molecule/<name> and /sponsor/<name>: headline numbers, a Gantt by phase, starts per year, status, sites by country, and their trials.
- /sponsors: the bump chart and a sponsor table.
- A How we calculate page with every metric's question, definition, formula, current value, and the function that computes it.
- An AI tools page listing the metric functions exposed with `@mcp_enabled`, including a read-only SQL tool with file access switched off.
Design
- A gray page with an inset sidebar. Each card is a light surface with its title above a white inset panel for the chart or table. Dense AG Grid 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 registry again after a restart. Point the app at it with an environment variable such as DATA_DIR=/data, and refresh it on a schedule.
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 trial, molecule, and sponsor, 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 its counts with the counts the source itself reports. That check is what lets you trust everything built on top of it.
- Let DuckDB read the API's JSON directly. read_json with unnest and JSON paths turns nested registry records into flat tables in a few seconds, with no loop over records in Python.
- Write down your data definitions and methodology. Highest listed phase, which statuses count as active, and how sponsor names are merged are all choices. Put them on a page in the app so viewers can see how you came to each number.
- Let plain Python functions be your semantic layer. The trial counts, the sponsor ranks, the phase transitions, and the readout window are short DuckDB functions, 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.
- 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.
- Lock down the SQL tool. If you give agents a SQL tool, load the data into memory and switch off DuckDB's file and network access first, so a query can only read the app's own tables.
- 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.
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.