AI assisted troubleshooting
## Overview The GDK currently offers GDK doctor to view potential issues to resolve, and GDK report to gather data about a user's system, creating a GitLab issue, as troubleshooting functionalities. These tools offer a more diagnostic approach to troubleshooting, where users reach out to the dedicated `#gdk` channel, and potential solutions need to be researched. This leaves room for improvements in terms of self-service. By creating a connection to an AI, users could be more empowered to self-service the troubleshooting. ## Impacted categories The following categories relate to this issue: - [ ] gitlab-development-kit~26083594 - e.g. When a GDK action fails to complete. - [x] gitlab-development-kit~26083878 - e.g. Improvements or suggestions around how the GDK functions. - [ ] gitlab-development-kit~26083593 - e.g. When a GDK action is slow or times out. ## Steps to replicate (optional) <!--Clear steps of how to replicate the issue.--> ## Proposal Connect the GDK with an LLM that receives collected diagnostic data and opens a new chat for users to interact with.\ This can be potentially done using the [RubyLLM](https://github.com/crmne/ruby_llm) gem or just by leveraging the Claude API. ### Approach 1 Build the logic with the connection to an LLM within GDK doctor.\ Under the hood, GDK doctor gathers diagnostic data and sends an instruction to the configured LLM. The provided answer is printed to the user.\ To enable the LLM usage with GDK doctor, either a flag or a configuration needs to be set. Additionally, it's important to exclude any [Red data](https://handbook.gitlab.com/handbook/security/data-classification-standard/#red) from being sent to the LLM. ### Approach 2 Create a new command to troubleshoot using an LLM. When the command is used, the user is asked to describe their problem and post the errors they encounter. The provided context around the problem is accompanied by diagnostic data collected in the background. From here, users receive the answer from the LLM, and we close the chat, or we keep it open through the terminal, making it possible for users to further interact with the LLM.\ This command needs to be limited in order to prevent it from being used as a replacement for a usual LLM chat interface. Either by closing the chat after the first question, as mentioned, or by limiting the number of follow-up questions. Additionally, an estimation of the costs of this functionality needs to be provided. ### Approach 3 Users are asked to provide context and the specific error they are facing. This data is accompanied by diagnostic data and used to open a new LLM chat in the browser, where the first question is asked and the answer is loading. Ideally, users are already authenticated, and their own account is used to help with troubleshooting. ## Status <!-- STATUS NOTE START --> ## Status 2025-10-08 :bookmark: High-level summary The work for this epic was concluded. Now users with a valid `ANTHROPIC_API_KEY` can get assistance when `gdk doctor` detects unresolvable diagnostics. This feature was announced as experimental. :tada: **achievements**: - [Integrate AI into GDK doctor](https://gitlab.com/gitlab-org/gitlab-development-kit/-/merge_requests/5310) and shift troubleshooting left. :issue-blocked: **blockers**: - None. :arrow_forward: **next**: - We can close this epic. _Copied from https://gitlab.com/groups/gitlab-org/-/epics/19582#note_2805534312_ <!-- STATUS NOTE END --> <!--Thanks for contributing to GDK ♥️--> <!--template sourced from https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/.gitlab/issue_templates/Default.md-->
epic