章鱼总结
00:00 / 24:01

OpenAI · 24:01

说话人 0

hey everybody has gone. Great, my name is Raj Patel. I'm part of our applied AI engineering team here at OpenAI, and excited to be with you all today. when we were naming the session what comes after loops, we joked that by the time we finished the content, everything would be outdated. so what we have today, it's for today. but that's honestly what building agents has been like for the past year or so. as models get better, things change how we build them, really does too. So today, Eric and I are going to rewind a bit, tell you about how we got here, some of the design decisions we made here at OpenAI, what you can do with agents today, and then share some stuff that we've been cooking. So before we get started, I want to rewind a bit. I want to take you guys back to when we launched ChatGPT. So when it first came out, the first thing I did was I had ChatGPT write FizzBuzz. Show of hands, how many of you have used Noah FizzBuzz? Cool, okay. For those of you who don't, this is a very common coding interview question we give to junior developers. ChatGPT gave me the code, I copied and pasted it into my code editor and I ran it. What was really, really cool was it ran, it actually worked, and everybody in the back can hear me right? Just want to make sure. Cool, sweet. So I was very blown away. I'm assuming a lot of you had a similar reaction as well. AI had gotten really, really smart, and it was the beginning of something big. But what was different was, I was still the one copying and pasting things. Right? I would write something in ChatGPT, copy to my IDE, and then seeing what happened. But you know that changes when we let AI take action. This video may look familiar. This is really when we let AI combine two things: reasoning and tool use. The video may look like this from the O3 launch video we gave O3 the task to analyze an image. you can see how it works with the image. it can zoom in, it can reason over the details, it can inspect things, figure out what to do next. that was really the big shift from the previous example where the ai was actually now using tools. it could take action, it could reason over the result, and it could plan its next step. This is what we call the agentic loop. In this example, we give it very bespoke tools. What happens when we give it access to a computer?

嘿,大家好,人都到齐了。 太好了,我叫 Raj Patel。 我在 OpenAI 的应用 AI 工程团队工作,很高兴今天能和大家在一起。 我们给这场分享定名时,说笑道:等我们把内容做完,一切可能都过时了。 所以我们今天要讲的,是今天适用的内容。 但说实话,过去一年左右构建智能体一直就是这样。 随着模型越来越好,我们构建它们的方式也在变,真的是这样。 所以今天,Eric 和我会稍微回顾一下,讲讲我们是怎么走到今天的,讲讲我们在 OpenAI 做过的一些设计决策,讲讲现在用智能体能做什么,然后分享一些我们一直在捣鼓的东西。 在开始之前,我想先回顾一下。 我想带大家回到 ChatGPT 刚发布的时候。 它刚推出时,我做的第一件事就是让 ChatGPT 写一个 FizzBuzz。 举个手,在座有多少人用 ChatGPT 写过 FizzBuzz? 好,不错。 没用过的朋友,这是我们经常拿来给初级开发者出的一道编程面试题。 ChatGPT 给了我代码,我把它复制粘贴到我的代码编辑器里然后运行。 真的特别酷的是,它跑起来了,而且真的能用。后面的朋友们都能听到我说话吧? 我只是想确认一下。 好,很好。 所以我当时非常震惊。 我猜你们很多人也有类似的反应。 AI变得非常非常聪明,这是某种重大变革的开端。 但不同的是,我仍然是那个复制粘贴东西的人。 对吧? 我会在ChatGPT里写点东西,复制到我的IDE里,然后看看会发生什么。 但当我们让AI采取行动时,情况就不同了。 这段视频你可能看着很眼熟。 这才是我们让AI结合两种能力的时候:推理和工具使用。 这段视频可能像O3发布会视频那样:我们让O3分析一张图片的任务。 你可以看到它如何处理这张图片。 它可以放大细节,可以对细节进行推理,可以检查各处,并弄清接下来该做什么。 这确实是与之前示例的重大转变,那时AI实际上开始使用工具了。 它可以采取行动,可以基于结果进行推理,还可以规划下一步。 这就是我们所说的智能体循环。 在这个例子中,我们给它的是非常定制化的工具。 如果我们让它能够访问计算机,会发生什么?

this is when we introduced codex. codex is our general agent here at OpenAI, and our design philosophy here is we want the agent to be able to act on its reasoning. it could try an approach, it could see what happened, it could change course. and really we built the codex around this idea of a model and a harness working together. What's also important is we train the model to actually work within this harness, so it understood the tools it had, it could learn how to use them, it can understand the feedback it was getting. And this union of the model and the harness is really what formed the codex agent, and really how we design the harness informs how we do training, and vice versa. How we train the model informs how we build the harness.

这就是我们推出Codex的时候。 Codex是OpenAI的通用智能体,我们的设计理念是希望智能体能够根据自己的推理采取行动。 它可以尝试一种方法,看看发生了什么,然后调整方向。 实际上,我们围绕模型与harness协同工作的理念构建了Codex。 同样重要的是,我们训练模型去真正在这个harness中工作,因此它理解自己拥有的工具,能够学习如何使用它们,也能理解它所获得的反馈。 而模型与框架的这种结合,正是Codex智能体真正形成的原因。我们如何设计框架,确实会影响我们如何进行训练,反之亦然。 我们如何训练模型,会影响我们如何构建框架。

So I want to dig into that a bit. Let's think back to our fizzbuzz example, right? I had to copy and paste code before both Codex and then the big jump we saw with GPT-5. We can now just hand over the whole task to the model. Codex could write the code, it could run it, it could check the output. If it made a mistake, it would then just go and fix it. What was cool was we could even automate fizzbuzz. So I now want to go and take a look under the hood of what the harness actually looks like. So really think about the harness, think of it as managing the instructions, the tools, and what the model actually sees, and the actual execution environment of its actions itself. It also manages the context, so what it carries from the next step to the next. And with Codex, we were very opinionated. You'll notice Codex is open source, by the way. We kept it very minimal. We want to give it very generalizable tools, and we want to think, hey, if we give it access to a computer, what does it need to act? So from the shell to the way it uses the file system or how it uses computer use, we were very opinionated about how we made the design. So the way you should think about Codex is, hey, if I can do a task on the computer, I want to give the model the ability to figure it out. want the model to generalize and just like you and I would be using the computer. So how does it work? Really, at the center of everything is the responses API. It's a loop that we manage in the responses API. We pass the tool definitions to the model, and now when the model requests a tool call, we manage the execution within the sandbox itself. We then manage the actual conversation context, and we append that. And the harness really decides whether we take a next step or a next turn.

