Active Graph Agent Runtime (BabyAGI 4) — Yohei Nakajima, Untapped Capital
频道: AI Engineer
视频: https://www.youtube.com/watch?v=khVX_BUnEwU
原文语言: en
统计: 共 64 轮
[0:01]
[music]
[音乐]
[0:12]
Hi everybody. Thanks for coming. I'm excited to be here. AI engineer warfare has been so fun meeting everybody. Um, but I'm here to talk about active graph, which is my new open-source experimental approach to building agents, which looks a little bit different than maybe you've been building agents. Uh, it's definitely experimental. The idea is more to give you inspire you with some potentially new ideas.
大家好,感谢各位到场。我很高兴能来这里。AI Engineer 大会太有意思了,认识了好多人。不过我今天是来讲 active graph(活性图)的,这是我新做的一套开源实验性 agent 构建方法,跟大家平时构建 agent 的方式可能有点不一样。它绝对还处在实验阶段,我的目的更多是想用一些可能是全新的思路给大家一点启发。
[0:36]
Um, agents are awesome, but long-running agents break. And if they're so awesome, why am I still building them? Why they should build themselves. Let's build the simplest thing that can build itself has basically been kind of my research theme for the last 3 years since I did baby AGI back in March of 2023. So that's over 3 years ago. If you were there at the time, it was crazy. It went wild like it was covered by media. People
Agent 很棒,但长时间运行的 agent 会崩。而且如果它们真那么棒,为什么还得我来构建它们?它们应该自己构建自己才对。「构建出最简单的、能自我构建的东西」,基本上就是我过去三年的研究主题——从 2023 年 3 月我做出 BabyAGI 开始算起。到现在已经三年多了。如果你当时在场就知道,那阵子简直疯了,媒体铺天盖地报道。大家
[1:00]
thought it was going to work. It didn't work at all. Um,
都以为它能跑通。结果它根本跑不通。呃……
[1:03]
[laughter]
[笑声]
[1:04]
Uh, over the course of 3 years I've done nine iterations of baby AGI with less fanfare, but you know, every time just experimenting on like how do we get autonomous agents to actually work? Usually with the theme of self-improvement. Uh, if you go to baby AGI wiki, you can see earlier experiments. Um, in the in this process I kept coming up to coming back to graphs and I've had a couple of projects. Earlier I did a one called
这三年里,我一共做了九次 BabyAGI 迭代,声势没那么大,但每一次都在实验同一件事:怎么才能让 autonomous agent(自主 agent)真正跑起来?通常主题都围绕 self-improvement。你去 BabyAGI 的 wiki 上就能看到那些早期实验。在这个过程中,我一次次地回到 graph 上来,也做过几个相关项目。早期我做过一个叫
[1:24]
Instagraph and Mindgraph. That was like pre-graph rag rag. I did some code graphs, function graphs, log graphs. And since then it seems like a lot of people have started using graphs to build agents. Um, and so and in addition to that I've actually gotten to invest in a in a good number of, you know, agentic companies,
Instagraph 和 Mindgraph 的东西,那还是 graph RAG 出现之前。我还做过 code graph、function graph、log graph。从那以后,好像有很多人都开始用 graph 来构建 agent 了。另外,我其实也投资了相当一批 agent 方向的公司,
[1:41]
some of which you I'm sure you'll recognize through my funds Untapped Capital and I also have an agent fund. Uh, but yeah, that's that's me. Yohei, VC by day, builder by night. You might recognize this face more than this face. Um, ActiveGraph is an event-sourced graph runtime for building auditable agents. I have a paper that was my first archive paper called the log is the agent, but I'm here to explain it.
其中有些我相信你们会认识,都是通过我的基金 Untapped Capital 投的,我还有一支 agent 基金。不过总之,这就是我。Yohei Nakajima,白天做 VC,晚上做开发。你们可能对这张脸比对这张脸更眼熟。ActiveGraph 是一个 event-sourced(事件溯源)的 graph runtime,用来构建可审计的 agent。我写了一篇论文,是我第一篇 arXiv 论文,叫《The Log is the Agent》,不过今天我就当面给大家讲清楚。
[2:06]
So today most people build agents around the LLM. You start with the LLM, you add a response API, you give it tools, you add memory, and then you make sure you log everything correctly, which can give you you know all the benefits that ActiveGraph will give you, but ActiveGraph asks, what if you build around the log? Now what does that mean?
现在大多数人构建 agent 是围绕 LLM 来的。你从 LLM 起步,加一个 response API,给它配上 tool,加上记忆,然后确保所有东西都被正确地记录下来——这确实能给你 ActiveGraph 所能带来的那些好处。但 ActiveGraph 问的是:如果我们围绕 log 来构建呢?那这到底是什么意思?
[2:24]
Um means not everything the agent does, but more importantly, every change to the agent, right? Nobody here is using the same agent they were using a year ago, and the agent you're going to use a year from now is going to be different. And a lot of people, what the agent does and how the agent changes are tracked in two different places, but I'm saying let's flatten that down into a single immutable event log, and this is the
意思是,不只是记录 agent 做了什么,更重要的是记录对 agent 的每一次改动。要知道,在座没有人现在用的 agent 跟一年前是同一个,而你一年后要用的 agent 也肯定会不一样。对很多人来说,「agent 做了什么」和「agent 是怎么变化的」是记录在两个不同地方的。而我主张把这两者压平,合并成一份单一的、不可变的 event log,这才是
[2:47]
ground truth of the agent. And this projects a sort of graph. This is the state of the agent. And what I mean by that is, for example, a prompt can be edited multiple times, but you might have, you know, a master prompt that gets used when you're, you know, when you query the graph.
agent 的 ground truth(唯一事实来源)。而这份 log 会投影出一个 graph,这个 graph 就是 agent 的状态。我举个例子:一个 prompt 可能被编辑过很多次,但你在查询 graph 的时候,拿到的会是一个主 prompt。
[3:00]
And then on top of this, you attach something that I'm calling behaviors. Behaviors are reacts to graph changes. And then they emit events, which then in turn updates the state of the agent, which might trigger new behaviors. Um LLMs don't talk to each other in ActiveGraph. They all communicate through this shared state, and that's what makes it a little bit different.
然后在这之上,你要挂载一样我称之为 behavior(行为)的东西。behavior 是对 graph 变化做出反应的,然后它会发出 event,这些 event 又反过来更新 agent 的状态,而状态更新又可能触发新的 behavior。在 ActiveGraph 里,LLM 之间是不互相对话的。它们全都通过这个共享状态来通信,这就是它有点不一样的地方。
[3:24]
Behaviors can be deterministic, or they can include LLMs, which is which is how you build this agent. And you get this beautiful typed event log, uh that's the source of truth about everything the agent did and everything every change that's happened,
behavior 可以是确定性的,也可以内含 LLM——这就是你构建这个 agent 的方式。最后你会得到一份漂亮的、带类型的 event log,它是关于「agent 做过的一切」和「发生过的每一次改动」的唯一事实来源,
[3:38]
which means Oh, actually, well, shoot, I I jumped ahead. So in addition to that, there's a concept called policies, which determine how the graph can be modified. I'll come back to it, but for example, things like a source article that you found in research, you might be fine with adding, but if you're changing a prompt, maybe you want human in the loop. Or if you're changing a fact, you might want to make sure there's no
这意味着……哦,糟了,我跳快了。除此之外,还有一个概念叫 policy(策略),它决定 graph 可以怎样被修改。我待会儿再回来讲,但举个例子:比如你在研究中找到的一篇原始文章,直接加进去你可能觉得没问题;但如果你要改一个 prompt,也许你就想要 human in the loop(人类介入)。又或者你要改一个事实,你可能想确保没有
[3:56]
contradicting facts. So there's these thing called policies and again, I'll show you some code you code examples. But yeah, in the end you get this beautiful typed event log, which gives you replays. It gives you rollbacks and it gives you forks. And this becomes natively when you start building agents with ActiveGraph.
相互矛盾的事实存在。所以就有了 policy 这个东西,同样,我待会儿会给你们看一些代码示例。但总之,最后你会得到这份漂亮的、带类型的 event log,它让你能 replay(回放)、能 rollback(回滚)、也能 fork。当你开始用 ActiveGraph 构建 agent 时,这些都是原生自带的。
[4:15]
So this is the kind of LLM-centric versus log-centric way of building agents that I'm going to be talking about or showing you code for. And and again, I'll specify that this is not a harness. It's it's a runtime and you can actually rebuild most of the common harnesses on top of it. You're just forcing every single communication to communicate through the shared state.
所以这就是我今天要讲的、要给大家看代码的这种「以 LLM 为中心」对比「以 log 为中心」的 agent 构建方式。我再强调一次,这不是一个 harness(框架外壳),它是一个 runtime,而且你其实可以在它之上重建绝大多数常见的 harness。你只是强制让每一次通信都必须经过共享状态。
[4:33]
[snorts]
[吸鼻子]
[4:34]
So at the highest level, right? When you're building with agents, messages feels like the kind of core unit that you're seeing often, but we're going to replace that with logs. Logs are going to be the core unit you're going to build around. That's what you're going to be reading, that's what you're going to be looking at.
所以在最顶层来看,当你构建 agent 时,message 感觉像是你最常见到的那个核心单元,但我们要把它替换成 log。log 将成为你构建时围绕的核心单元。那才是你要去读的东西,才是你要去看的东西。
[4:46]
[snorts]
[吸鼻子]
[4:46]
These are typed logs, again, immutable, clean. You can't edit the graph. These are just kind of basic rules. Just emit events. You can have the add object, which is an event emitting. But yes, you can query over the graph. And again, I'm I'm flying through some of this cuz I want to get to the fun parts and all this is in the documentation.
这些是带类型的 log,再说一遍,不可变、干净。你不能直接编辑 graph。这些就是些基本规则,你只能发出 event。你可以用 add object 这类操作,那就是在发出一个 event。但没错,你是可以对 graph 做查询的。另外我讲得比较快,因为我想赶紧讲到好玩的部分,而且这些内容文档里全都有。
[5:03]
Behaviors listen to graph changes and emit events. So this is a behavior called a planner that triggers on a goal created, right? And then it adds an object to adds two task objects and a relationship object, a research, write memo, two tasks. And then actually behaviors can actually live on edges as a something called relation behavior.
behavior 监听 graph 的变化并发出 event。比如这里有个叫 planner 的 behavior,它由「goal created」触发,然后它添加了两个 task 对象和一个关系对象——研究、写备忘录,两个 task。而且 behavior 其实还可以挂在 edge 上,这叫 relation behavior(关系行为)。
[5:22]
This one has an unblock relation. So basically, when the research is done, you can write the memo, right? Um And behavior subscriptions can be pretty complex. They can be graph queries. So this one says on object created, if the if the object type is a claim,
这个例子里有个 unblock 关系。也就是说,研究一做完,你就可以去写那份备忘录了。而 behavior 的订阅条件可以相当复杂,可以是 graph 查询。比如这一条写的是:当对象被创建时,如果对象类型是 claim(论断),
[5:38]
and this claim contradicts another claim, we're going to trigger the contradiction detector. And these can be more complex than this. It can have, you know, uh confidence percentages baked into it um and and then on top of that, there's another concept called views.
并且这个 claim 与另一个 claim 相矛盾,我们就触发矛盾检测器。这些条件还能比这更复杂,比如可以把置信度百分比也写进去。然后在这之上,还有另一个概念叫 view(视图)。
[5:53]
Uh context management can be done programmatically as basically a graph query. It's a It's You basically grab a subset of the graph, which makes it available to that behavior. You can still do other types of context uh context management, but I felt like this kind of graph query as context management just felt really elegant.
context 管理可以通过编程方式来做,本质上就是一次 graph 查询。你基本上就是抓取 graph 的一个子集,让它对那个 behavior 可见。你当然还是可以用其他类型的 context 管理方式,但我觉得这种「用 graph 查询来做 context 管理」的做法真的非常优雅。
[6:10]
Candidly, I'm not the one writing the code, but AI seems to be pretty good at figuring out how to do it. Um and you know, I earlier I talked about policies, so some graph changes require a proposed patch before approval. Again, this is how you these these policies kind of give it the control on what it's allowed to change by itself, what uh what kind of changes require certain tests, um and I'll give a few examples in a bit, um or if you
说实话,代码不是我自己写的,但 AI 似乎挺擅长搞明白该怎么写。前面我讲到了 policy——某些 graph 变更需要先提交一个补丁提案,等待批准。同样,这些 policy 相当于给它设定了边界:哪些它可以自己改,哪些改动需要通过特定的测试,我待会儿会举几个例子;又或者如果你
[6:33]
want human in the loop, right? And you have these kind of policies that that determine or define uh what the uh what these rules are. And when you bring it all together, you got these kind of object schemas, tools, deterministic LLM behaviors can be assembled into a something called a pack, right? With a pack policy. And that's how you build Harness on top of ActoGraph. These And all of this together is and I'll have a couple
想要 human in the loop,也可以。你就用这些 policy 来确定或定义这些规则是什么。把这一切组合起来,你就得到了这些对象 schema、tool、确定性的和基于 LLM 的 behavior,它们可以被组装成一个叫 pack(包)的东西,再配上一个 pack policy。这就是你在 ActiveGraph 之上构建 harness 的方式。所有这些加在一起——我后面还会有几个
[6:58]
examples later um are are modular and they can be combined, uh but you're not just adding skills. It is much more complex about actually pretty unintuitive. I would never write code myself with ActoGraph, but again, AI seems really good at it.
例子——都是模块化的,可以自由组合。但你不只是在往上加技能,它其实要复杂得多,而且相当反直觉。我自己是绝对不会手写 ActiveGraph 代码的,但还是那句话,AI 好像特别擅长这个。
[7:12]
Um and just on like event types are fixed. You can add custom events, objects are user-defined. I only added that cuz someone asked me that question when I was showing them these slides, but think that makes sense. So, the old way, you got the while not done if loop. The new way, or at least my new way, uh you have a whole bunch of behaviors that don't talk to each other,
另外说一句,event 类型是固定的,你可以添加自定义 event;而对象是用户自定义的。我加这一页只是因为我给别人看这些幻灯片时有人问过这个问题,不过我觉得这样安排是合理的。所以,老做法是:写一个 while not done 的 if 循环。新做法,或者至少是我的新做法,是:你有一大堆彼此不对话的 behavior,
[7:29]
that just monitor the state. So, it's it's it's inspired by uh blackboard architecture from the '70s or '80s or more recently Kafka, whole bunch of micro workers communicating through a shared state. One of the challenges, at least back when uh blackboard was was that it was really unintuitive to write,
它们只是各自监控状态。所以这套东西的灵感来自七八十年代的黑板架构(blackboard architecture),或者说更近一点的 Kafka——一大堆微型 worker 通过共享状态来通信。至少在黑板架构那个年代,一个挑战是它写起来非常反直觉,
[7:44]
and the workers were very slim and deterministic. But now, AI writes the code, and the workers can be very powerful because they have reasoning capability. This is a React agent on Auto graph. React agent was one of the earlier agent kind of architectures. As you can see,
而且那些 worker 都很单薄、纯确定性。但现在,代码由 AI 来写,而 worker 可以非常强大,因为它们具备推理能力。这是一个跑在 ActiveGraph 上的 React agent。React agent 是早期的 agent 架构之一。你们可以看到,
[7:59]
it's it look it actually works the same way, but on goal created, you add a thought. On thought created, you trigger the reason function. So again, this is just to show that you can build any harness on top of Auto graph. It does look different um because they're not communicating with each other.
其实它的运作方式是一样的,只不过:goal 创建时,你添加一个 thought;thought 创建时,你触发 reason function。所以这同样是想说明,你可以在 active graph 之上构建任意一种 harness。它看起来确实不太一样,因为它们之间并不是互相通信的。
[8:13]
[snorts]
[笑声]
[8:13]
And so, to see if how well this can work, I've been running a lot of experiments. Um the first one I did was can I use the log itself as memory? So this is not pure vector rag. It's actually leveraging the structured log, so it knows which which message was before what, plus uh vec uh plus embedding the actual messages within the log. Uh I did this on long mem eval. I embedded the query. There was no semantic uh ingestion, no fact
那么,为了看看这套东西到底能work到什么程度,我做了很多实验。第一个实验是:我能不能把 log 本身当作 memory?所以这不是纯粹的 vector RAG,它实际上是在利用结构化的 log,它知道哪条消息在哪条之前,再加上把 log 里的实际消息做 embedding。我在 LongMemEval 上做了这个实验。我把 query 做了 embedding,没有语义化的 ingestion,没有 fact
[8:38]
extraction, no entity extraction, but I just embedded the query, looked for relevant messages, grabbed a couple messages before and after, made sure it fit into the context, and it actually did pretty well on long mem eval, right? Like a lot of the data in your memory is actually overlaps with the memory uh the data in your log. Actually having them the same actually kind of makes sense and makes sure they don't separate. Um I
extraction,也没有实体抽取,我就只是把 query 做 embedding,找出相关的消息,再抓取前后几条消息,确保能塞进 context 里。结果它在 LongMemEval 上表现相当不错,对吧?你 memory 里的很多数据,其实和你 log 里的数据是重叠的。让它们本来就是同一份东西,其实挺合理的,也能保证它们不会分叉。我
[8:59]
did try another couple other experiments on adding kind of semantic ingestion to improve the score. Was able to do it, but candidly, um I could put more effort into try to increase that, but I jumped onto the next experiment. Actually, but in that process, one of the biggest fun surprises was, I don't know if you've run long mem eval, but you have to like 500 questions. And then one of the runs,
还试了另外几个实验,加入了一些语义化的 ingestion 来提升分数。确实做到了,但坦白说,我本可以再多花点力气继续往上提,不过我直接跳到下一个实验去了。其实在那个过程中,最有意思的惊喜之一是——不知道你有没有跑过 LongMemEval,它有大概 500 道题。有一次跑到
[9:17]
uh my API key ran out like 350. I was like, "Oh Okay." So I updated the API key, said, "Okay, let's let's rerun it again." And it just like rolled back one and was like, "All right, we'll just start from, you know, question number 353." And I don't know if you have, but like I've built a lot of agents that like where the API key did broke or something, and I had to rerun the long agent from the beginning. and that just
第 350 题左右,我的 API key 额度用完了。我心想:"哦,行吧。"于是我更新了 API key,说:"好,我们重跑一遍。"结果它就往回滚了一条,然后说:"好的,我们就从第 353 题继续。"我不知道你们有没有过这种经历,我做过很多 agent,API key 挂了或者出别的问题,就得从头重跑整个长流程的 agent。而这种情况
[9:37]
has not been my experience since building with ActiveGraph, uh which was a very fun surprise. Uh I built a couple reference agents, uh right? Like now I have this runtime, let's see what I can build. I asked Replit to build a coding agent on top of ActiveGraph and and as a result it came with, you know, a event log graph. And again, I'll say this, you can do this with, you know, things like LangSmith.
自从我用 active graph 来构建之后就再也没发生过,这是个非常有趣的惊喜。我还搭了几个参考 agent。你想嘛,我现在有了这个 runtime,那看看能拿它建点什么。我让 Replit 在 active graph 之上构建一个 coding agent,结果它自带了一个 event log 和一张 graph。我还是要说明一下,这些你用 LangSmith 之类的工具也能做到。
[9:58]
Thing is, I don't know I didn't have to think about it. I just had to ask my coding agent to use ActiveGraph and this event log and graph came natively. Same thing with research agent. I just had just build a deep research agent on ActiveGraph and it came with this beautiful, you know, had a event event log and a graph of like where the evidence came from, what contradict to each other. And again, I didn't have to think about it. I just
关键在于,我根本不用去想这件事。我只需要让我的 coding agent 用 active graph,这个 event log 和 graph 就原生地出来了。research agent 也一样。我只是让它在 active graph 上构建一个 deep research agent,它就自带了这么漂亮的东西——有 event log,还有一张 graph,展示证据来自哪里、哪些互相矛盾。同样,我什么都不用去想,我只是
[10:20]
asked my agent to build a research agent on top of ActiveGraph and this is what it ended up looking like.
让我的 agent 在 active graph 之上构建一个 research agent,最后出来的就是这个样子。
[10:26]
[snorts]
[笑声]
[10:26]
Um and then I realized, okay, how do we get this closer to like an open claw or Hermes? So I I played around, I have this thing called uh ActiveGraph packs, which is a core pack, a tool pack, a secret pack, a memory pack, an identity pack, a communication pack, a chat pack.
然后我就想,好,那怎么把这个做得更接近 OpenClaw 或者 Hermes 那种东西?于是我折腾了一下,搞出了一个叫 active graph packs 的东西,包括 core pack、tool pack、secret pack、memory pack、identity pack、communication pack、chat pack。
[10:41]
So now you kind of get the idea of how I'm trying to build agents on top of ActiveGraph. And each of these packs have object types and behaviors. Again, feel probably feels very different from the way you're building agents, but I I I feel like it's actually pretty elegant. You can just take a memory pack and replace it with another another memory pack, right? Um uh uh and and it's not like skills, but like the objects and the rules and all
所以你大概能感觉到我是怎么试着在 active graph 之上构建 agent 的。每一个 pack 都有自己的对象类型和行为。这可能跟你们现在构建 agent 的方式感觉很不一样,但我觉得它其实相当优雅。你可以直接把一个 memory pack 换成另一个 memory pack,对吧?而且它跟 skills 不太一样,这些对象、规则等等全都
[11:04]
of them are uh bundled as a pack. And you and you attach these packs together to create your agent. Um and then I jumped into the the what I really wanted to do was start playing with self-improvement loops. Um I did a project called Regimes. I did uh uh that was in paper number two. Um This one you was a really controlled self-modification. Uh Claude Code called it Regime de Scene, but basically we classified the type of failure and then
打包成一个 pack。你把这些 pack 拼接在一起,就组成了你的 agent。然后我就一头扎进了我真正想做的事——开始玩 self-improvement 循环。我做了一个叫 Regimes 的项目,那是第二篇 paper 的内容。这个项目是一种受严格控制的自我修改。Claude Code 管它叫 régime de scène,但基本上就是我们对失败类型做分类,然后
[11:28]
based on the failure it classified it was a it was allowed to edit a specific part of the agent. Again, I did this on long mem eval. The loop was I think doing about 20 questions, looking at the answering questions, seeing where it failed, trying to self-modify,
根据分类出来的失败类型,它被允许去修改 agent 中特定的某一部分。同样,我是在 LongMemEval 上做的。这个循环大概是先做 20 道题,看看回答的情况,找出它在哪里失败了,然后尝试自我修改,
[11:42]
trying that on 50 different questions, see if the accuracy actually went up, and only if it went up, it would accept it. So, that was kind of the proposal patch that started happening, where it would do after it proposed change to itself, right? This is essentially the agent forking itself, proposing a change, doing a static gate check, a sandbox gate check, and then making sure it actually impacted the result, and only then accepted a change. And for
再在 50 道不同的题上试一遍,看准确率是不是真的提升了,只有确实提升了才会接受这次修改。所以那时候开始出现了这种"提案-补丁"的流程:它先给自己提出一个改动,对吧?本质上就是 agent 给自己 fork 一份,提出一个改动,做一次静态门禁检查、一次沙箱门禁检查,然后确认它确实影响了结果,只有到这一步才接受这个改动。而对于
[12:05]
these loops, it would loop like eight or 13 times, but only accept four or five of those patches. And it actually did have, you know, modest, but like statistically significant improvement on long mem eval scores. Uh and and not only did it know what worked, but it also knew what didn't work.
这些循环,它可能会跑上八次或者十三次,但只接受其中四五个补丁。而且它在 LongMemEval 的分数上确实带来了虽然不大、但统计上显著的提升。而且它不仅知道什么有效,它还知道什么没效。
[12:21]
Um at this point I was like, "Okay, can I can I get active graph to just research active graph for me?" So, I built lab uh active graph lab, which is reading all the blog posts. So, everything I've shared has a blog, a GitHub repo, and this lab is reading all of that to come up with new ideas,
到这个阶段我就想:"好,我能不能让 active graph 自己去帮我研究 active graph?"于是我搭了一个 active graph lab,它会读取所有的博客文章。我分享过的每样东西都有一篇博客、一个 GitHub repo,而这个 lab 会把这些全都读一遍,然后提出新的想法,
[12:35]
asking me if it can run it. And if I say yes, it'll run the experiment, um and then it'll write a blog post about it. It actually did find an error in its own code, asked me if it could it could if it could fix it. It wrote the PR, and then I just merged it. Um so,
再问我能不能跑这个实验。如果我说可以,它就会去跑实验,然后写一篇博客文章。它甚至真的在自己的代码里发现了一个错误,问我能不能修,然后它写了 PR,我直接 merge 了。所以,
[12:49]
it's it's early, but it's starting to work. It's the lab is self-improving. Um it also figured out that um it looked at active graph packs, and was able to just install a pack into itself, and then wrote a blog post saying packs are modular between repos. I was like, "I didn't know that. That's great." Um and then I got distracted when I saw this Pokémon trading card name competition on Kaggle. As you can see,
现在还很早期,但已经开始 work 了。这个 lab 在自我改进。它还搞明白了一件事:它去看了 active graph packs,然后就能把一个 pack 装到自己身上,接着写了篇博客说 pack 在不同 repo 之间是模块化可复用的。我当时想:"我都不知道这一点,太棒了。"然后我在 Kaggle 上看到一个 Pokémon 集换式卡牌的比赛,就跑偏了。你们也看出来了,
[13:08]
I'm all over the place. Um but uh you have to submit this deck in a deterministic agent, not with that with an LLM, and they compete in this Elo-style competition. So, my decks are, you know, every hour they're battling a new competitor, and their score goes up or down. Um and I felt like this was a pretty good uh test for seeing if active graph could help me increase my score.
我这人很跳脱。不过在那个比赛里,你要提交一套卡组,交给一个确定性的 agent 来打,不能用 LLM,然后大家在一个 Elo 积分制的比赛里对战。所以我的卡组每小时都会跟一个新对手对战,分数随之上下浮动。我觉得这是个相当好的测试场景,可以看看 active graph 能不能帮我把分数提上去。
[13:27]
And I used no cloud code and replit and we did about 80 different passes to like try different thing and and increase our score. Yeah, it might not make sense if you don't play Pokémon, but these things like let's try adding a couple energy cards. Seems like a very casual ask. Um and my agent, probably because I think because I'm using Actigraph, would say,
我同时用了 Claude Code 和 Replit,我们大概做了 80 轮不同的尝试,试各种东西来提高分数。是的,如果你不玩 Pokémon 可能听不太懂,不过就是像"我们试试多加几张能量卡"这种事。听起来是个很随口的请求。而我的 agent,我觉得大概是因为我用了 active graph,它会说:
[13:45]
"Okay, sounds great. Well, let's run 200 simulated games against three reference agents and then if the win rate increases by x% and there's a, you know, whatever Wilson score above 90 something, then we'll accept that as a change." And I basically did this like 80 times and each time they came with this like beautiful report of like why it worked, what it did, and what the verdict was. So, out of those 80 passes,
"好的,听起来不错。那我们就针对三个参考 agent 跑 200 局模拟对战,如果胜率提升了百分之多少,并且 Wilson 分数在 90 以上什么的,我们就接受这个改动。"我基本上就这么干了 80 次,每次它都会给出一份漂亮的报告,说明为什么有效、它做了什么、最终裁定是什么。所以在那 80 轮里,
[14:05]
it probably accepted about 20 to 30 and the score did slowly improve. I'm still at like 27%, so I don't know if I can get higher than that, but um what was most interesting is how much how well the agent understood experiments we've tried before that didn't work. And that was a very different experience for me.
它大概接受了 20 到 30 个改动,分数确实在缓慢提升。我现在还停在 27% 左右,不知道还能不能更高,但最有意思的是,这个 agent 对我们之前试过但没成功的实验理解得有多好。这对我来说是一种非常不一样的体验。
[14:22]
Cuz I've done a lot of YOLO agents where you just like keep trying things and then it works, you're like, "Yeah." But then I don't know the stuff that we tried that didn't work. But now when I'm building with Actigraph, it tracks all the things that didn't work because it's forced because I have this policy that says, "Here are the Here Here's what we have to do before we accept a change." Um So, some of the pleasant surprises, most
因为我做过很多"YOLO 式"的 agent,就是不停地试各种东西,成了就说"耶"。但我根本不知道哪些试过却没成。而现在用 active graph 来构建,它会追踪所有没成功的尝试,因为这是被强制的——我有一条 policy 写着:"在接受一个改动之前,我们必须做到以下这些。"所以,一些让人惊喜的地方,大部分
[14:44]
of which I mentioned, but AI does seem better at architecting these NL and base agents. It's just my personal experience and you know, some some people you'll have to try it yourself to see. But if you think about it, LLM based agents are like 3 years old.
我刚才都提到了,但确实:AI 在架构这类自然语言驱动的 agent 上,看起来是更擅长的。这只是我个人的体验,有些人可能得自己试试才知道。但你想想看,基于 LLM 的 agent 才出现三年左右。
[15:00]
But if you look at, again, Kafka, blackboard, this like micro worker communicating through a shared state, there's decades of conversations about how to make that work better. And my hypothesis is that that's in the training data. And there's just much less training data around how to build LLM based agents.
但如果你再看看 Kafka、blackboard 这类东西——一堆 micro worker 通过共享状态来通信——关于怎么把这件事做好,业界已经讨论了几十年。我的假设是,这些东西都在训练数据里。而关于怎么构建基于 LLM 的 agent,训练数据要少得多。
[15:16]
Um debugging shifted from session logs to Actigraph DB. Again, I didn't know it would, but when I, you know, when my coding agent was debugging, it just started querying the DB instead of the session logs because it's everything is already logged very cleanly and typed and it knows exactly how it's logged.
还有,debug 的方式从看 session log 转向了查 active graph 的数据库。同样,我事先并不知道会这样,但当我的 coding agent 在 debug 的时候,它就自己开始去查数据库,而不是看 session log,因为所有东西都已经被非常干净地、带类型地记录下来了,而且它清楚知道这些是怎么记录的。
[15:30]
Pox can be loaded easily from other repos was a surprise. I thought I had to do extra work to make that happen, but just worked. Um no more starting long runs over from the beginning and I know what didn't work, which are some of the things I shared.
pack 可以轻松地从其他 repo 加载进来,这也是个惊喜。我本以为还得额外做点工作才能实现,结果直接就 work 了。还有,不用再从头重跑长时间任务了,以及我能知道哪些尝试没成功——这些都是我刚才分享过的一些点。
[15:42]
Um here's where I might lose some serious researchers, at least in the language I use. I don't actually know how to train models or anything. So I'll caveat that. But I'm building this, I'm starting to really think that long-running agents need not just a world world model and like a predictive world model, but what I might call an experiential world model. Right? The predictive world model feels more like the priors, right? And then if you think
接下来这部分,至少从我用的措辞上,可能会让一些严肃的研究者听不下去。我其实并不懂怎么训练模型之类的,所以先声明一下。但在做这个东西的过程中,我越来越觉得:长时间运行的 agent 需要的不只是一个世界模型、一个预测式的世界模型,还需要我可能称之为"经验式世界模型"的东西。对吧?预测式世界模型更像是先验。然后如果你想想
[16:05]
about the hippocampus, actually it also does work like an like a immutable state uh event log that projects a state. And then it feeds some of that state back into your priors through a replays, dreaming, and sleep. And so, you know, I feel like some some discussions kind of suggests that as models get better, like the harness disappears. But I'm starting to think that's not true. I think we need both um is is kind of the new hypothesis
海马体,它其实也像一个不可变的、能投影出状态的 event log 在运作。然后它会通过回放、做梦和睡眠,把其中一部分状态反馈回你的先验里。所以,我感觉有些讨论似乎暗示:随着模型变得越来越强,harness 就会消失。但我开始觉得这并不成立。我认为两者我们都需要——这算是我新的假设吧。
[16:29]
that's growing as I as I've been playing with active graph. And if you think about like you or me, like you or me, like we're not our reasoning capability, right? We are we're closer to our our our beliefs, our knowledge, and behaviors that are derived from our actual life experience. And if that's the case, and we're going to you know,
随着我不断地摆弄 active graph,这个想法也在慢慢成型。你想想我们自己,你或者我,我们并不等于我们的推理能力,对吧?我们更接近于我们的信念、我们的知识,以及那些从真实人生经历中沉淀出来的行为方式。如果真是这样,而我们又要去……你懂的,
[16:45]
build agents inspired by ourselves, then then maybe our agent should be treated that way, too. Maybe that identity of the agent is is derived from its own log. Um I'd love for you to try it. You can just go and just say look up active graph and build me something I would like to your favorite agent who knows you better than I do, uh and have it explain if it's uh if it was helpful or not.
以我们自己为灵感来构建 agent,那么也许我们的 agent 也应该被这样对待。也许 agent 的身份认同,就来自它自己的那份日志。嗯,我很希望你能亲自试一试。你可以直接去查一下 active graph,然后跟你最喜欢的、比我更了解你的那个 agent 说:帮我造点我会喜欢的东西,再让它讲讲这套东西到底有没有用。
[17:07]
Um Let me know if you try it. Or hate it. Or building something relevant. Thanks for listening.
嗯,如果你试了,告诉我一声。或者你讨厌它,也告诉我。又或者你在做类似的东西。谢谢大家的聆听。
[17:31]
[music]
[音乐]