Add Gemini Tier 3 feature search caller and funnel wiring

What does this MR do and why?

Adds the Rails side that sends a no-match feature-library query plus a feature catalogue to the AI Gateway (Gemini) and returns ordered feature IDs.

The caller subclasses the AI Gateway completion base and overrides execute to return IDs synchronously, so it fits the synchronous search request. Access is restricted to trial namespaces, the catalogue is built server-side from Sidebars::MenuItem so there is no duplicate feature list to maintain. The whole path is behind the default-off feature_discovery_gemini_search flag.

References

Screenshot_2026-06-30_at_14.48.07

How to set up and validate locally

  • In the Rails console enable the feature flag:
Feature.enable(:feature_library_modal)
Feature.enable(:feature_discovery_gemini_search)
Group.find_by(id: <Group ID>).gitlab_subscription.update(trial: true, trial_starts_on: 20.days.ago, trial_ends_on: 10.days.from_now)
  • Visit /-/onboarding/feature_library/search?query=custom_query&panel=group&resource_id=<Group ID>.
  • In log/llm.log verify there is a Gateway request with custom_query and features array:
{
    "severity": "INFO",
    "time": "2026-07-02T12:37:17.256Z",
    ...
    "meta.user": "root",
    "meta.gl_user_id": 1,
    "meta.client_id": "user/1",
    "url": "https://cloud.staging.gitlab.com/ai/v2/prompts/feature_discovery_search",
    "body":
    {
        "inputs":
        {
            "query": "custom_query",
            "features":
            [
                {
                    "id": "activity",
                    "name": "Activity",
                    "description": "Track what your team is working on and stay informed of changes"
                },
                {
                    "id": "members",
                    "name": "Members",
                    "description": "Control who has access to your group and what they can do"
                },
...
}

1.json

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #603091

Edited by Serhii Yarynovskyi

Merge request reports

Loading
Loading