所以我想就此深入探讨一下。 还记得我们的FizzBuzz例子吧? 在Codex之前,以及我们看到GPT-5带来的巨大飞跃之前,我还得复制粘贴代码。 现在我们可以直接把整个任务交给模型了。 Codex能够编写代码,能够运行它,还能检查输出结果。 如果它犯了错误,它就会直接去修正。 最酷的是,我们甚至可以把FizzBuzz自动化。 所以我现在想深入看看框架实际的内部结构。 所以请真正思考一下框架,把它看作是管理指令、工具、模型实际能看到的内容,以及其行动的实际执行环境本身。 它还管理上下文,也就是从一步传递到下一步的内容。 在Codex的设计上,我们非常有主见。 顺便说一下,你会注意到Codex是开源的。 我们让它保持得非常精简。 我们希望给它非常通用的工具,并且我们会想:如果给它访问计算机的权限,它需要什么才能行动? 所以从shell,到它使用文件系统的方式,或者它使用计算机的方式,我们在设计上都非常有主见。 所以理解Codex的方式是:如果一项任务我能在电脑上完成,我就想让模型有能力自己弄清楚怎么做。 我希望模型能够泛化,就像你和我使用电脑那样。 那么它是如何工作的呢? 真的,一切的核心是 responses API。 它是一个我们在 responses API 中管理的循环。 我们把工具定义传给模型,当模型请求调用工具时,我们就在沙箱内部管理执行过程。 然后我们管理实际的对话上下文,并把结果追加进去。 而 harness 真正决定我们是进入下一步,还是进入下一轮。

I talked about this a bit earlier, but the harness changed the way we approach training, and what we learned from building the harness informs how we train the model, and the capabilities we built into the model inform how we build the harness. I think the best example of this is how we trained compaction into both the harness and the model, especially in situations where one context window wasn't enough. For those of you who are familiar with this idea of context, really think of it as information the model has in front of it. This could be its instructions, the history of the work, the task, and as the agent kind of executes tool calls, as it reads files, as it checks results, the history grows, but that context window still has a limit. For long tasks, we need to make sure that we're giving it room to keep working, but not forget about the work it's already done. And that's where native compaction was really, really big in Codex as the context window filled up.

我之前稍微提到过这一点,但 harness 改变了我们进行训练的方式,我们在构建 harness 过程中学到的东西也影响了我们训练模型的方式,而我们为模型构建的能力又反过来影响了我们构建 harness 的方式。 我认为最好的例子就是我们如何将压缩(compaction)同时训练进 harness 和模型中,尤其是在一个上下文窗口不够用的情况下。 对于熟悉“上下文”这个概念的各位,可以把它理解为模型面前所拥有的信息。 这可能包括它的指令、工作的历史记录、任务本身;当智能体执行工具调用、读取文件、检查结果时,历史记录会不断增长,但上下文窗口仍然有上限。 对于长任务,我们需要确保为它留出继续工作的空间,同时又不会忘记它已经完成的工作。 这就是原生压缩在 Codex 中真正发挥重要作用的地方,它会在上下文窗口被填满时介入。

I'm sorry, and everybody can hear me, right? So I'll make sure louder. Okay, yes, I will talk louder. I promise. Okay, as the window fills up, we request compaction through the responses API. So if you guys have seen the slash compact endpoint, the responses API, we're calling that under the hood. This condenses the history of the conversation. It works into a smaller state, carries the goal forward. But what's really special in Codex itself is we actually train this idea of compaction into the model, so the model understands what it means to be compacted, it understands what it means to work forward from a compacted state, it understands to resume from compaction, so it understands what to keep in the conversation and what to remove as it goes forward. This unlocked a really big thing for us, and this was long horizon work. So the model could work across multiple context windows, could work across multiple compaction events.

抱歉,大家都能听到我说话吗? 那我再大声一点。 好的,是的,我会说大声一点。 我保证。 好的,当窗口快要填满时,我们通过 responses API 请求压缩。 如果你们见过 slash compact 端点,也就是 responses API,我们在底层调用的就是它。 这会压缩对话的历史记录。 它会将其转化为一个更小的状态,并将目标延续下去。 但 Codex 本身真正特别的地方在于,我们实际上把压缩这一理念训练进了模型中,因此模型理解什么是被压缩后的状态,理解如何从压缩后的状态继续工作,理解如何从压缩处恢复,因此它知道在对话推进过程中应该保留什么、移除什么。 这为我们解锁了一件非常重要的事,而这就是长时程工作。 所以模型可以跨越多个上下文窗口工作,也可以跨越多次压缩事件工作。

And now that it had the capacity to work longer, the next task was: how do we actually get it to keep going until it was done? Earlier models didn't understand the idea of what done meant, and they would make good progress, but they would just end their turn early. Right? I know I was not too happy about this, and this is something that Peter Steinberger, the creator of OpenClaw, put on Twitter, where it was just a way of getting the model to work longer and longer, and it was purely to queue a bunch of continuous statements over and over again. What Peter and pretty much all of us were doing was creating this idea of an outer loop. You just keep nudging the model until it finishes. So at this point, we really needed to understand how do you get the model to keep working. And this was really the foundational idea behind loop engineering. Geoffrey Huntley made this very popular with the idea of a Ralph loop. How many know what a Ralph loop is? Cool, sweet. So this was a kind of a brute force idea of like, hey, let me give it a bash loop. Let me get the agent to work against that prompt file and have it work over and over again. And we'd start each run with a fresh context window. We pick up the files from the last run and we keep going. What was really cool about the loop is that kept the agents just working. They would work towards some sort of objective. They would check what was done. They would keep going. It was really for us to manage how that loop was executed. How do I know if I made progress? How do I know when to stop? But really, this philosophy of keep iterating and trying again and again was this idea of loop engineering.

