GitLab Duo Chat (Agentic)

  • Tier: Premium, Ultimate
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
  • Status: Beta

The availability of this feature is controlled by feature flags. For more information, see the history.

GitLab Duo Chat (Agentic) is an enhanced version of GitLab Duo Chat (Classic). This new Chat can autonomously perform actions on your behalf, to help you answer complex questions more comprehensively.

While the classic Chat answers questions based on a single context, the agentic Chat searches, retrieves, and combines information from multiple sources across your GitLab projects to provide more thorough and relevant answers.

GitLab Duo Chat (Agentic) can:

  • Search projects to find relevant issues, merge requests, and other artifacts using keyword-based search (not semantic search).
  • Access files in your local project without manually specifying file paths.
  • Create and edit files in multiple locations.
  • Retrieve resources like issues, merge requests, and CI/CD pipelines.
  • Analyze multiple sources to provide complete answers. Use Model Context Protocol to connect to external data sources and tools.
  • Provide customized responses by using your customized rules.
  • Create commits, when you use Chat in the GitLab UI.

For an overview, see GitLab Duo Chat (Agentic).

Use GitLab Duo Chat

You can use GitLab Duo Chat in:

  • The GitLab UI.
  • VS Code.
  • A JetBrains IDE.
  • Visual Studio for Windows.

Use GitLab Duo Chat in the GitLab UI

The availability of the new navigation and GitLab Duo sidebar is controlled by a feature flag. For more information, see the history.

Prerequisites:

To use Chat in the GitLab UI:

  1. On the top bar, select Search or go to and find your project.
  2. On the GitLab Duo sidebar, select either New GitLab Duo Chat ( pencil-square ) or Current GitLab Duo Chat ( duo-chat ). A Chat conversation opens in the GitLab Duo sidebar on the right side of your screen.
  3. Under the chat text box, turn on the Agentic mode (Beta) toggle.
  4. Enter your question in the chat text box and press Enter or select Send.
    • You can provide additional context for your chat.
    • It might take a few seconds for the interactive AI chat to produce an answer.
  5. Optional. You can:

If you reload the webpage you are on, or go to another webpage, Chat remembers your most recent conversation, and that conversation is still active in the Chat drawer.

Use GitLab Duo Chat in VS Code

Prerequisites:

Turn on GitLab Duo Chat:

  1. In VS Code, go to Settings > Settings.
  2. Search for agent platform.
  3. Under GitLab > Duo Agent Platform: Enabled, select the Enable GitLab Duo Agent Platform checkbox.

Then, to use GitLab Duo Chat:

  1. On the left sidebar, select GitLab Duo Agent Platform (Beta) ( duo-agentic-chat ).
  2. Select the Chat tab.
  3. Select Refresh page if prompted.
  4. In the message box, enter your question and press Enter or select Send.

Use GitLab Duo Chat in JetBrains IDEs

Prerequisites:

Turn on GitLab Duo Chat:

  1. In your JetBrains IDE, go to Settings > Tools > GitLab Duo.
  2. Under GitLab Duo Agent Platform (Beta), select the Enable GitLab Duo Agent Platform checkbox.
  3. Restart your IDE if prompted.

Then, to use GitLab Duo Chat:

  1. On the left sidebar, select GitLab Duo Agent Platform (Beta) ( duo-agentic-chat ).
  2. Select the Chat tab.
  3. In the message box, enter your question and press Enter or select Send.

Use GitLab Duo Chat in Visual Studio

Prerequisites:

Turn on GitLab Duo Chat:

  1. In Visual Studio, go to Tools > Options > GitLab.
  2. Under GitLab, select General.
  3. For Enable Agentic Duo Chat (experimental), select True, and then OK.

Then, to use GitLab Duo Chat:

  1. Select Extensions > GitLab > Open Agentic Chat.
  2. In the message box, enter your question and press Enter.

View the chat history

To view your chat history:

  • In the GitLab UI, on the GitLab Duo sidebar, select GitLab Duo Chat history ( history ).

  • In your IDE, in the upper-right corner of the message box, select Chat history ( history ).

In the GitLab UI, all of the conversations in your chat history are visible.

In your IDE, the last 20 conversations are visible. Issue 1308 proposes to change this.

Have multiple conversations

You can have an unlimited number of simultaneous conversations with GitLab Duo Chat.

Your conversations synchronize across GitLab Duo Chat in the GitLab UI and your IDE.

  1. Open GitLab Duo Chat in the GitLab UI or your IDE.

  2. Enter your question and press Enter or select Send.

  3. Create a new Chat conversation:

    • In the GitLab UI, you can do either of the following:
      • On the GitLab Duo sidebar, select New GitLab Duo Chat ( pencil-square ).
      • In the message box, type /new and press Enter or select Send. A new Chat conversation replaces the previous one.
    • In your IDE, in the upper-right corner of the message box, select New chat ( plus ).
  4. Enter your question and press Enter or select Send.

  5. To view all of your conversations, look at your chat history.

  6. To switch between conversations, in your chat history, select the appropriate conversation.

  7. IDE only: To search for a specific conversation in the chat history, in the Search chats text box, enter your search term.

Because of LLM context window limits, conversations are truncated to 200,000 tokens (roughly 800,000 characters) each.

Delete a conversation

  1. In the GitLab UI or your IDE, select the chat history.
  2. In the history, select Delete this chat ( remove ).

Individual conversations expire and are automatically deleted after 30 days of inactivity.

Create custom rules

Use custom rules to specify instructions for GitLab Duo Chat to follow for every conversation in your IDE.

