---
title: "Connect a code repository"
description: "Connect GitHub once, then choose which repositories Kai Support, custom agents and Kai Code may use."
url: https://help.gleap.ai/fr/articles/264-connect-a-code-repository
collection: "Investigations and Kai Code"
updated: 2026-11-16
language: fr
alternates: [en]
---

# Connect a code repository

Connect GitHub once, then choose which repositories Kai Support, custom agents and Kai Code may use.

Code knowledge helps Kai answer questions about behaviour that was never documented. Open **Settings → Apps** to connect GitHub, then choose the repositories each agent may use.

The current repository experience shares one connection and repository settings. Access to a repository and permission for an agent to use it are separate choices.

### Connect and select repositories

1.  Connect **GitHub** from **Settings → Apps → Add app**, or from the agent’s Code page.
    
2.  In GitHub, grant access only to the repositories Gleap needs.
    
3.  Open **AI agents → Kai Support → Settings → Code knowledge** or a custom agent’s **Code** page.
    
4.  Choose **Add repositories**, search and select the repositories that agent should answer from.
    
5.  Check the repository’s index state and resolve any access or indexing warning.
    

![Knowledge repositories screen in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/LsZO8VAHpDlueevtDNR0GNE3hxMbi8SQgBLbh9bLKvbsfAcMlDeYJZyhQ9bzEm54l8a5HV6pKs6.png)

For coding work, add repositories under **AI agents → Kai Support → Settings → Code fixes → Repositories**. Kai Support and Kai Copilot answer from connected repositories by default. Open the repository’s **Used by** section to review their switches and the other agents using it.

### Review the shared repository settings

Open a repository to see **Used by**, its **Index** and **What Kai reads**.

-   **Branch** follows the default unless you pin another branch.
    
-   **About this repository** explains its purpose to agents.
    
-   **Hidden from Kai** excludes paths that should not be read.
    
-   Pushes refresh the index automatically; **Reindex** starts a full refresh.
    

Shared settings affect the agents using that repository. Check Used by before changing them.

### Keep knowledge current

An index should describe the version customers are using. Check its status after releases and inspect errors instead of assuming that a connected repository is ready.

Where a project still shows the older provider and indexing screens, follow the controls shown there. Those can include a separate indexing confirmation and provider-specific setup.

### Review before using code in customer answers

Exclude credentials, infrastructure and sensitive test data before indexing. Test questions whose answers should come from code, and verify that internal names or unreleased work do not leak into customer-facing explanations.

Code complements support knowledge. It explains behaviour; policies and customer instructions still belong in written sources.

### Related

-   [Control what Gleap reads from your repository](https://help.gleap.ai/en/articles/380-control-what-gleap-reads-from-your-repository.md)
    
-   [Get started with Kai Code](https://help.gleap.ai/en/articles/16751972-get-started-with-kai-code.md)
    
-   [What your AI can learn from](https://help.gleap.ai/en/articles/258-what-your-ai-can-learn-from.md)
