Skip to main content

About GitHub Copilot Memory

Find out how Copilot can store repository-level facts and user-level preferences, and use that knowledge in future work.

Who can use this feature?

  • Enterprises and organizations with a Copilot Enterprise or Copilot Business plan.
  • Individual users with a Copilot Pro or Copilot Pro+ plan.
    Sign up for Copilot

Note

  • This feature is currently in public preview and is subject to change.
  • User-level preferences are currently only available for users on a Copilot Pro or Copilot Pro+ plan.

Introduction

As a developer joining an existing codebase, you typically read the repository's README, coding conventions, and other documentation to understand how the project works and how to contribute. This helps you submit good quality pull requests from the start. Even so, the quality of your work steadily improves as you spend more time in the codebase and learn its nuances. In the same way, allowing Copilot to build its own understanding of your repository enables it to become increasingly effective over time.

Copilot can use Copilot Memory to store important facts about a repository. For users on a Copilot Pro or Copilot Pro+ plan, it can also persist personal preferences.

Copilot Memory stores:

  • Repository-level facts
    • Facts about a repository, such as coding conventions, architectural decisions, build commands, and project-specific rules.
    • Available to all users with access to Copilot Memory for that repository.
  • User-level preferences
    • Implied or stated personal preferences about how a user wants to interact with Copilot.
    • Available only to that user across Copilot interactions in all repositories.
    • Currently only available for users on a Copilot Pro or Copilot Pro+ plan.

We typically refer to these repository-level facts and user-level preferences as "memories," and they are only created in response to Copilot activity initiated by users who have Copilot Memory enabled.

Facts and preferences captured by one Copilot feature can be used by another. For example, if Copilot cloud agent discovers how your repository handles database connections, Copilot code review can later apply that knowledge to spot inconsistent patterns in a pull request. Similarly, if Copilot code review learns that certain settings must stay synchronized across two files, Copilot cloud agent will know to update both files when changing one.

Benefits of using Copilot Memory

Stateless AI doesn't retain an understanding of a codebase between interactions. This forces you to either repeatedly explain coding conventions and code-specific details in your prompts, or maintain detailed custom instructions files.

Copilot Memory:

  • Reduces the burden of repeatedly providing the same details in your prompts.
  • Reduces the need for regular, manual maintenance of custom instruction files.

By capturing and applying repository-level facts and user-level preferences, Copilot builds its own knowledge of your codebases and personal workflow, adapts to your coding requirements, and delivers more value over time.

Where is Copilot Memory used?

Copilot Memory is currently used by Copilot cloud agent, Copilot code review, and Copilot CLI. A few feature-specific limits apply:

  • Copilot CLI only applies stored facts and preferences for the user who initiated the operation.
  • Copilot code review uses repository-level facts only. User-level preferences are not applied during code review.

How Copilot Memory stores, retains, and uses information

Repository-level facts are stored with citations pointing to the code that supports them. When Copilot finds a fact relevant to its current work, it checks those citations against the current branch to confirm the information is still accurate. Only validated facts are used.

Copilot only creates repository-level facts in response to actions by users with write access to the repository who have Copilot Memory enabled. Once stored, those facts are available to any user who has access to Copilot Memory in that repository, but those facts can only be used in operations on the same repository. This keeps what Copilot learns about a repository scoped to that repository, preserving privacy and security.

User-level preferences are stored with citations that may include direct user quotes. When Copilot finds a preference relevant to its current work, it uses its best judgment to confirm the preference still applies.

Copilot only creates user-level preferences in response to interactions initiated by a specific user, and those preferences are only available in that same user's later interactions. They capture an individual's coding style and workflow patterns, and stay tied to the user who created them.

To prevent stale information from lingering, any stored fact or preference that goes unused is automatically deleted after 28 days. The 28-day timer may reset whenever Copilot successfully validates and uses an entry. Facts can also be captured from pull requests that were closed without merging. In those cases, the validation step ensures that Copilot's behavior is unaffected unless the current codebase still substantiates the information.

Repository owners can review and manually delete the repository-level facts stored for their repository. Users with access to user-level Copilot Memory can do the same for their own preferences. For more information, see Managing and curating Copilot Memory.

About enabling Copilot Memory

Copilot Memory is enabled per user, not per repository. Once a user has it enabled, Copilot can use Copilot Memory in any repository where that user works with GitHub Copilot.

For individual Copilot Pro and Copilot Pro+ subscribers, Copilot Memory is on by default and can be disabled in personal Copilot settings on GitHub.

For enterprise and organization-managed subscriptions, Copilot Memory is off by default. An enterprise or organization admin can enable it in their settings, which makes it available to all members who receive a Copilot subscription through that organization.

For more information, see Managing and curating Copilot Memory.