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
before_filter_bar image.png

Screen recording:

How to set up and validate locally

  1. Enable the explore_analytics_dashboards feature flag.
  2. Ensure Duo Agentic Chat is working in your GDK with a Duo seat.
  3. 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).
  4. Open the DAP Impact dashboard under /explore/analytics_dashboards and select a scope.
  5. 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.

Edited by Abhinaba Ghosh

Merge request reports

Loading
Loading