Add suggested questions to the Data Analyst agent

What does this MR do and why?

  • The Data Analyst agent had no suggested_questions, so its empty chat screen fell back to the generic URL-based questions, which do not reflect what the agent can actually do. User research on https://gitlab.com/gitlab-org/gitlab/-/work_items/589780 recorded the gap directly: "If I knew what to expect from it up front... that would be a lot more helpful."
  • This adds eight questions to the analytics_agent entry in ee/lib/ai/foundational_chat_agents_definitions.rb.
  • Selecting them was constrained rather than arbitrary. The issue asks for questions available on all tiers, and GLQL's merge_request_analytics and pipeline_analytics data sources are Premium and Ultimate only. Questions about average time to merge, pipeline success rates, and MR rate therefore cannot be offered to Free users, so I excluded them even though they appear in the issue's proposed list. Every question here resolves through the work_items and merge_requests data sources, both of which are available on Free.
  • The set also follows the guidelines in doc/development/ai_features/foundational_chat_agents.md: more than four, so the resolver's random sample of four varies between visits; no page context, since agent questions replace the URL-based and resource-based ones; written in the first person; and each under 70 characters. Questions using "my" and "me" are answerable because get_current_user is already one of the agent's tools.

The wording is a proposal rather than a decision. The issue is still workflow::solution validation, and the documentation notes that each agent's owning team decides its questions, so I am happy to adjust or trim the list to whatever ~group::platform insights prefers.

References :

Differences :

  • Before: selecting the Data Analyst agent showed the generic URL-based suggested questions on the empty chat screen, which did not reflect what the agent can do.
  • After: the empty state shows four questions sampled at random from the eight added to the analytics_agent definition, and the sample varies between visits.

This adds data to an agent definition; no rendering code changes. Capturing a screenshot needs a GDK with Duo Chat and the agent enabled, which I do not have. Happy to add one if a reviewer with that environment can produce it.

How to set up and validate locally :

  1. Open Duo Chat and select the Data Analyst agent with no page context.
  2. Confirm the empty state shows four chips drawn from the new list, and that reopening chat shows a different sample.
  3. Confirm each suggested question returns a result, rather than an unsupported capability error, on a Free-tier namespace.

Run the definitions spec:

bundle exec rspec ee/spec/lib/ai/foundational_chat_agents_definitions_spec.rb
Edited by Jeston Singh

Merge request reports

Loading
Loading