既然它已经有能力工作更长时间,下一个任务就是:我们究竟如何让它持续运行直到完成? 早期的模型不理解“完成”意味着什么,它们会取得不错的进展,但会过早地结束当前回合。 对吧? 我对此很不满意。OpenClaw的创建者Peter Steinberger在推特上发过一条内容,他的做法只是为了让模型工作得越来越久,本质上就是不断地反复排队发送一连串的持续性语句。 Peter和我们几乎所有人当时做的,都是在构建一种外层循环的理念。 你只需不断地推动模型,直到它完成为止。 所以在这个阶段,我们真正需要弄清楚的是:如何让模型保持工作。 这正是循环工程背后的基础理念。 Geoffrey Huntley通过“Ralph循环”这一概念让它广为人知。 有多少人知道什么是Ralph循环? 很好,不错。 所以这是一种比较暴力的思路,大意是:嘿,我给它写一个bash循环。 让智能体针对那个提示词文件工作,并让它一遍又一遍地工作。 而且我们每次运行都以一个全新的上下文窗口开始。 我们读取上一次运行留下的文件,然后继续推进。 这个循环真正酷的地方在于,它让智能体始终保持工作状态。 它们会朝着某种目标努力。 它们会检查哪些事情已经完成。 它们会一直运行下去。 其实这主要是为了让我们来管理这个循环是如何执行的。 我怎么知道自己有没有取得进展? 我怎么知道什么时候该停下来? 但说到底,这种不断迭代、一次次重新尝试的理念,就是“循环工程”的思路。

We brought that pattern into Codex with Dash Goal. So how many of you used Dash Goal before? Cool, sweet. So we did this with GPT-5.5, and the idea here was we wanted to make sure it survived beyond the end of a turn. Right? With Goal, we gave Codex an objective. The harness saves it separately outside of the actual core context window, so it can't be compacted. It tracks its status, and then it sees if the agent is done working. What was cool about dash goal was, since it was saved outside of the actual conversation window, you could just work for a very long time. You could work across multiple action events, and because there was always that nudge or that check to keep working, the model knew like, hey, I have to keep going. Or if there was an actual genuine blocker, it could make a request and say, hey, I'm blocked, I actually need to stop. and since this was done independently, the goal could survive the end of a turn and it would just keep working until it got the job done. but this gave us a really good kind of signal for training. hey, we understand what persistence is.

我们把这种模式引入了 Codex,也就是 Dash Goal。 那么在座的各位之前有多少人用过 Dash Goal? 很好,不错。 我们是在 GPT-5.5 上做的这件事,我们的想法是要确保它能够在一个回合结束之后依然持续存在。 对吧? 有了 Goal 之后,我们给 Codex 设定了一个目标。 这个框架会把目标单独保存在核心上下文窗口之外,因此它不会被压缩。 它会跟踪目标的状态,并检查代理是否已经完成工作。 Dash Goal 很厉害的一点在于,由于它被保存在实际对话窗口之外,你可以让它工作很长时间。 你可以跨越多个操作事件持续工作,而且因为始终有那种提醒或检查促使它继续工作,模型就会知道:嘿,我必须继续下去。 或者如果遇到真正的阻碍,它可以发出请求,说:嘿,我被卡住了,我确实需要停下来。 而且由于这是独立完成的,目标可以在一个回合结束后继续存在,并会一直工作直到完成任务。 但这给了我们一个非常好的训练信号。 嘿,我们理解了什么是持久性。

why don't we just build that into the model? and with GPT-5.6 that was a really big unlock. we trained persistence into the model itself. the model can understand what useful steps meant. they could check its own work and it wouldn't need another set of continues. Tobi Lütke, the CEO of Shopify, described it as the first model that no longer needed dash goal. It just kept going until it got the job done. And Ethan Mollick, a Wharton professor of AI, said he gave Codex access to his computer and had it play Slay the Spire 2 for about five hours straight. we now have models that can reason, they can generalize to new tasks, they can use a computer like you and i, and they can work coherently over a very long horizon.

为什么不直接把它构建进模型里呢? 借助 GPT-5.6,这是一个非常大的突破。 我们把持续性直接训练进了模型本身。 模型能够理解什么样的步骤才是有用的。 它们可以检查自己的工作,也不再需要另外一组 continue 来推动它继续。 Shopify 的 CEO Tobi Lütke 把它形容为第一个不再需要 dash goal 的模型。 它会一直运行,直到把任务完成。 沃顿商学院的 AI 教授 Ethan Mollick 则说,他让 Codex 访问自己的电脑,并让它连续玩了大约五个小时的 Slay the Spire 2。 我们现在拥有能够推理的模型,它们能够泛化到新任务,能够像你我一样使用电脑,并且能够在非常长的时间跨度内连贯地工作。

But I introduced a new set of challenges, right? Like how do we get the model to work faster? How do we get to parallelize work? And we introduced this idea of multi agents early into five six sol. But it wasn't until we got GPT-6 is when we got this huge leap in intelligence where we let the model actually coordinate itself. It understood how to decide to split up problems, work on different things. And now I'm going to hand it over to Eric to go into a bit more detail on how you can work from single agents to multiple agents. So that's not them.

但我也带来了一系列新的挑战,对吧? 比如,我们如何让模型工作得更快? 我们如何让工作并行化? 我们在 5.6 中较早引入了多智能体(multi agents)的理念。 但直到 GPT-6 推出,我们才迎来这次智能的巨大飞跃,让模型真正能够自行协调。 它明白了如何决定拆分问题,并让不同的部分同时进行处理。 现在我将把话筒交给 Eric,让他更详细地介绍如何从单个智能体过渡到多个智能体。 所以那不是他们。

说话人 1

