> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-context.md).

# Sonar Vortex context

## Overview

Sonar Vortex guides your agent inside the [agentic loop](/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/agentic-loop.md) of the [Agent Centric Development Cycle](/agent-centric-development-cycle/readme.md). It connects to SonarQube Cloud and provides deep, project-specific context to AI agents before they write or edit code. Agents can access these capabilities through the SonarQube CLI-installed skill, or through a locally running SonarQube MCP Server that connects to SonarQube Cloud.

This ensures that the resulting code isn't generic and adheres to your repository's unique standards.

### Core capabilities

* **Architectural awareness**: Helps agents navigate complex class hierarchies, trace upstream/downstream call flows, and understand execution paths.
* **Intelligent guidelines**: Automatically injects relevant coding rules, quality standards, and security requirements based on your project's history and the current task.
* **Semantic navigation**: Moves beyond simple text matching to retrieve code based on its actual meaning and structure using Abstract Syntax Trees (AST), semantics, and control flow information.
* **Third-party dependency guidance**: Helps agents assess the health and safety of third-party dependencies before they're introduced or updated.

## Tool categories

Sonar Vortex provides four context augmentation capability categories. For supported agents, the recommended setups are the SonarQube agent plugin and the SonarQube CLI, which install an agent skill that uses the local Context Augmentation tool. You can also expose the same capabilities as MCP tools by configuring a locally running SonarQube MCP Server that connects to SonarQube Cloud. Each category currently supports a specific set of languages, and we're actively expanding language coverage and adding more categories.

| Category                                     | Description                                                                                                                                                                                                                                                                                                                                                 | Supported languages                                                                                                                                                        |
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Coding Guidelines**                        | Recommends Sonar rules to follow, based on the project's historical SonarQube issues filtered by what the agent is about to do (prompt nature and categories).                                                                                                                                                                                              | All [SonarQube Cloud languages](/sonarqube-cloud/analyzing-source-code/languages.md)                                                                                       |
| **Third-party dependency health and safety** | Assesses whether a third-party dependency is healthy and safe to use before it is introduced or updated. Currently covers known security vulnerabilities, supply-chain malware, and license compliance, with more checks in progress. Available only with the [SCA](/sonarqube-cloud/advanced-security/analyzing-projects-for-dependencies-sca.md) feature. | All [SCA-supported languages and package managers](/sonarqube-cloud/advanced-security/analyzing-projects-for-dependencies-sca.md#supported-languages-and-package-managers) |
| **Architecture**                             | Exposes the current architecture graph and user-defined architectural constraints, so the agent understands the current architecture and stays aligned with the intended design.                                                                                                                                                                            | All [languages supported by Architecture](/sonarqube-cloud/architecture.md#supported-languages)                                                                            |
| **Semantic navigation**                      | Helps the agent understand the meaning of the code rather than relying on text-based grep, by exposing call stacks, class hierarchies, references, and exact source locations. This lets the agent navigate the codebase and modify the right places effectively.                                                                                           | Java, C#, JavaScript, TypeScript, Python, and Rust                                                                                                                         |

The full list of tools exposed by Sonar Vortex for context augmentation, with their input parameters, is defined on the [SonarQube MCP Server Tools](https://docs.sonarsource.com/sonarqube-developer-tools/sonarqube-mcp-server/reference/tools) page.

### Context augmentation for coding guidelines

The Sonar Vortex tool for guidelines injects relevant Sonar rules into the LLM context:

* Based on your prompt: for example, if your prompt involves access to DB, include all guidelines about DB.
* Based on the SonarQube issues found in files modified or related to the LLM task: for example, if the LLM plans to modify `DBStorage.java`, include guidelines from past issues in `DBStorage.java`.

![Diagram showing how Sonar Vortex Tools for Guidelines combine prompt classification from Sonar Rules with historically relevant issues from past analysis to augment the LLM context.](/files/VmztJoJLBUMcgH7SyrOU)

### Context augmentation for architecture

The Sonar Vortex tools for architecture give the LLM understanding of both the current architecture and the user-defined intended constraints, powered by semantic data from SonarQube Cloud's [Architecture](/sonarqube-cloud/architecture.md) feature. These tools enable the LLM to:

* Build "the right thing", better aligning with user goals, avoiding mistakes and rework.
* Build "the thing right", provide an output that is in line with architecture expectations.

![Diagram showing Sonar Vortex Tools for Architecture exposes context to the LLM based on SonarQube Architecture analysis configuration and results.](/files/MolIpUWAw0KMO2jAvM0R)

### Context augmentation for semantic navigation

The Sonar Vortex tools for semantic navigation give the agent an understanding of the code's meaning, helping it find the right locations to modify based on meaning rather than text. With this context, the agent can:

* Reach the correct solution faster by jumping straight to the right symbols, references, types, call flows, class hierarchies, etc.
* Reduce token usage and cost, by avoiding blind reads of entire files.
* Produce safer, less buggy changes, by surfacing every relevant location that needs updating so nothing is missed.

![Diagram showing Sonar Vortex Tools for semantic navigation expose context to the LLM based on the universal dependency graph built from the local workspace.](/files/HUCDenCm5j4m5TpljLLH)

## Setup

For step-by-step setup instructions, see [Installing Vortex](/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/how-to-guides.md).

## Related pages

* [Sonar Vortex analysis](/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-analysis.md)
* [MCP Server](https://docs.sonarsource.com/sonarqube-developer-tools/sonarqube-mcp-server/)
* [Tools](https://docs.sonarsource.com/sonarqube-developer-tools/sonarqube-mcp-server/reference/tools)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sonarsource.com/agent-centric-development-cycle/inside-your-agent-the-agentic-loop/sonar-vortex-context.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
