Add agentic analysis for analytics dashboards
What does this MR do and why?
This MR adds an "Analyze with Duo" button to the analytics dashboards that opens Duo Chat with the Data Analyst agent ready to answer exactly those follow-up questions, with one-click suggested prompts scoped to the selected group or project.
The agent receives the GLQL queries behind the visible panels plus the selected scope and date range as session context, so its answers reconcile with the numbers on screen instead of approximating them.
References
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/628578 (drill-down capability for the Data Analyst agent). This MR implements the entry point that passes the panel-backing GLQL queries and injects prompts, as proposed in that issue's discussion.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
Screen recording:
How to set up and validate locally
- Enable the
explore_analytics_dashboardsfeature flag. - Ensure Duo Agentic Chat is working in your GDK with a Duo seat.
- Seed AI usage data:
FILTER=ai_usage_stats PROJECT_ID=<id> SEED_AI_USAGE_STATS=1 bundle exec rake db:seed_fu(requires ClickHouse enabled). - Open the DAP Impact dashboard under
/explore/analytics_dashboardsand select a scope. - Click "Analyze with Duo" and check that the Data Analyst agent is preselected with scoped prompts.
MR acceptance checklist
This MR has been evaluated against the MR acceptance checklist.

