GitLab Knowledge Graph
The GitLab Duo Agent Platform uses the GitLab Knowledge Graph to increase the accuracy of AI agents. You can use the Knowledge Graph framework in your AI projects to enable rich code intelligence across your codebase. For example, when building Retrieval-Augmented Generation (RAG) applications, the Knowledge Graph turns your codebase into a live, embeddable graph database for AI agents. The Knowledge Graph also creates architectural visualizations. This provides insightful diagrams of your system’s structure and dependencies.
You can install the Knowledge Graph framework with a one-line script. It parses local repositories, and connects using the Model Context Protocol (MCP) to query your projects. The Knowledge Graph captures entities like files, directories, classes, functions, and their relationships. This added context enables advanced code understanding and AI features. For example, this allows Duo agents to understand relationships across your local workspace and enables faster and more precise responses to complex questions.
The Knowledge Graph scans your code to identify:
- Structural Elements: Files, directories, classes, functions, and modules that form the backbone of your application.
- Code Relationships: Intricate connections like function calls, inheritance hierarchies, and module dependencies.
The Knowledge Graph also features a CLI. For more information about the Knowledge Graph CLI (gkg
)
and framework, see the
Knowledge Graph project documentation.
Feedback
This feature is in beta status. Provide feedback in issue 160.