---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/concepts/code-assistant.md
title: AI in SourceCraft
description: 'An overview of AI-powered features in SourceCraft: the SourceCraft Code Assistant plugin, code editing, chat, AI code review, MCP server.'
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt


# AI in SourceCraft

<!-- source: en/_includes/sourcecraft/disable-ai-features-note.md -->
{% note warning %}

SourceCraft uses the capabilities of AI models within Yandex. For this to work, some of your [organization's](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#org) data needs to be sent to Yandex.

In private organizations, you can [disable](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/disable-ai-features.md) data transfers to Yandex, but this will limit [Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md)'s capabilities.

{% endnote %}
<!-- endsource: en/_includes/sourcecraft/disable-ai-features-note.md -->

The service provides the following AI functionality:
* [The SourceCraft Code Assistant plugin for Visual Studio Code and JetBrains IDE](https://sourcecraft.dev/portal/docs/en/code-assistant/index.md)
* [Code editing in the SourceCraft interface](#code-edition)
* [Chat mode in the SourceCraft interface](#chat-mode)
* [AI code review](#review)
* [SourceCraft MCP server](#mcp)
* [Generation of descriptions for pull requests](#description)
* [Vulnerability analysis and prioritization](#ca-triage)
* [AGENTS.md support](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/agentsmd.md)
* [AI skills](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md)
* [Setting up a configuration as code](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/configuration-edit.md)
* [SourceCraft CLI with built-in OpenCode](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/cli-quickstart.md)

<!-- source: en/_includes/code-assistant/ca-stats-tip.md -->
{% note tip %}

The SourceCraft UI provides detailed statistics on quota usage for [neurocredits](https://sourcecraft.dev/portal/docs/en/sourcecraft/pricing.md#cu) and [code autocompletion](https://sourcecraft.dev/portal/docs/en/code-assistant/concepts/index.md#autocompletion). For more information, see [Viewing Code Assistant usage statistics in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-assistant-stats.md).

{% endnote %}
<!-- endsource: en/_includes/code-assistant/ca-stats-tip.md -->

### Code editing in the SourceCraft interface {#code-edition}

<!-- source: en/_includes/sourcecraft/code-edition-description.md -->
Use the SourceCraft interface with built-in Code Assistant to edit your project code or [add](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/add-file-repo.md) new files and directories. You can introduce changes directly into the repository branch or through a [pull request](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr).
<!-- endsource: en/_includes/sourcecraft/code-edition-description.md -->

<!-- source: en/_includes/code-assistant/syntax-support.md -->
The smart autocompletion mode explicitly supports code autocompletion for the following programming languages and frameworks:

* C++
* Go
* Java
* JavaScript/TypeScript
* Kotlin
* Python
* Scala
* SQL
* Swift

Autocompletion may also work for other languages. For languages ​​that are less represented in public repositories, the number and quality of autocompletion prompts will be lower.
<!-- endsource: en/_includes/code-assistant/syntax-support.md -->

Code Assistant supports the following types of suggestions:
* Inline completion: Text autocompletion as you type. Works for code, texts, and documents.
* Full-function completion: Autocompletion of entire functions or methods.

<!-- source: en/_includes/code-assistant/help-indicator-load.md -->
When generating a suggestion, the <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="#787878" d="M12 4a8 8 0 0 1 7.89 6.7 1.53 1.53 0 0 0 1.49 1.3 1.5 1.5 0 0 0 1.48-1.75 11 11 0 0 0-21.72 0A1.5 1.5 0 0 0 2.62 12a1.53 1.53 0 0 0 1.49-1.3A8 8 0 0 1 12 4Z"><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg> loading icon will appear to the left of the editable code. If generation stops or there is no result, you will see the <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#787878" d="M7 14a.965.965 0 0 1-.712-.288A.972.972 0 0 1 6 13c0-.283.095-.52.288-.712A.97.97 0 0 1 7 12c.282 0 .52.096.713.288.193.192.289.43.287.712a.986.986 0 0 1-.288.713A.952.952 0 0 1 7 14ZM22 4v12.45a.968.968 0 0 1-.288.713.964.964 0 0 1-.712.287c-.25 0-.479-.083-.687-.25-.208-.167-.312-.417-.313-.75V4H7.275c-.333 0-.583-.104-.75-.312a1.071 1.071 0 0 1 0-1.375c.167-.207.417-.312.75-.313H20c.55 0 1.021.196 1.413.588.392.392.588.863.587 1.412Zm-5 7h-2.725c-.333 0-.583-.104-.75-.312a1.07 1.07 0 0 1 0-1.375c.167-.207.417-.312.75-.313H17c.283 0 .521.096.713.288.192.192.288.43.287.712 0 .283-.097.52-.288.713A.957.957 0 0 1 17 11ZM6 18l-2.3 2.3c-.317.317-.68.388-1.088.213-.409-.175-.613-.487-.612-.938V4.8l-.6-.6a.948.948 0 0 1-.275-.7.95.95 0 0 1 .275-.7.948.948 0 0 1 .7-.275.95.95 0 0 1 .7.275l18.4 18.4a.98.98 0 0 1 .288.688.925.925 0 0 1-.288.712.948.948 0 0 1-.7.275.948.948 0 0 1-.7-.275L15.15 18H6Zm1-7a.965.965 0 0 1-.712-.288A.972.972 0 0 1 6 10c0-.283.095-.52.288-.712A.97.97 0 0 1 7 9c.282 0 .52.096.713.288.193.192.289.43.287.712a.986.986 0 0 1-.288.713A.952.952 0 0 1 7 11Zm10-3h-6a.965.965 0 0 1-.712-.288A.973.973 0 0 1 10 7c0-.283.095-.52.288-.712A.97.97 0 0 1 11 6h6c.283 0 .521.096.713.288.192.192.288.43.287.712 0 .283-.097.52-.288.713A.957.957 0 0 1 17 8ZM4 6.8v10.325L5.15 16h8.05L4 6.8Z"/></svg> (no suggestion) icon.
<!-- endsource: en/_includes/code-assistant/help-indicator-load.md -->

For more information, see [Editing code in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-edit.md).

{% note tip %}

<!-- source: en/_includes/sourcecraft/spaces-tip.md -->
For full-out coding, there is a [Visual Studio Code](https://code.visualstudio.com/)-based cloud development environment called [SourceCraft Spaces](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/spaces.md) accessible via the browser.
<!-- endsource: en/_includes/sourcecraft/spaces-tip.md -->

{% endnote %}

### Chat mode in the SourceCraft interface {#chat-mode}

<!-- source: en/_includes/sourcecraft/ai-chat-description.md -->
The SourceCraft interface has a built-in chat with Code Assistant you can use to interact with the AI assistant.

The following scenarios are supported:
* SourceCraft user help, FAQ.
* Searching through the documentation.
* Generating code snippets.
* Explaining code in project files or individual file sections, including code in [markdown](https://en.wikipedia.org/wiki/Markdown) syntax intended for documentation.
* Help with debugging and troubleshooting.
* Generating tests for your code.
* Generating documentation.
* Scanning code for potential issues.
* Suggesting improvements and alternative solutions.
* Generating charts.
* Writing commit messages.

The page in the SourceCraft interface you view defines the context for Code Assistant, e.g., [repository](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#repos) files, current open file, [pull request](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr) or [issue](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#issues) content, etc.
<!-- endsource: en/_includes/sourcecraft/ai-chat-description.md -->

[AI skills](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md) are also available in chat mode.

For more information, see [Chat with Code Assistant in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-chat.md).

### AI code review {#review}

<!-- source: en/_includes/sourcecraft/ai-review-description.md -->
SourceCraft is equipped with a built-in system for automated AI code review of [pull requests](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr). The AI assistant analyzes code changes, detects potential errors, architectural issues, and style inconsistencies, and provides code quality improvement recommendations.

With AI code review, you can save time on manual reviews, enhance code robustness and readability, and accelerate the change acceptance process.
<!-- endsource: en/_includes/sourcecraft/ai-review-description.md -->

For more information, see [AI code review of a pull request in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-review.md).

### Working with an MCP server {#mcp}

<!-- source: en/_includes/sourcecraft/mcp-description.md -->
With [SourceCraft MCP](https://sourcecraft.dev/portal/docs/en/code-assistant/operations/agent/mcp/recommended-mcp-servers.md#src), you can manage SourceCraft entities though the Code Assistant chat interface, e.g., search for and complete [issues](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#issues), create [pull requests](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/index.md#pr), and more.
<!-- endsource: en/_includes/sourcecraft/mcp-description.md -->

For more information, see [Working with an MCP server SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/work-with-mcp.md).

### Generating descriptions for pull requests {#description}

<!-- source: en/_includes/sourcecraft/ai-gen-desc-intro.md -->
With [Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/code-assistant.md), you can automatically generate descriptions for new pull requests, as well as add and replace descriptions in previously created ones.
<!-- endsource: en/_includes/sourcecraft/ai-gen-desc-intro.md -->

<!-- source: en/_includes/sourcecraft/agents-md-tip.md -->
{% note tip %}

You can [set](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/generate-description.md#rules) the rules Code Assistant will follow to generate descriptions in the `AGENTS.md` file at the repository root.

{% endnote %}
<!-- endsource: en/_includes/sourcecraft/agents-md-tip.md -->

For more information, see [Generating a description for a pull request](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/generate-description.md).

### AI-powered vulnerability analysis and prioritization {#ca-triage}

<!-- source: en/_includes/sourcecraft/ca-triage-intro.md -->
For issues detected in the course of [static application security testing](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/security-overview.md#sast), there is triage, i.e, AI-generated tips with risk and criticality assessment, false positive probability analysis, and possible fixes.

For issues detected through [scanning of secrets](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/security-overview.md#secret-scanning) and [static application security testing](https://sourcecraft.dev/portal/docs/en/sourcecraft/security/security-overview.md#sast), you can perform triage, i.e., bulk AI-powered alert severity assessment.
<!-- endsource: en/_includes/sourcecraft/ca-triage-intro.md -->

<!-- source: en/_includes/sourcecraft/cu-consumption.md -->
{% note tip %}

Using this feature consumes neurocredits. Check your balance and usage history on the [Code Assistant statistics page](https://sourcecraft.dev/me/codeassistant/settings).

{% endnote %}
<!-- endsource: en/_includes/sourcecraft/cu-consumption.md -->

For more information, see [AI-powered vulnerability analysis and prioritization in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-triage.md).

#### Useful links {#see-also}

* [Getting started with SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/code-assistant/index.md)
* [AGENTS.md](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/agentsmd.md)
* [AI skills in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/ai-skills.md)
* [Editing code in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-edit.md)
* [Chat with Code Assistant in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-chat.md)
* [AI code review of a pull request in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/ca-review.md)
* [Working with an MCP server SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/work-with-mcp.md)
* [SourceCraft Spaces](https://sourcecraft.dev/portal/docs/en/sourcecraft/concepts/spaces.md)
