Skip to main content
Code Tool Interface
Glean Assistant can be enhanced with code search and generation capabilities to support your development teams and engineers. This guide walks administrators through enabling these features to help development teams leverage Glean Assistant for more efficient coding practices.

Overview

The Code Tool capability enables Glean Assistant to understand your organization’s code repositories context, providing:
  • Contextually relevant search results for software engineers
  • Code suggestions that align with organizational standards across applications
  • Enhanced debugging capabilities through historical code analysis
  • Streamlined feature implementation and development workflows
The Glean Code Tool transforms how your teams interact with your codebase by enabling developers to search, understand, and leverage existing code directly through Glean Assistant.

Key Benefits

When you enable the Code Tool, your development teams gain powerful capabilities that enhance productivity:
  • Enhanced Code Understanding and Debugging: Developers can quickly understand recent changes that might affect components they’re debugging, allowing faster resolution of errors and bugs.
  • Feature Status and Implementation Insights: Teams can discover if features have been implemented, locate exact configuration flags, and access relevant design documents to streamline feature deployment.
  • Streamlined Code Implementation: The tool can analyze similar code patterns across your repositories, helping engineers identify which files need modification and suggesting appropriate code changes.

Learn More

Explore Usage Scenarios for the Code Tool in Glean Assistant

Configuration

In most cases, no explicit configuration is needed if your Glean environment meets the base requirements below.

Requirements

1

Connect a Code Repository

Ensure that GitHub or GitLab have been connected to Glean as a data source.
2

Crawl & Index the Code Repository

Once connected, GitHub/GitLab content has been fully crawled and indexed by Glean.
3

Complete ML Cycle

One cycle of Machine Learning (ML) has been completed since GitHub/GitLab was connected.
4

Enable Glean Assistant

Glean Assistant has been setup and enabled.

Troubleshooting

If you have linked GitHub or GitLab with Glean and notice that Glean Assistant isn’t conducting code searches or incorporating code in its responses, it is likely that the necessary machine learning workflows, which Glean periodically runs in the background, haven’t been executed on your indexed code yet. Glean runs several ML workflows monthly on your search index to:
  • Understand organizational synonyms, acronyms, and semantics (including code comprehension)
  • Enhance search result relevance and people suggestions
  • Enable query suggestions and predictive text
  • Train your organization’s unique language model for Glean Chat and Assistant
Please reach out to Glean’s support team to request a manual run of these workflows outside of their regular schedule.

FAQ

Currently, code repositories in GitHub and GitLab are supported.
The permissions match those of the Glean GitHub and GitLab connectors exactly. If your deployment already has GitHub or GitLab set up, the API usage and permissions required remain the same.
Currently, indexed code is only used for Glean Assistant responses. Glean Search matches PR descriptions and file names, but not code contents directly, to reduce result noise.
Code snippets become part of your organization’s Glean Knowledge Graph, ensuring:
  • Only users with existing code access can access it via Glean Assistant
  • Code snippets follow the same privacy guarantees as all other indexed Glean content
  • The security model is consistent with your existing GitHub/GitLab permissions
Glean Assistant searches through code in:
  • PR and Merge Request differentials
  • Latest commit and Main/Master branch files with extensions including (but not limited to):
    • Common languages: .js, .py, .java, .cpp, .go, .rb, .php
    • Web technologies: .html, .css, .scss
    • Configuration: .ini, .cfg, .cnf
    • And many more specialized formats
For a complete list of supported file extensions, please contact Glean support.
Setup involves ensuring GitHub/GitLab is enabled for your deployment, activating Glean Assistant, and ensuring a full crawl has been completed. The system will automatically begin indexing code content during regular crawls.
I