Hey everyone, it's a much bigger crowd than I was expecting today. So I'm Eric, you may recognize me from my posts on X. I work on the DX team at OpenAI. My role here is to serve as your bridge to the talented researchers and engineers working on Codex, and a big part of that is finding best practices and putting them into words for you all to do more with Codex. So to build on Raj's walk down memory lane, let's take a look at Codex today and explore what's possible with all the capabilities we now have access to. When you're taking a long task, it's super tempting to start by building a whole team of agents, but you're almost always better off starting with just one and giving it a clear task and a way to check its work. The GPT-6 series can keep working, compact their context, and push through failures with no external loop telling them to continue for many tasks. That's honestly enough. Only add more agents when the work gives you a reason to.

大家好,今天的听众比我预期的多得多。 我是 Eric,你们可能在我在 X 上的帖子里见过我。 我在 OpenAI 的 DX 团队工作。 我在这里的角色是做你们与参与 Codex 工作的优秀研究人员和工程师之间的桥梁,其中很重要的一部分,是总结最佳实践并用文字表达出来,帮助大家更好地使用 Codex。 那么,接着Raj的回顾,我们今天来看看Codex,探索我们现在可以使用的所有功能能做些什么。 处理长任务时,很容易一上来就想组建一整支智能体团队,但通常最好从一个智能体开始,给它明确的任务,并提供检查其工作的方法。 GPT-6系列能够持续工作、压缩上下文,并在出现故障后继续推进,许多任务无需外部循环告诉它们继续。 说实话,这已经足够了。 只有当工作确实需要时,才增加更多智能体。

Okay, so what about tasks where that won't work, like a complete codebase refactor or a whole game? With GPT-6, our models were trained to coordinate and collaborate from the jump, and they can tackle these hard problems by breaking them down into independent pieces and multitasking. Using ultra codex will make copies of itself all on its own and collaborate with those copies to tackle even the largest of projects. But here's the thing: every agent codex brings in can dramatically increase token use without necessarily making the work faster or better. It's up to you to decide when a problem needs the extra help. Some tasks are obviously decomposable, like asking your agent to review five PRs. This makes it easy to be explicit, as you can ask Codex to assign a subagent to each one. Other tasks require broad research, like fixing a tricky race condition. Here, you can just ask Codex to use a couple of subagents to split up the investigation. A small nudge is enough for Codex to bring in help, and each added agent can keep its own working context and make progress on its part. With the right prompt, you can shape your agents into complex geometries. Be careful though, as it's easy to build structures that don't add any value. So what if we could automatically manage the reasoning effort and the models assigned to a given task using sub agents, so we don't have to think about it? This is where effort scaling comes in. With the we can introduce a lever that allows codex to ramp work up when it's really matters and down when it doesn't. With the right skill, you can have Sol ask Astra for help when it is spend a few turns iterating on a test failure and focus on the difficult part while keeping soul in charge of the integration. All the while, Luna agents can be handed simpler supporting tasks that don't need as much attention from Sol. This won't always cost you less, as even Astra can't perfectly predict which model will solve the task at the best price. But in many cases, it can be a huge help in helping you reduce the decision anxiety in picking the right model for the job. So here's a shortened version of a skill I've been working on called Coordinate. You can take a picture of it if you're around there. It's designed to be used by Sol Medium, which handles most work. When it runs into a problem, it's having trouble with, it's told to ask for help from Astra High. When it encounters simple busy work, it can toss those problems to Luna High Agents without a second thought. When I was working on a game porting project one weekend, I ran into a problem that got me to try a new agent structure. I'm calling it the pair. I had this old game I made years ago that was built with an ancient game engine I could no longer find. I had the project files and the running game, though. I wanted to take this old game, run it, and then visually recreate the running scene in Blender so I could continue working on it in a new game engine. To do this, I had Codex summon a pair of agents, where one side was tasked with getting the capture tech working in the old engine, and the other agent was tasked with unpacking and visualizing the scene in a workable format in Blender. Here the format could inform the capture tech, so it made sense for the two agents to split the work and keep the communication flowing, so that if one side found an optimization, the other could adapt. Setting up a pair takes a bit of special wording, since you'll have to make sure to define the communication boundaries pretty explicitly. So this prompt is pretty technical. Take a picture of it and ask Codex what it thinks. Maybe it'll find the perfect task in your project for a pair of sub agents. As you work in Codex, it's very common to have many different tasks running at the same time. Jumping between a bunch of threads can be pretty overwhelming though. An easy way to make this more manageable is to just ask Codex to manage the threads for you. In the ChatGPT app, Codex can start new threads and even send messages to and steer other running chats. These are distinct from sub agents, with each chat which each chat can also use. Think of it as your thread manager, taking in your overall goal and replacing that loose script you used to set up manually. Setting this up is super easy. You can just ask Codex to do it. Here's an example where you can just have it spin up a separate chat for every PR in your review queue. What's great is that you can just open the chats after they've been started and steer them manually if you want to stay involved. The best part though is that because our agents are so naturally chatty, they'll also keep the manager involved with all your meddling, so the work keeps moving even if you decide you no longer want to see it through. One of the big benefits of Codex compaction is that context can accumulate over time, and a thread can start to specialize around a long running task. Game projects can take months to complete, and are naturally broken down into distinct work streams like art, design, programming, and play testing. Here you can assign each of those lanes an agent who can run them like a department lead. The art director can handle all the environment art, while your play tester tries the latest build your programmer just finished. You can just give your notes and directions to the producer, while your agent team handles the rest. when you're getting your game project started, try setting it up with a prompt like this. it may not be the most efficient way to work token wise, but it's really handy to be able to drill down and brainstorm a new mechanic while your producer coordinates the next build to share. While agents love to collaborate, every time you make a new rule about how they're supposed to work together, they can start to stall out as they seek approval through made up hierarchies. I call this the middle management tax. Try not to overthink managing all your agents. It's just often not worth the hassle, and it makes it very easy to lose track of how complex your agent teams have gotten. Now before I wrap up today, I want to bring in one more thing that's made a huge difference in how well my agents have stayed on track through my constant steering. I don't know about you, but when I watch my agents work, I constantly nag them with little things I forgot to mention when I sent the first prompt. the problem is that after the agent compacts like three or four times, it might now have drifted from your original prompt, which still has a ton of important context about the overall goal. agents only have so much short term memory, and just like you, that little thing that you just can't get to just yet, that keeps nagging you. It will just keep nagging you unless you write it down. The trick to keeping your models on track as you constantly nag them with steers is to just ask them to keep a compact work log that contains the overall goal, running work, and how your last year relates to both. By writing it down, the agent can avoid losing track of active work streams or some weird precision you made to your agent when testing your beta version last Thursday. By keeping this work like compact, though, it stops your agent from maintaining a never-ending diary of every test that ever failed and why. Ask your codex to set one up and enjoy the freedom of just naturally micromanage your agent without it getting completely lost as it works.

