GitHub Intelligence 正式亮相:让代码、上下文与历史记录协同运作
英文标题:GitHub intelligence puts your code, context, and history to work
GitHub 推出 GitHub Intelligence 上下文与学习层,旨在打通 GitHub 数据图谱,使 AI Agent 能够跨会话记忆团队规范并理解代码历史,避免每次会话都“从零开始”。该体系整合了三大核心能力:现已面向付费用户全面公测转正(GA)的 Copilot Memory(公测数据显示其可使偏好遵循度达到 93%、工作流效率提升 42%)、进入公开预览的 Copilot Dreaming(通过后台反思自主提 PR 优化规则),以及强大的跨仓库语义代码搜索。这一演进标志着 AI 编程助手正在从单次单库的代码补全,跃升为能够跨项目协作、持续进化的团队级工程 Agent。
133.7 KB
121.6 KB
732.7 KB
中文
AI Agent 应当理解的不仅是你的代码库,还应当理解你团队的工作方式。你的偏好、仓库规范、技能(skills)以及自定义指令(custom instructions)指引着变更应如何进行,而相关仓库中的代码则能展示各个模块是如何协同工作的。如果没有这些上下文,Agent 就会耗费大量时间去重新发掘已知知识,并且可能会忽略团队的既有规范。
GitHub Intelligence 是源自 GitHub 数据图谱(graph of GitHub data)的上下文与学习层。它让这些数据对 Agent 产生实际价值,帮助它们记住你的工作习惯,保持引导规则的最新状态,并为下一项任务检索相关的代码与开发历史。其目标是让 Agent 能够站在你和团队已有认知的基础之上工作,而不是把每次会话都当作从零开始。
这正是在团队工作所沉淀之处进行构建的优势所在。仓库级别的记忆(repository memory)能够记录边缘情况(edge case)为何至关重要,以及哪项测试覆盖了它。GitHub Intelligence 允许 Agent 调用这些上下文,同时赋予开发者对 Agent 访问权限的控制能力。
带来这一能力的三项关键功能:
- Memory(记忆) 在不同会话间传递知识
- Dreaming(梦境) 保持上下文的最新状态
- Code search(代码搜索) 突破本地检出的范围
各功能的可用性与配置项各有不同。
GitHub Copilot Memory 现已面向 Copilot 付费方案正式全面推出(Generally Available, GA)。Copilot 能够跨会话和跨客户端记住个人偏好与仓库规范。记忆可以在 Copilot 应用、Copilot CLI、VS Code、Copilot 云端 Agent、Copilot 代码审查(code review)、Slack、Teams 以及 GitHub Mobile 中创建。
你可以对 Copilot 说:Remember to start my pull request descriptions with a TL;DR(记住在我的 Pull Request 描述开头加上 TL;DR),它就能在各类 Copilot 体验中复用这一偏好。仓库记忆可以记录正确的测试命令,或者团队期望 Copilot 如何核查其工作结果,从而让你减少在每次会话中重复说明规范的时间。Copilot 会话会自主生成并维护整理记忆,从每一次交互中持续学习。
在公开预览期间审查的使用了记忆功能的 Copilot CLI 会话中,有 93% 显示出对开发者偏好更好的遵循度,42% 的工作流因会话上下文中包含的记忆而表现出更高的效率。
你可以在 Copilot 应用、Copilot CLI 和 VS Code 中与记忆进行交互,也可以在 Copilot 设置中管理个人记忆,在此处你可以查看或删除已保存的偏好设置。
Copilot Dreaming 现已进入公开预览阶段,它通过反思过往工作来改进未来的 Agent 会话。
目前提供三种“梦境”类型:
- 个人记忆整理(Personal memory curation):根据你与 Agent 的对话更新记忆,使 Copilot 契合你的个人偏好。
- 仓库定制(Repository customization):管理仓库维度的记忆,并针对现有的 skills 和自定义指令文件提出更新与改进建议。
- 代码审查定制(Code review customization):将重复被采纳的代码审查反馈转化为面向 Copilot 代码审查的规则指引。
Dreaming 可以添加、更新和移除个人及仓库记忆。对已纳入版本控制的 skills 和指令所做的更改将通过 Pull Request 提交,供团队审查。
Dreaming 为可选开启(opt-in)功能:
- 个人订阅者: 在 Copilot 设置中启用个人整理,并在各仓库设置中启用仓库梦境。详见个人与仓库设置指南。
- 组织与企业用户: 管理员通过 Copilot 策略启用 Dreaming。企业管理员可以将该选择权委托给组织管理员。仓库梦境覆盖 Copilot Memory 仓库访问设置所允许的仓库。用户同时还必须在自己的 Copilot 设置中启用个人梦境。
执行梦境运行会消耗 AI 额度(AI credits)。关于前提条件、设置与成本,请参阅 Dreaming 官方文档。
软件项目很少只存在于单一仓库中。GitHub 代码搜索(GitHub code search) 可以帮助 Copilot 在相关项目与依赖项之间查找相关代码、配置、Schema 和文档,无需在本地克隆代码仓库。Copilot 可以搜索精确的文本和符号、使用正则表达式匹配模式,并按仓库、路径或语言缩小结果范围。语义搜索(Semantic search) 还可以根据代码的功能进行查找(例如“重试失败的支付”),即使你不知道对应的文件、函数名或它所在的仓库。
例如,你正在修复支付失败的问题,但重试逻辑分散在支付服务、共享库以及后台 Worker 中。你可以使用 /research 命令向 Copilot 提问:How do these components retry failed charges, and where could retries overlap?。Copilot 可以检查跨这些仓库的实现与调用方,帮助你在修改系统之前充分理解它是如何协同运作的。
这开启了以往需要你手动拼凑上下文的工作流:
- 规划架构迁移: 使用
/research识别跨仓库的实现与调用方,规划各服务所需的变更,并检查哪些项目仍在使用旧 API。 - 排查故障缺陷: 追踪跨微服务与共享库的相关实现,将具体代码引用引入排查过程,并利用该上下文提出协同修复方案。
- 遵循组织标准: 查找整个组织内的既有模式,并用它们来指导陌生代码库中的代码修改。
无论任务需要精确的符号、文件内容或路径中的正则表达式,还是自然语言描述,Copilot 都能在组织内的各仓库中搜索相关上下文。你无需再频繁克隆项目、查找文件并复制代码粘贴到对话中。此外,Copilot 也能获取做出正确变更所需的上下文。
你的团队不应该每次都向新的 Agent 重复传授同样的经验。GitHub Intelligence 帮助 Agent 传承这些经验,找到所需的上下文,让每次会话都更多地聚焦于你真正希望完成的工作。
欢迎在 GitHub Community 中参与讨论。
English / 原文
Agents should understand more than your codebase—they should understand how your team works. Your preferences, repository conventions, skills, and custom instructions guide how changes should be made, while code in related repositories can show how the pieces fit together. Without that context, agents spend time rediscovering knowledge and can miss your team’s conventions.
GitHub intelligence is the context and learning layer sourced from the graph of GitHub data. It makes this data useful to agents, helping them remember how you work, keep that guidance current, and find the code and development history relevant to the next task. The goal is for agents to build on what you and your team already know, rather than treating every session as a fresh start.
That is the advantage of building where your team’s work already lives. A repository memory can capture why an edge case matters and which test covers it. GitHub intelligence allows agents to use that context, with controls over what they can access.
Three capabilities bring this into your workflow:
- Memory carries knowledge between sessions
- Dreaming keeps the context current
- Code search reaches beyond your checkout.
Availability and settings vary by capability.
GitHub Copilot Memory is now generally available on paid Copilot plans. Copilot can remember personal preferences and repository conventions across sessions and clients. Memories can be created in the Copilot app, Copilot CLI, VS Code, Copilot cloud agent, Copilot code review, Slack, Teams, and GitHub Mobile.
You can tell Copilot, Remember to start my pull request descriptions with a TL;DR, and it can reuse that preference across Copilot experiences. Repository memories can capture the right test command or how your team expects Copilot to check its work, so you spend less time repeating guidance in each session. Copilot sessions autonomously generate and curate memories, learning from every interaction.
Among the Copilot CLI sessions reviewed during the public preview where the agent used memory, 93% showed better adherence to developer preferences and 42% showed more efficient workflows attributed to the memories included in the session context.
You can interact with memories in the Copilot app, Copilot CLI, and VS Code, or manage personal memories in your Copilot settings, where you can view or delete saved preferences.
Copilot dreaming, now in public preview, reflects on past work to improve future agentic sessions.
Three dream types are currently available:
- Personal memory curation customizes Copilot to your personal preferences by updating memories based on your agent conversations.
- Repository customization manages repository-scoped memories and proposes updates and improvements to existing skills and custom instruction files.
- Code review customization turns recurring accepted code-review feedback into guidance for Copilot code review.
Dreaming can add, update, and remove personal and repository memories. Changes to checked-in skills and instructions are proposed in pull requests for your team to review.
Dreaming is opt-in.
- Individual subscribers: Enable personal curation in your Copilot settings and repository dreams in each repository’s settings. See personal and repository setup.
- Organizations and enterprises: Administrators enable dreaming through Copilot policies. Enterprise administrators can delegate that choice to organization administrators. Repository dreams cover the repositories allowed by Copilot Memory’s repository access settings. Users must also enable personal dreaming in their own Copilot settings.
Dream runs consume AI credits. See the dreaming documentation for prerequisites, setup, and costs.
Software projects rarely live in a single repository. GitHub code search helps Copilot find relevant code, configuration, schemas, and documentation across related projects and dependencies without needing a local clone. Copilot can search for exact text and symbols, match patterns with regular expressions, and narrow results by repository, path, or language. Semantic search can also find code by what it does, such as retrying a failed payment, even when you don’t know the file, function name, or repository it lives in.
For example, you’re fixing failed payments, but retry behavior spans a payments service, a shared library, and background workers. Use /research to ask Copilot, How do these components retry failed charges, and where could retries overlap? Copilot can inspect implementations and callers across those repositories to help you understand how the system fits together before changing it.
That unlocks workflows that would otherwise require you to assemble the context yourself:
- Plan a migration: Use
/researchto identify implementations and callers across repositories, plan the changes each service needs, and check which projects still use the old API. - Investigate a bug: Trace related implementations across services and shared libraries, bring specific code references into the investigation, and use that context to propose a coordinated fix.
- Follow organizational standards: Find existing patterns across your organization and use them to guide changes in an unfamiliar codebase.
Whether the task calls for an exact symbol, a regular expression in file contents or paths, or a natural-language description, Copilot can search across repositories in your organization to find relevant context. You spend less time cloning projects, tracking down files, and copying code into the conversation. In addition, Copilot gets the context it needs to make the right changes.
Your team shouldn’t have to teach every agent the same lessons. GitHub intelligence helps agents carry those lessons forward, find the context they need, and put more of each session toward the work you actually want done.
Join the discussion within GitHub Community.