Skip to main content

Indexing repositories for Copilot Chat

Copilot Chat improves responses to questions about code by indexing your repositories.

Benefit of indexing repositories

Copilot Chat's ability to answer natural language questions in a repository context is optimized when the semantic code search index for the repository is up to date.

When you start a conversation with Copilot Chat that has a repository context, the repository is automatically indexed to improve context-enriched answers to your questions about the code's structure and logic in and Visual Studio Code. For example, you can ask “How does this repo manage HTTP requests and responses?” and Copilot Chat will reference relevant sections of your code to deliver an informed answer.

Copilot Chat will not use your indexed repository for model training.

For more information on how to ask questions, see Asking Copilot questions in .

About index creation and use

Indexing runs in the background and initial indexing can take up to 60 seconds for a large repository. Once a repository has been indexed for the first time, re-indexing is much quicker and the index will typically be automatically updated to include the latest changes within seconds of you starting a new conversation.

Once an index has been created for a repository, Copilot Chat uses it to answer questions asked by any Copilot user in and Visual Studio Code.

Tip

There is no limit to how many repositories you can index.

Excluding content from Copilot Chat answers

Enterprise or organization owners with a Copilot Enterprise or Copilot Business plan can define content exclusions to control the behavior of Copilot for the Copilot seats they manage. For more information, see Excluding content from Copilot.

If a semantic code search index is created for a repository that is included in a content exclusion policy, data is filtered according to the policy before being passed to Copilot Chat.