好,那么对于像完整代码库重构或整个游戏开发这类单个智能体无法胜任的任务呢? GPT-6的模型从一开始就经过训练,能够协调与协作,它们可以把这些难题拆分成相互独立的部分,并同时处理多项任务。 使用超级Codex时,它会自行复制出多个副本,并与这些副本协作,应对即便是最大规模的项目。 但关键在于:Codex每引入一个智能体,都可能大幅增加token用量,却不一定让工作更快或更好。 由你来决定问题何时需要额外的帮助。 有些任务显然可以拆分,比如让你的智能体审查五个PR。 这样就很容易明确指示,你可以让Codex为每个PR分配一个子智能体。 其他任务则需要广泛的研究,比如修复一个棘手的竞态条件。 这时,你只需让Codex使用几个子智能体来分担排查工作。 只需稍作提示,Codex就会引入帮手,而且每个新增的智能体都能保有自己的工作上下文,并推进自己负责的部分。 借助恰当的提示,你可以把智能体组织成复杂的结构。 不过要当心,因为很容易搭建出没有任何价值的结构。 那么,如果我们能利用子智能体自动管理推理强度以及分配给某项任务的模型,让我们无需为此操心,会怎样? 这就是强度扩展(effort scaling)发挥作用的地方。 借助这一机制,我们可以引入一个调节杆,让Codex在真正重要时加大投入,在不重要时降低投入。 只要掌握正确的技能,你就可以让Sol在需要花几轮时间反复调试测试失败、专注于困难部分时向Astra求助,同时由Sol负责统筹集成工作。 与此同时,Luna代理可以被分配一些较简单的辅助任务,这些任务不需要Sol投入太多注意力。 这并不总是能省钱,因为即使是Astra也无法完全准确地预判哪个模型能以最优价格解决任务。 但在很多情况下,它能极大地帮助你减轻选择合适模型时的决策焦虑。 下面是我一直在开发的一项技能的简化版本,名为Coordinate。 如果你在相关场景中,可以拍下这张图。 它的设计初衷是由Sol Medium使用,它负责处理大部分工作。 当它遇到棘手的问题时,会被指示向Astra High求助。 遇到简单的琐碎工作时,它会毫不犹豫地把这些问题交给Luna High代理处理。 有一个周末,我在做一个游戏移植项目时遇到了一个问题,促使我尝试了一种新的代理结构。 我把它称为"配对"(pair)。 我有一款多年前制作的旧游戏,它是用一个我再也找不到的古老游戏引擎构建的。 不过,我还保留着项目文件和可运行的游戏。 我想把这款旧游戏运行起来,然后在Blender中以视觉方式还原运行时的场景,以便在新的游戏引擎中继续开发它。 为此,我让Codex调度了一对代理:一方负责在旧引擎中实现捕获技术,另一方负责解包场景并将其以可用的格式在Blender中可视化。 这里,格式可以为捕获技术提供参考,因此让两个代理分工合作并保持沟通畅通是合理的,这样一方发现优化方法时,另一方就能随之调整。 设置一对代理需要一些特殊的措辞,因为你必须明确地定义它们之间的沟通边界。 所以这个提示词相当偏技术性。 拍下它并询问Codex的看法吧。 也许它能在你的项目中找到适合一对子代理的完美任务。 在 Codex 中工作时,同时运行许多不同的任务是很常见的。 不过,在大量线程之间来回切换可能会让人应接不暇。 让事情更易于管理的一个简单方法,是直接让 Codex 替你管理这些线程。 在 ChatGPT 应用中,Codex 可以启动新线程,甚至向其他正在运行的聊天发送消息并引导它们。 这些与子代理不同,每个聊天本身也可以使用子代理。 可以把它看作你的线程管理员,接收你的总体目标,取代你过去手动设置的那段零散脚本。 设置这个非常简单。 你只需要让 Codex 去做就行。 这里有个例子,你可以让它为审查队列中的每个 PR 启动一个单独的聊天。 最棒的是,聊天启动后你可以随时打开它们,如果想参与其中,也可以手动引导它们。 不过最妙的一点是,由于我们的代理天生就很健谈,它们也会让管理员随时了解你的各种干预,因此即使你决定不再关注某项工作,它也能持续推进。 Codex 压缩功能的一大好处是上下文会随时间不断积累,线程可以围绕一个长期运行的任务逐渐变得专业化。 游戏项目可能需要数月才能完成,并且自然会被拆分为美术、设计、编程和测试等不同的工作流。 在这里,你可以为每条工作线分配一个代理,让它像部门负责人一样负责这条线的工作。 美术总监可以负责所有环境美术,而你的测试员则会试玩程序员刚完成的最新版本。 你只需把想法和指示交给制作人,剩下的工作由你的代理团队处理。 在开始游戏项目时,可以尝试用这样的提示词来进行设置。 从 token 效率来看,这可能不是最高效的工作方式,但能够深入探讨并构思新机制,同时让制作人协调下一个要分享的版本,确实非常方便。 虽然代理很喜欢协作,但每当你为它们如何协同工作制定一条新规则时,它们就可能因为要通过虚构的层级结构寻求批准而开始停滞。 我把这称为“中层管理税”。 不要过度纠结于管理你所有的代理。 这通常不值得费这个劲,而且很容易就会忘记你的代理团队已经变得多么复杂。 在我今天结束之前,我想再介绍一件事,它对我的代理在我不断引导下保持正轨,帮助非常大。 不知道你们怎样,但我在观察代理工作时,总会一直唠叨它们,补充一些我在发出第一个提示时忘记提到的小事。 问题在于,代理压缩上下文三四次之后,它可能已经偏离了你最初的提示,而那个提示里仍然包含大量关于整体目标的重要背景。 代理的短期记忆容量有限,就像你一样,那些一时想不起来、却一直在心里挠你的小事,代理也会这样。 除非你把它写下来,否则它会一直困扰你。 要让模型在你不断用引导提醒它们时保持正轨,诀窍就是让它们保存一份精简的工作日志,里面记录整体目标、正在进行的工作,以及你最后一次的指示与这两者的关系。 把内容写下来,代理就不会丢失正在进行的工作流,也不会忘记你上周四测试 beta 版本时对代理提出的某些特别要求。 不过,通过保持这种精简的工作日志,就能防止代理维护一本永无止境的日记,记录每一次失败的测试以及原因。 让你的 Codex 设置一个这样的日志吧,享受自然地微观管理代理的自由,同时又不必担心它在工作中彻底迷失。

