{"meta":{"title":"Indexing repositories for GitHub Copilot","intro":"Copilot improves responses by indexing your repositories.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/copilot","title":"GitHub Copilot"},{"href":"/en/copilot/concepts","title":"Concepts"},{"href":"/en/copilot/concepts/context","title":"Context"},{"href":"/en/copilot/concepts/context/repository-indexing","title":"Repository indexing"}],"documentType":"article"},"body":"# Indexing repositories for GitHub Copilot\n\nCopilot improves responses by indexing your repositories.\n\n## Benefit of indexing repositories\n\nCopilot's ability to answer natural language questions and complete tasks in a repository context is optimized when the semantic code search index for the repository is up to date.\n\n**Copilot will not use your indexed repository for model training.**\n\n## Semantic code search in Copilot Chat\n\nWhen 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 GitHub 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.\n\nFor more information on how to ask questions, see [Asking GitHub Copilot questions in GitHub](/en/copilot/using-github-copilot/asking-github-copilot-questions-in-github).\n\n## Semantic code search in Copilot cloud agent\n\nCopilot cloud agent uses semantic code search to find relevant code based on meaning, rather than relying solely on exact text matches with tools like `grep`. When the agent doesn't know the precise names or patterns to search for, semantic code search helps it locate the right code faster. No configuration is required—the agent automatically uses semantic code search when appropriate.\n\nFor more information about Copilot cloud agent, see [About GitHub Copilot cloud agent](/en/copilot/concepts/agents/cloud-agent/about-cloud-agent).\n\n## About index creation and use\n\nIndexing 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.\n\nOnce an index has been created for a repository, it can be used by:\n\n* Copilot Chat in GitHub and Visual Studio Code\n* Copilot cloud agent\n\n> \\[!TIP] There is no limit to how many repositories you can index.\n\n## Excluding content from Copilot Chat answers\n\nEnterprise or organization owners with a Copilot Enterprise or Copilot Business plan can define content exclusions to control the behavior of GitHub Copilot for the Copilot seats they manage. For more information, see [Excluding content from GitHub Copilot](/en/copilot/managing-copilot/managing-github-copilot-in-your-organization/setting-policies-for-copilot-in-your-organization/excluding-content-from-github-copilot).\n\nIf 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."}