Code Generation
Enhance software development workflows with Glean Assistant’s intelligent code generation capabilities
When Glean is connected to your organization’s code repositories like GitHub or GitLab, Glean Assistant gains powerful code generation capabilities that boost your software engineers’ productivity. Unlike traditional generative AI or co-pilot tools, Glean provides a unique advantage by understanding and incorporating context from multiple sources - including code, design docs, technical documentation, tickets, PRs, issues, and discussion threads.
Overview
By integrating with your organization’s code repositories, Glean enriches its enterprise knowledge graph to provide:
Code Search
Advanced search capabilities across current and historical code content, including pull requests and commits, helping developers quickly find relevant code examples and references.
Code Generation
Intelligent code snippet generation that aligns with your organization’s standards, accelerating feature development and bug fixes while maintaining consistency.
Key Benefits
Rapid Error Resolution
Quickly identify and resolve issues using a comprehensive database of code snippets, documentation, and previous solutions.
Automated Code Generation
Boost productivity with automatic generation of code snippets for both routine tasks and new feature development.
Knowledge Sharing
Facilitate effective communication of coding practices and standards across your organization.
Streamlined Onboarding
Accelerate new engineer integration with structured learning resources and codebase insights.
Example Queries
Code Context
- “How is
[system]
implemented at our company?” - “How do I debug/solve
[error]
?” - “Help me write code to do
X
in[language]
” - “Where is the code file that does
X
?” - “Help me write unit tests for
[file]
”
Process & Customer Context
- “What is the status of this week’s backend release?”
- “Who can I ask about
[system or feature]
?” - “How do I set up my dev environment?”
- “Which customers are using
[feature]
?” - “What customers have raised issues this week?”
Usage Scenarios
Adding to Existing Code
Situation
An engineer needs to create a new evalset, working with code spread across multiple files and languages. They need to leverage existing code rather than starting from scratch.
Example Queries
- “How do I add a new search evalset?”
- “How to create a new autocomplete evalset for history suggestions?”
Outcome
Glean Assistant identifies relevant files requiring changes and provides explanations with adaptable code snippets.
Debugging Errors
Situation
An on-call engineer encounters a panic occurring in specific product situations.
Example Queries
- “Help me debug [full panic error]”
- “Can you review the code and help me fix the panic?”
- “Give me a list of reviewers for this code change”
- “Can you create a PR description?”
Outcome
Glean Assistant analyzes the stack trace, suggests fixes, and assists with PR creation.
Feature Status Check
Situation
An engineer needs to determine a feature’s implementation status and customer requests.
Example Queries
- “Is [feature] enabled?”
- “What customers have asked for this feature?”
Outcome
Glean Assistant compiles information from design docs, code changes, and Jira tickets, including feature flags and customer requests.
Code Change Impact
Situation
An engineer debugging an error needs to understand recent changes affecting their component.
Example Queries
“What recent changes could have caused errors in runtime configs?”
Outcome
Glean Assistant analyzes recent changes across code, tickets, and discussions to provide a comprehensive summary.
Implementation Guidance
Situation
An engineer starting a new implementation needs guidance on multi-file changes across the stack.
Example Queries
“Where can I add a new endpoint for QE?”
Outcome
Glean Assistant provides file locations and required changes based on similar past implementations.
FAQ
Which datasources are supported?
Which datasources are supported?
Currently, code repositories in GitHub and GitLab are supported.
What permissions are required?
What permissions are required?
The permissions match those of the Glean GitHub and GitLab connectors exactly.
Is code search supported in search results?
Is code search supported in search results?
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.
How is my data secured?
How is my data secured?
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
What code file types are supported?
What code file types are supported?
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.