Oh, and by the way, before I hand you back to Raj, I want you all to keep in mind that best practices have a shelf life, and you should never get attached to your workflows. Thanks for your time, everyone. And now for a sneak peek into the next generation of agents. 睡觉,起床。

哦,顺便说一下,在我把话筒交还给 Raj 之前,我想请大家记住,最佳实践是有保质期的,你永远不要对自己的工作流程产生依恋。 感谢大家的时间。 现在,让我们抢先一睹下一代代理的风采。 睡觉,起床。

说话人 0

Great, so Eric took us through what we can do today and kind of how we can organize multiple agents to work on everyday tasks. But now, what's next? Right? Instead of a handful of agents, how do we start thinking about things at really big scale? So what happens if we go from a few to a thousand? Right? How do we get them to work cohesively? How do we get them to maintain coherence? And how do we make sure that they're working towards a singular goal? you may have heard about our work with the navier stokes problem, which is a long standing millennium prize problem. here we used an internal model in codex and we found a solution with 10,000 agents working together. Across the full effort, there were 2.7 million messages and about 130 billion output tokens. I want everybody to take a minute to take that in. 2.7 million messages and 10,000 agents working together. So when you think about that scale, how you divide the work matters. How you manage context, how do you make sure the agents collaborate, and how do you make sure that you divide the work correctly? All that changes at this scale. Now I want to go into a bit of the architecture of how we approach the problem. You can refer to this pattern as agent teams. we let groups of agent teams work towards a unified goal. our objective is to do two things. we want to encourage both deep work, but we also want to encourage a wide research objective. right? let's walk through how we approached it. we started by initializing multiple teams with different version of the problem and prompted it to encourage different approaches. so the way to really think about this is these are individual teams with multiple sub agents underneath and they're all working towards that unified goal. What's important here is communication, right? Not only can they communicate with themselves, but they can also communicate across different teams, right? We want to make sure that they can share ideas. If I have a finding, hey, cool team one, you should know what team two just found out. I can ask questions of other teams, I can know what the other team is working on. and the big objective there is we want to prevent duplicative effort. this part's important, right? we talked about 10,000 agents. if all 10,000 are working on the same thing, that's really expensive, right? we want to make sure that we're encouraging diversity, and we want to know what each team is working on, so they're not all trying the same thing over and over again. What was important is, as the teams evolved, as they got deeper into their respective idea, what they actually did changed as well. One may have explored a hypothesis, one may have challenged assumptions, others ran experiments, but what was important is that every team still owned their own unique approach. As we got deeper into the problem, as new findings exposed new questions, we created and orchestrated new teams. We may have steered teams towards a more promising line, but the goal remained the same. The way we divided work can change, but the goal and objective does not. In Navier Stokes, when we found the unforced Euler result, we diverted all the teams towards solving the problem, and by the end of it, we had solved the solution. Um. this pattern has shown some incredible results for us, right? especially with models that are even more powerful than gpt six. With the internal model that we used to solve Navier Stokes, we were able to resolve more than 100 long standing problems across mathematics, and we continue to use it to find new discoveries in both math and science. I think we can all say we've come a long way from copying and pasting. So, as we say every single year, we're just getting started with agents. As model capabilities advance, the work we do with them can get a lot more ambitious. As we close today, my challenge to all of you in the audience would be take a problem that you've been putting off for a while, or one that previous models just couldn't. Take some of the approaches we talked about today. Check out the QR code that goes into more detail on how we approach the Navier-Stokes problem. You can always just build things.