You can create custom rules at two levels:

  • User-level rules: Apply to all of your projects and workspaces.
  • Workspace-level rules: Apply only to a specific project or workspace.

If both user-level and workspace-level rules exist, GitLab Duo Chat applies both to conversations.

Prerequisites:

Conversations that existed before you created any custom rules do not follow those rules.

Create user-level custom rules

User-level custom rules apply to all of your projects and workspaces.

  1. Create a custom rules file in your user configuration directory:

    • If you have set the GLAB_CONFIG_DIR environment variable, create the file at: $GLAB_CONFIG_DIR/chat-rules.md
    • Otherwise, create the file in your platform’s default configuration directory:
      • macOS: ~/Library/Application Support/glab-cli/chat-rules.md
      • Linux: ~/.config/glab-cli/chat-rules.md
      • Windows: %LOCALAPPDATA%\glab-cli\chat-rules.md
  2. Add custom rules to the file. For example:

    - Don't put comments in the generated code
    - Be brief in your explanations
    - Always use single quotes for JavaScript strings
  3. Save the file.

  4. To apply the new custom rules, start a new GitLab Duo conversation.

    You must do this every time you change the custom rules.

Create workspace-level custom rules

Workspace-level custom rules apply only to a specific project or workspace.

  1. In your IDE workspace, create a custom rules file: .gitlab/duo/chat-rules.md.

  2. Add custom rules to the file. For example:

    - Don't put comments in the generated code
    - Be brief in your explanations
    - Always use single quotes for JavaScript strings
  3. Save the file.

  4. To apply the new custom rules, start a new GitLab Duo conversation.

    You must do this every time you change the custom rules.

For more information, see the Custom rules in GitLab Duo Agentic Chat blog.

Update custom rules

To update your custom rules, edit and save the custom rules file. Then, start a new GitLab Duo conversation to apply the updated rules.

You cannot use Chat to edit your custom rules file directly.

To manage who must approve any changes to custom rules, use Code Owners.

Select a model

  • Offering: GitLab.com, GitLab Self-Managed
  • Status: Beta

When you use Chat in the GitLab UI, VS Code, or a JetBrains IDE, you can select the model to use for conversations.

If you open a previous chat from the chat history and continue that conversation, Chat uses the model that you previously selected.

If you select a new model when in an existing conversation, Chat creates a new conversation.

Prerequisites:

  • The Owner of the top-level group has not selected a model for the GitLab Duo Agent Platform. If a model has been selected for the group, you cannot change the model for Chat.
  • You must be using Chat in the top-level group. You cannot change the model if you access Chat in the organization.
  • The administrator has not selected a model for the instance. If a model has been selected for the instance, you cannot change the model for Chat.
  • Your instance must be connected to the GitLab AI gateway.

To select a model:

  • In the GitLab UI:

    1. Under the chat text box, ensure that the Agentic mode (Beta) toggle is turned on.
    2. Select a model from the dropdown list.
  • In your IDE:

    1. On the left sidebar, select GitLab Duo Agent Platform (Beta) ( duo-agentic-chat ).
    2. Select the Chat tab.
    3. Select a model from the dropdown list.

Select an agent

When you use Chat in a project in the GitLab UI, VS Code, or a JetBrains IDE, you can select a specific agent for Chat to use.

Prerequisites:

To select an agent:

  1. In the GitLab UI or your IDE, open a new conversation in GitLab Duo Chat.
  2. In the dropdown list, select an agent. If you have not set up any agents, there is no dropdown list, and Chat uses the default GitLab Duo agent.
  3. Enter your question and press Enter or select Send.

After you create a conversation with an agent:

  • The conversation remembers the agent you selected. You cannot select a different agent for that conversation.
  • If you use the chat history to go back to the same conversation, it uses the same agent.
  • If you go back to a conversation and the associated agent is no longer available, you cannot continue that conversation.

Prompt caching

Prompt caching is enabled by default to improve GitLab Duo Chat (Agentic) latency. When prompt caching is enabled, chat prompt data is temporarily stored in memory by the model vendor (Anthropic or VertexAI). Prompt caching significantly improves latency by avoiding the re-processing of cached prompt and input data.

Turn off prompt caching

You can turn off prompt caching for top-level groups in the GitLab Duo settings. This also turns off prompt caching for Code Suggestions.

Chat feature comparison

CapabilityGitLab Duo Chat (Classic)GitLab Duo Chat (Agentic)
Ask general programming questionsYesYes
Get answers about an open file in the editorYesYes. Provide the path of the file in your question.
Provide context about specified filesYes. Use /include to add a file to the conversation.Yes. Provide the path of the file in your question.
Autonomously search project contentsNoYes
Autonomously create files and change filesNoYes. Ask it to change files. Note, it may overwrite changes that you have made manually and have not committed, yet.
Retrieve issues and MRs without specifying IDsNoYes. Search by other criteria. For example, an MR or issue’s title or assignee.
Combine information from multiple sourcesNoYes
Analyze pipeline logsYes. Requires GitLab Duo Enterprise add-on.Yes
Restart a conversationYes. Use /new or /reset.Yes. Use /new or, if in the UI, /reset.
Delete a conversationYes, in the chat history.Yes, in the chat history
Create issues and MRsNoYes
Use Git read-only commandsNoYes
Use Git write commandsNoYes, UI only
Run Shell commandsNoYes, IDEs only
Run MCP toolsNoYes, IDEs only

Troubleshooting

When working with GitLab Duo Chat, you might encounter issues.

For information on resolving these issues, see Troubleshooting.

Feedback

Because this is a beta feature, your feedback is valuable in helping us improve it. Share your experiences, suggestions, or issues in issue 542198.