> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add AI analysis to a data app

> Add an AI executive summary, anomaly markers, and investigations to a data app with one prompt

[Experimental](https://docs.lightdash.com/support/feature-badges.md#experimental)

## What you'll build

An executive summary at the top of your app that writes itself when the page loads, markers on the unusual data points of every chart, and an **Investigate with AI** action that explains why a point stands out.

![A data app with KPI cards above an Executive summary block showing a headline about weekly CLI events, a summary paragraph, a list of data limitations, and a Regenerate button](https://mintcdn.com/lightdash/udbVJlQPnAZWkSr_/images/data-apps/add-ai-analysis-to-an-app/executive-summary.png?fit=max\&auto=format\&n=udbVJlQPnAZWkSr_\&q=85\&s=824d1f3cb8c450c1e69b6f6bcf724bf7)

## Before you start

* **Data apps** on your Lightdash instance. See [Data apps](https://docs.lightdash.com/data-apps).
* **AI analysis** turned on by an organization admin under **Settings** → **Ask AI** → **AI analysis**. See [Turn it on](https://docs.lightdash.com/data-apps/ai-analysis.md#turn-it-on).
* **An AI agent** with access to the app's data, if you want to investigate findings. The summary and markers work without one.
* **A data app with charts** that you can edit. To start from scratch, create an app with the **Dashboard** template and attach an existing dashboard as context. See [Creating a new app](https://docs.lightdash.com/data-apps#creating-a-new-app).

## Copy the prompt

Open your app, copy this prompt, and send it as your next prompt to the app agent.

Prompt
Copy this prompt to your clipboard

<pre>
  Add AI analysis to this app:

  * An executive summary block at the top of the page that analyses as soon as it loads.
  * Markers on the flagged data points of every chart, with the finding shown in the chart tooltip.
  * "Investigate with AI" in every data point's menu, with the investigation card under the chart.

  Write the summaries in plain English for an executive audience, and lead with the biggest change compared with the previous period when comparison data is available. Otherwise, explain that limitation.
</pre>

Paste into the prompt box of your app, then send it.

The agent builds a new version of the app. The prompt asks for the full set of [in-app analysis](https://docs.lightdash.com/data-apps/ai-analysis.md#show-the-analysis-inside-the-app), turns on [analyse on load](https://docs.lightdash.com/data-apps/ai-analysis.md#show-the-analysis-inside-the-app), and stores the last line as the app's [analysis instructions](https://docs.lightdash.com/data-apps/ai-analysis.md#steer-the-summaries).

## Try it

**1. Open the new version**

When the build finishes, the preview reloads. An **Executive summary** block appears at the top of the page and starts analyzing once the charts load. After a few seconds it shows a headline, a short summary, and the limitations of the data.

**2. Hover a marked data point**

Charts with notable points show markers, colored by severity. Hover one to see the finding under the value in the tooltip.

If the analysis finds no notable points, no markers appear and the headline says so. Skip the investigation steps.

![A line chart of unique users per week with a marker on the October 12 peak and a tooltip showing 1.2K users and the AI finding about the peak](https://mintcdn.com/lightdash/udbVJlQPnAZWkSr_/images/data-apps/add-ai-analysis-to-an-app/marked-data-point-tooltip.png?fit=max\&auto=format\&n=udbVJlQPnAZWkSr_\&q=85\&s=dc70a03102207314018d92d2066d5dc3)

**3. Change the view**

Change a filter or move to another tab. The summary runs again for the new view. If someone already analyzed the same results, the stored analysis appears immediately.

**4. Investigate a finding (optional)**

This step needs an AI agent with access to the app's data. Without one, the summary and markers still work, but the data point menu has no **Investigate with AI** entry.

Click a marked point to open its menu, then click **Investigate with AI**. An investigation card appears under the chart and fills in with possible drivers, the evidence the agent checked, and a confidence line.

**5. Continue in Ask AI (optional)**

On a finished investigation, click **Continue in Ask AI** to keep asking questions in a thread. The button only appears when your organization allows it.

## Make it yours

Send any of these as a follow-up prompt.

Keep only the summary and drop the chart markers:

```text theme={null}
Just an executive summary. Remove the markers and the investigate actions from the charts.
```

Teach the analysis your domain vocabulary and formats:

```text theme={null}
Amounts are in EUR. "Stage" labels are covenant stages, not sales stages.
```

This prompt sets instructions for this app only. To apply guidance such as language, currency, or house style to every app and dashboard, an organization admin saves it as **Summary instructions** under **Settings** → **Ask AI** → [**AI analysis**](https://docs.lightdash.com/data-apps/ai-analysis.md#turn-it-on). The app's own instructions are applied on top of them.

Add a written takeaway under a single chart:

```text theme={null}
Under the revenue chart, add a one-sentence AI takeaway about the trend in the selected period.
```

## How it works

* [AI analysis](https://docs.lightdash.com/data-apps/ai-analysis.md) covers what is analyzed, the organization limits, and what is sent to the model.
* [Investigate a finding](https://docs.lightdash.com/data-apps/ai-analysis.md#investigate-a-finding) explains which tools the agent can use and how long an investigation can run.
* [Reuse](https://docs.lightdash.com/data-apps/ai-analysis.md#reuse) explains when a stored analysis is shown instead of a new one.
* [Where it works](https://docs.lightdash.com/data-apps/ai-analysis.md#where-it-works) lists the places AI analysis doesn't run, such as scheduled deliveries and embedded apps.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.