好的,Eric 已经带我们了解了今天我们能做什么,以及如何组织多个代理来处理日常任务。 但接下来会怎样呢? 对吧? 与其只有几个代理,我们该如何开始思考真正大规模的情况? 那么,如果从几个代理扩展到一千个,会发生什么呢? 对吧? 我们要怎样让它们协同工作? 我们要怎样让它们保持一致性? 我们又要怎样确保它们都朝着同一个目标努力? 你们可能听说过我们在纳维-斯托克斯问题上的工作,这是一个长期存在的千禧年大奖难题。 我们在这里使用了Codex中的一个内部模型,并用10,000个智能体协同工作找到了一个解。 在整个过程中,共产生了270万条消息,以及约1300亿个输出token。 我希望大家花一分钟时间消化这个数字。 270万条消息,以及10,000个智能体协同工作。 所以当你考虑这种规模时,如何划分工作就至关重要。 如何管理上下文,如何确保智能体之间协作,又如何确保正确地划分工作? 在这种规模下,所有这些都会发生变化。 现在我想介绍一下我们解决这个问题的整体架构。 你可以把这种模式称为智能体团队。 我们让多个智能体团队朝着一个统一的目标协同工作。 我们的目标有两个。 我们既希望鼓励深入的工作,也希望鼓励广泛的研究目标。 对吧? 让我们来看看我们是如何处理这个问题的。 我们首先初始化了多个团队,每个团队处理问题的不同版本,并提示它们采用不同的方法。 所以真正理解这件事的方式是:这些是独立的团队,每个团队下面有多个子代理,它们都朝着同一个统一目标努力。 这里最重要的是沟通,对吧? 不仅他们自己内部可以沟通,他们还可以跨团队沟通,对吧? 我们希望确保他们能够分享想法。 如果我有一个发现,嘿,团队一,你应该知道团队二刚刚发现了什么。 我可以向其他团队提问,也可以了解其他团队正在做什么。 而其中的一个重大目标是防止重复性的工作。 这一点很重要,对吧? 我们之前谈到了一万个代理。 如果这一万个代理都在做同一件事,那成本非常高,对吧? 我们要确保鼓励多样性,并且要了解每个团队在做什么,这样它们就不会一遍又一遍地尝试同样的方法。 重要的是,随着团队的发展,随着它们对各自的想法越挖越深,它们实际所做的事情也发生了变化。 有的团队探索了一个假设,有的团队质疑了一些假设,还有的团队进行了实验,但关键在于,每个团队仍然保有自己独特的方法。 随着我们对问题的深入研究,新的发现暴露出新的问题,我们便创建并协调了新的团队。 我们可能引导团队转向更有希望的方向,但目标始终没有改变。 我们划分工作的方式可以改变,但目标和宗旨不会改变。 在纳维-斯托克斯方程的研究中,当我们发现无强迫欧拉结果时,我们把所有团队都引向解决这个问题,到最后,我们真的解出了答案。 嗯。 这种模式为我们带来了令人难以置信的成果,对吧? 尤其是对于那些比 GPT-6 还要强大的模型。 借助我们用来求解纳维-斯托克斯方程的内部模型,我们得以解决数学领域100多个长期存在的难题,并且我们仍在利用它在数学和科学中寻找新发现。 我想我们都可以说,我们已经从复制粘贴走了很远。 所以,正如我们每年都会说的那样,我们对智能体的探索才刚刚开始。 随着模型能力不断提升,我们与它们合作的工作可以变得更加雄心勃勃。 今天活动接近尾声,我想向在座的各位提出一个挑战:请选一个你拖延已久的问题,或者一个以前的模型根本无法解决的问题。 试试我们今天讨论过的一些方法。 扫描这个二维码,了解我们如何处理纳维-斯托克斯问题的更多细节。 你随时都可以动手去构建东西。

摘要

本视频由 OpenAI 应用 AI 工程团队的 Raj Patel 与开发者体验团队的 Eric 共同讲述,回顾了智能体从“复制粘贴”到自主执行、再到多智能体协作的演进脉络。内容涵盖推理与工具调用结合形成的智能体循环、Codex 中模型与 harness(运行框架)的共同设计与训练、上下文压缩、外层循环与 Dash Goal 等持久化机制,以及 GPT-6 带来的多智能体协调能力。Eric 结合实际工作流给出了单智能体优先、按需引入子智能体、线程管理与工作日志等实践建议。最后,演讲介绍了用约 10,000 个智能体协作求解 Navier-Stokes 问题的案例,并展示了“智能体团队”模式在大规模任务中的潜力。整体既是技术演进的梳理,也是面向开发者的实践指南。

章节

00:16 从复制粘贴到智能体循环

演讲者回忆 ChatGPT 刚发布时,他让它编写 FizzBuzz 并手动复制到编辑器运行,AI 已具备很强的代码能力,但人仍需充当搬运者。随着 AI 结合推理与工具使用,O3 能够缩放图像、检查细节并规划下一步,这形成了“智能体循环”:模型采取行动、解读结果并规划下一步。此后团队引入 Codex,设计理念是让智能体基于推理采取行动、尝试方案、观察结果并调整方向,并通过训练让模型学会在框架中使用工具和理解反馈。

开场问候,无明确视觉证据
讲者介绍
讲者身份介绍
内容更新快的背景说明
当天内容说明

02:42 Codex 中模型与 harness 的协同设计

Codex 的核心是模型与 harness 协同工作。harness 负责管理指令、工具、模型可见的内容、执行环境以及跨步骤的上下文。Codex 设计得较为精简,提供通用工具,如 shell、文件系统和计算机使用能力,目标是让模型像人一样使用电脑完成任务。训练与 harness 设计相互影响:harness 的设计指导训练,模型能力也反过来决定 harness 如何构建。

介绍 Codex 作为通用智能体的核心定位

03:25 Responses API 中的循环与执行机制

演讲者以 FizzBuzz 为例说明,过去需要手动复制代码,而 Codex 与 GPT-5 之后,模型可以直接接收完整任务,自行编写、运行、检查输出并修正错误。其底层核心是 Responses API 中维护的循环:系统将工具定义传给模型,模型请求工具调用后,由 harness 在沙箱中执行,再将结果追加到对话上下文中,并决定进入下一步行动还是下一轮对话。

章节代表画面

05:07 长任务中的训练协同与上下文压缩

上下文指模型当前可见的信息,包括指令、工作历史、任务以及工具调用结果。随着智能体读取文件、检查结果,历史不断增长,但上下文窗口有限。为支持长任务,团队在 harness 与模型两侧同时引入压缩机制:窗口接近上限时,通过 Responses API 请求压缩,将对话历史浓缩为较小状态并保留目标。这一机制最初由 harness 实现,随后被训练进模型,使其理解压缩状态、从中恢复工作,并知道保留什么、删除什么。

上下文窗口填满时原生压缩的作用,无明确画面证据,以代表性核心内容作为锚点

06:03 压缩训练带来的长程工作能力

