动态上下文发生

Coding agents are quickly changing how software is built. Their rapid improvement comes from both improved agentic models and better context engineering to steer them.

编码代理正在迅速改变软件的构建方式。它们的快速改进来自于改进的代理模型和更好的上下文工程来引导它们。

Cursor's agent harness, the instructions and tools we provide the model, is optimized individually for every new frontier model we support. However, there are context engineering improvements we can make, such as how we gather context and optimize token usage over a long trajectory, that apply to all models inside our harness.

Cursor的代理工具,提供给模型的指令和工具,针对我们支持的每个新前沿模型进行了单独优化。然而,我们可以进行上下文工程改进,例如如何收集上下文和在长时间轨迹上优化令牌使用,这适用于我们工具中的所有模型。

As models have become better as agents, we've found success by providing fewer details up front, making it easier for the agent to pull relevant context on its own. We're calling this pattern dynamic context discovery, in contrast to static context which is always included.

随着模型作为代理的能力不断提高,我们发现通过提供更少的前期细节取得了成功,使代理更容易自行提取相关上下文。我们称这种模式为动态上下文发现,与总是包含的静态上下文形成对比。

#Files for dynamic context discovery

#动态上下文发现的文件

Dynamic context discovery is far more token-efficient, as only the necessary data is pulled into the context window. It can also improve the agent's response quality by reducing the amount of potentially confusing or contradictory information in the context window.

动态上下文发现的令牌效率更高,因为只有必要的数据被拉入上下文窗口。它还可以通过减少上下文窗口中可能混淆或矛盾的信息量来提高代理的响应质量。

Here's how we've used dynamic context discovery in Cursor:

以下是我们在 Cursor 中使用动态上下文发现的方式:

  1. Turning long tool responses into files
  2. 将长工具响应转换为文件
  3. Referencing chat history during summarization
  4. 在总结期间引用聊天历史
  5. Supporting the Agent Skills open standard
  6. 支持代理技能开放标准
  7. Efficiently loading only the MCP tools needed
  8. 高效加载仅所需的MCP工具
  9. Treating all integrated terminal sessions as files
  10. 将所有集成的终端会话视为文件

Tool calls can dramatically increase the context window by returning a large JSON response.

工具调用可以通过返回大型JSON响应显著增加上下文窗口。

For first-party tools in Cursor, like editing files and searching the codebase, we can prevent context bloat with intelligent tool definitions and minimal respon...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.148.3. UTC+08:00, 2026-01-09 15:53
浙ICP备14020137号-1 $访客地图$