原生压缩在 Codex 中解锁了长程工作能力:模型可以跨多个上下文窗口、经历多次压缩事件持续工作。在此之前,模型常常在取得一定进展后过早结束回合,不理解“完成”意味着什么。这种在模型理解压缩后仍能继续推进的能力,为后续解决“如何让模型持续工作直到任务完成”的问题奠定了基础。

模型训练中的压缩概念(无明确视觉证据,代表核心内容)

06:53 外层循环与 Ralph Loop

早期为让模型持续工作,开发者常在外层不断追加“继续”之类的提示,即外层循环。Geoffrey Huntley 推广的 Ralph Loop 是一种较粗暴的做法:用 bash 循环反复让智能体针对同一提示文件工作,每次以新的上下文窗口启动,并从上一轮保留的文件继续。这使智能体能够持续推进目标、检查完成情况。但团队需要解决的问题也随之出现:如何判断是否取得进展,以及何时停止。

Ralph loop 概念引入,代表外层循环的核心思路

08:25 Dash Goal:让目标跨越回合存续

团队随 GPT-5.5 推出 Dash Goal,目的是让任务在一个回合结束后仍能存续。用户给 Codex 一个目标后,harness 将其保存在核心上下文窗口之外,因此不会被压缩,同时跟踪目标状态,并检查智能体是否完成工作。这样智能体可以跨多个压缩事件长时间工作;若遇到真正的阻碍,它也可以提出请求并停止。该机制还为训练提供了信号,使团队得以思考如何将持久性直接融入模型。

Dash Goal 功能名称出现在开场,作为本段讨论的核心对象

09:26 GPT-5.6 将持久性内化为模型能力

GPT-5.6 的突破在于团队把持久性训练进了模型本身,使模型能判断哪些步骤有用、检查自身工作,因而不再需要外部的反复续写提示。Shopify CEO Tobi Lütke 称其为不再需要 Dash Goal 的首个模型。Wharton 教授 Ethan Mollick 则提到,他让 Codex 操作自己的电脑,连续玩了约五个小时的《Slay the Spire 2》。演讲者总结说,模型已能推理、泛化到新任务、像人一样使用电脑,并能长时间连贯工作。

Codex 代为操作电脑游玩 Slay the Spire 2 的过程画面
模型像人一样操作电脑的演示画面

10:10 从单智能体走向多智能体协调

长时间工作带来新挑战,例如如何提高速度、如何并行处理任务。团队在 GPT-5.6 时期早期引入了多智能体概念,但真正的飞跃出现在 GPT-6:模型能够自行协调,决定如何拆分问题并同时处理不同部分。随后 Eric 接手,说明如何从单个智能体扩展到多个智能体。

讲者强调模型开始自行协调多智能体,作为本段核心内容的代表性画面

10:46 先用单智能体,按需引入协作

Eric 指出,面对长任务时,直接组建完整智能体团队往往并不划算,更好的起点是一个智能体,配以明确任务和检查其工作的方法。GPT-6 系列可以持续工作、压缩上下文并克服失败,许多任务无需外部循环即可完成。只有当工作确实需要时才增加智能体。对于完整代码库重构或整款游戏这类复杂任务,GPT-6 训练时已具备协作能力,可拆分为独立部分并行处理,而 Ultra Codex 能够自行复制并与副本协作。但每增加一个智能体都可能大幅增加 token 消耗,未必让工作更快或更好,因此是否需要额外帮助要由使用者判断。

开场,演讲者面对较大听众
演讲者自我介绍
演讲者所在团队介绍
演讲者的工作职责与Codex相关
Codex当前能力概览

11:48 子智能体、努力程度调度与线程管理

对于可明确分解的任务,例如审查五个 PR,可以让每个子智能体负责一个部分;对于广泛调研,例如排查棘手的竞态条件,则可让几个子智能体分别调查。每个子智能体保有自己的工作上下文。通过“努力程度调度”,可让较强模型(如 Sol)负责主要工作,在遇到难题时请求更强模型(Astra),把简单任务交给较轻模型(Luna),但这不一定节省成本,也未必能完美预测最优模型。Eric 还演示了 Coordinate 技能、两个智能体配对完成游戏移植的案例,以及由 Codex 充当线程管理者并为每个 PR 开启独立对话的做法。针对长期项目,他建议将美术、设计、程序、测试等分配给不同智能体,同时警告过多的层级规则会造成“中间管理税”,导致智能体因等待审批而停滞。为防止压缩后丢失目标,他建议让智能体维护一份紧凑的工作日志,记录总体目标、进行中的工作及其关系。

完整代码库重构任务
拆分任务并多线程协作
Codex 复制自身并协作
多代理带来的 token 消耗增加
由用户判断何时需要额外帮助

19:22 Navier-Stokes 案例与智能体团队模式

演讲者以 Navier-Stokes 问题为例展示大规模智能体协作。团队使用 Codex 中的内部模型,由约 10,000 个智能体协同寻找解法,全过程产生约 270 万条消息和约 1300 亿个输出 token。其架构被称为智能体团队:多个团队以不同方案启动,每个团队下有子智能体,团队之间可以交流发现,以避免重复劳动,同时保持方法多样性。随着研究深入,团队会根据新发现不断建立或调整,目标保持不变。在找到相关结果后,团队将所有力量导向求解,最终得到解答。该内部模型还帮助解决了超过 100 个数学领域长期悬而未决的问题。

最佳实践与工作流的讨论
结束致谢
下一代智能体预告
无关口播内容
多智能体组织方式回顾

结论

02:01 智能体的核心是推理与工具使用结合形成的循环:模型采取行动、解读结果并规划下一步。

03:03 模型与 harness 需要协同设计,harness 的设计影响训练,模型能力也决定 harness 的构建方式。

06:03 上下文压缩与持久性被逐步训练进模型,使长时间、跨多个上下文窗口的任务成为可能。

11:30 多智能体并非越多越好,应先用单智能体解决问题,只有在任务确实可分解时才增加子智能体,因为每增加一个智能体都会显著增加 token 消耗。

20:39 在大规模协作中,划分任务、保持目标一致并避免重复劳动比单纯增加智能体数量更为关键。