LangChain 的主动式智能体工程实践
原题Proactive Agent Engineering — Sydney Runkle, LangChain
看前速览
LangChain 的悉尼·伦克尔解释了智能体如何持续推进长期目标,又能让负责监督的人把注意力留给重要决定。
推进目标时,把人的注意力用在要紧处
事件和定时任务让智能体能在对话之外继续做事。它还要判断什么时候需要批准、提醒时该带上哪些上下文,以及什么时候安静更有用。
从已有信息、反馈和结果中建立记忆
历史邮件能提供语气和关系线索。用户怎样改草稿、哪些草稿被否决、发出后带来什么结果,都可以成为后来处理邮件的依据。
先把审核做顺,再逐步放开自主权
批量审核界面和用户熟悉的协作工具方便查看智能体的行动。伦克尔建议随信任逐步扩大自主权,同时保留对共享记忆和能力的角色权限控制。
记忆更新需要明确适用范围,也需要维护
伦克尔区分个人偏好和组织规则,并讨论如何用技能文件和过去的会话提供相关信息,让每轮执行只加载当前需要的内容。
完整摘要
悉尼·伦克尔介绍了由环境事件或定时任务触发的智能体。它们可以把长期目标拆成一件件具体工作。以邮件助手为例,历史邮件能提供初始线索,用户对草稿的修改和发出邮件后是否得到回应,又能帮助助手改进。伦克尔把回看执行记录、提炼可供下次使用的信息称为「做梦」。她也讨论了怎样在批量审核和紧急提醒之间取得平衡,以及个人偏好、组织规则和权限怎样影响智能体能记住什么、能做什么。
章节
文字稿
简要描述Brief Description
LangChain 的 Sydney Runkle 解释了主动式智能体如何朝着目标努力、何时应请求人类输入,以及反馈和结果如何影响它们记住的内容。她通过邮件分拣、幻灯片设计和共享的 Slack 讨论串,展示这些选择如何影响日常工作。Sydney Runkle of LangChain explains how proactive agents work toward goals, when they should ask for human input, and how feedback and outcomes can shape what they remember. She uses email triage, slide design, and shared Slack threads to show how those choices affect everyday work.
目录Table of Contents
- 简介Introduction
- 异步工作、目标与记忆Async work, goals and memory
- 事件与日程安排Events and schedules
- 人类注意力作为一种稀缺资源Human attention as a scarce resource
- 来自上下文、反馈和结果的记忆Memory from context, feedback and outcomes
- 做梦与个人偏好Dreaming and personal preferences
- 有益的行动与有益的沉默Useful actions and useful silence
- 为审查而构建的界面Interfaces built for review
- 目标约束与渐进式自主性Goal constraints and gradual autonomy
- 面向人类的编排与上下文Orchestration and context for humans
- 问答:记忆、技能与工具Q&A: memory, skills and tools
- 权限与组织记忆Permissions and organizational memory
- 内存更新与维护Memory updates and maintenance
- 显著性、过期与记忆表征Salience, expiry and memory representations
简介Introduction
Sydney Runkle:大家好。今天能来到这里我特别兴奋。就在几周前,主动式智能体工程还是我最喜欢的话题之一。好吧。首先,我想简单梳理一下 AI 和智能体发展过程中的一些重要里程碑。早在 2022 年,ChatGPT 横空出世,我们开始做各种事情——在 ChatGPT 窗口里复制、粘贴提示词和回答。但我觉得,真正让编程智能体大火起来,是在 2025 年 11 月左右。那其实是很近的事,对吧?从那时起,我们开始在日常生活中越来越多地使用智能体。之后不久,Claude Cowork 就推出了。最近,到了 2026 年 8 月和 9 月左右,我们见证了 Muse 这类个人智能体的出现。Sydney Runkle: Hey folks. super excited to be here today. proactive agent engineering is one of my favorite topics as of just a few weeks ago. all right. So first just want to walk through kind of a brief timeline of some major like AI and agent milestones. so early long ago in 2022 we had you know ChatGPT emerges and we all start doing things and you know copying and pasting prompts and answers into and out of the like ChatGPT window. but I think really it wasn't until like November of 2025 when coding agents really blew up. So that's like quite recent, right? when we all started using agents more and more in our day-to-day lives. Claude Cowork came out briefly after that or soon after that. and then most recently in like September and August of 2026 we saw the advent of personal agents like Muse.
异步工作、目标与记忆Async work, goals and memory
我认为,这些个人智能体最重要的标志性特征之一,就是它们非常主动。那么,与普通的终端,甚至云端编程智能体相比,它们有哪些新的基本能力呢?其中有几项也被较新的编程智能体架构采用了,但我认为它们对个人智能体的设计确实非常重要。首先,它们会做大量异步工作。这是什么意思?也就是说,你基本上可以和个人智能体持续对话,而且它似乎总能在恰当的时候掌握恰当的上下文,同时还在后台处理任务。早期的编程智能体架构就是这样:你给它一个目标或任务,然后通常得等它完成一轮模型工具调用循环,给出最终答案;之后你才能在此基础上继续迭代。And one of the I think biggest defining features of these personal agents is that they are highly proactive. and so what are kind of some primitives that they have that are new compared to just your standard like terminal or even cloud coding agent? a couple of these are shared with like newer coding agent architectures, but I think are like really quite important to the personal agent design. So the first is that they do a lot of async work. What does that mean? It means you can basically have this continuous conversation with your personal agent and it feels like it always has the right context at the right time and in the background is doing work. so this is from like early coding agent architectures where you would give it a goal or a task and then you would kind of have to wait for it to finish its like model one tool calling loop to come back to you with a final answer and then you could kind of iterate forward on that.
第二点是,这些个人智能体非常关注更广泛的目标。因此,你不只是给它一个简单任务,让它替你完成;还可以引导它在更长的时间跨度内为你工作。这与它们在后台异步工作的能力密切相关。第三,我们在 LangChain 一直讨论记忆这个话题已经很久了,但记忆对这些个人智能体来说确实非常重要。个人智能体为你做的事情,几乎都离不开你的个人偏好和生活背景等信息。所以我认为,个人智能体是我们第一次真正看到记忆成为这类智能体的关键组成部分——而我们每天都在使用这类智能体。你可能已经习惯了把记忆提炼成一项技能,供你的编程智能体使用;它能做到这一点确实很不错。The second is that these personal agents are very focused on kind of broader goals. so rather than just giving it a simple task and having it complete that for you, you can also orient them to kind of work for you over longer periods of time. and that connects very deeply with their capabilities for background and async work. The third we've been talking at LangChain about memory for a long time. but memory is like really important for these personal agents. There's basically nothing that a personal agent would do for you that isn't tied to your strong kind of preferences and life context etc. and so I think with personal agents is the first time we've really seen like memory be a critical part of these agents that we're using in our day-to-day lives. So you might be used to like you know distilling memory into a skill for your coding agent and like it's very nice that it does that.
不过,对于这些个人智能体来说,记忆似乎重要得多,对吧?比如,它可能需要记住你与它代表你沟通的人之间的关系,或类似的信息。第四点同样与异步范式有关:我们正在摆脱将会话视为智能体工作组织基本单元的观念,转而采用一种单线程体验,让你可以与智能体持续互动。所有这些基本要素都有助于支持主动型智能体。今天我会谈谈在智能体的语境下,“主动”究竟意味着什么;为什么人类的注意力对于主动性至关重要;记忆、用户体验,以及最后的——接下来是什么?but memory feels much more critical for these personal agents, right? Like you probably need it to remember your relationships to people that it's communicating with on your behalf or things of that nature. And then the fourth thing which again ties into the async paradigm is that we're moving away from this notion of like a session as the kind of unit of work of work organization for an agent and moving towards this like single thread experience where you can have this continuous interaction with an agent. And all of these primitives help support proactive agents. Today I'm going to talk about what proactive actually means in the context of agents. why human attention is really important in the context of proactivity. memory, user experience, and then finally like what's next?
我们对这些个人智能体有哪些期待?What are we excited about with these personal agents.
活动与日程表Events and schedules
好,关于从被动响应转向主动处理这种转变。被动响应是什么样的?我之前提到的智能体发展的前三个里程碑,基本上都是被动响应型智能体,对吧?你给智能体或模型一个提示,它就会针对这个提示作出回应,帮你完成一些工作。而主动处理意味着你的智能体会对环境中的事件作出响应。这可以有多种形式。比如现实世界中的事件:刚收到一封邮件,你的智能体就会被触发,判断它是不是垃圾邮件、是否需要回复,等等。第二类是更偏向定时安排的工作,可以由用户设定时间表。例如,每天早上 9 点给我发送一份会议摘要和相关信息;也可以由智能体自行设定时间表。如果你让智能体着眼于一个长期目标,它就可以为自己安排定期运行的任务,以处理最终有助于实现该目标的各项工作。Okay, so about the kind of shift from reactive to proactive. What does reactive look like? those first three kind of agent milestones that I talked about were mostly reactive agents, right? You give an agent or a model a prompt and it like responds to that prompt and helps you do some work. But proactive means your agent is responding to events in an environment. That can come in a variety of forms. So real world events like an email has just come in. Your agent is now like triggered to decide if it's like spam, deserves a response, etc. and then the second category is more scheduled work and that can either be schedule set by the user. For example, like every morning at 9:00 a.m. send me a digest of my meetings and relevant information or schedule set by the agent itself. So if you orient the agent to work on a longer term goal, it can set up schedules for itself to run periodic jobs and address tasks that ultimately contribute to that goal.
所以这也和我的理论不谋而合:我们正在从独立任务转向目标。转向主动型智能体,确实很适合构建以目标为导向的智能体。小规模来说,智能体处理的是独立任务。比如,给我的代码库添加这个功能,然后你知道的,给我提交一个 PR。规模更大时,它们处理的就是目标,并通过完成一些离散的任务来推动目标进展,而这些任务都有助于实现该目标。这和我们人类的做法很像,对吧?比如,你给自己定下一个远大的目标,然后列出一份待办清单,把要实现这个目标的里程碑和待办事项都写出来。所以我们正在经历这样一个转变,我觉得这很有意思。这是我唯一一张带动画的幻灯片。其他的都很无聊。所以以前的模式就是,你给智能体安排工作,对吧?So this kind of dovetails into my theory about the shift from independent tasks to goals. The shift to like proactive agents really lends itself to building agents that work more towards goals. So at a small scale, agents work on independent tasks. For example, like add this feature to my codebase and you know deliver me a PR. At a bigger scale, they work on goals and they make progress on goals by doing kind of discrete work on tasks that contribute to said goal. it it's a lot like how we work as humans, right? Like you set a lofty goal for yourself, you come up with a to do list of like milestones and to-dos to achieve that goal. So we have this shift that I think is really interesting. This is my only animated slide. Everything else is very boring. so previously it was like you give an agent work, right?
比如,你给智能体分配一项任务。而现在,你给智能体设定一个目标,理论上,当它需要澄清、支持,或者在处理复杂或敏感工作时需要最终的人类审批,它就应该给你安排一些事情,让你能在现实世界中采取行动。Like you give an agent some task. and now you give an agent a goal and then it theoretically should be giving you work to do to basically take action in the real world when it needs clarification or support or kind of final human approval on complex or sensitive work.
人类注意力是一种稀缺资源Human attention as a scarce resource
因此,在这种情况下,当智能体开始给你分派工作,而不是反过来由你给它分派工作时,你的注意力就成了一种稀缺资源。所以,智能体需要弄清楚,或者你需要帮助智能体弄清楚,它应该在什么时候、为什么、提供什么内容,以及如何通过提醒和上下文信息来告知你。这里的挑战在于,你真的要把握好分寸,让它的主动程度恰到好处。我希望我的个人智能体能让我及时了解重要任务,尤其是那些必须经过人工审批的事项;但同样重要的是,别给我发送一大堆无关紧要的提醒和通知,否则我基本上就会直接忽略它们。我目前正在尝试优化我的工作个人助理智能体。So in this case when the agent is now giving you work instead of vice versa, your attention becomes a scarce resource. So it's important for the agent to figure out or you to support your agent in figuring out when, why, what, and how it should provide you in terms of pings and context. and the challenge here is like you really want to thread the needle and get this like Goldilocks level of proactiveness. I want my personal agents to be keeping me in the loop for important tasks, definitely keeping me in the loop for things where human approval is critical, but also maybe more importantly not like sending me all this noise and unimportant pings and notifications or I basically will ignore those notifications. I'm currently trying to optimize this for my like work personal assistant agent.
我让它执行的几项主动任务实在太吵了,我甚至会把那些提醒全都忽略掉,所以要找到合适的平衡确实很有挑战性。要保护人类注意力这一稀缺资源,智能体相关的两方面都需要实现跨越式提升。第一是我在演讲开头提到过的记忆,第二是用户体验,也就是智能体如何向用户呈现这类任务和工作。先来谈谈记忆。这和你在人类学习语境下对记忆的理解非常相似。记忆就是随着时间推移所学到的信息。具体来说,在智能体的语境下,记忆指的是在多次调用或会话中学到的信息,它能帮助智能体从长远来看更好地完成任务或实现目标。There are a couple of like proactive tasks that I have it doing where it's way too noisy and I actually like completely ignore all of those pings and so finding the right balance is really challenging. so protecting the scarce resource that is human attention takes a step change in two things associated with agents. the first is memory as I already mentioned at the beginning of the talk and the second is user experience and how those kind of tasks and work are presented from an agent to a user. So I'll talk about memory first. this is very much what you might think it is in the context of human learning. so memory is information that's learned over time. specifically in the context of agents it's information learned across invocations or sessions that helps the agent do a better job with tasks or goals in the long run.
来自上下文、反馈和结果的记忆Memory from context, feedback and outcomes
那么,我们有哪些类型的记忆?又可以利用哪些信号来构建记忆?一个重要方面是利用已有的信息,也就是先例和上下文,来构建我所说的“记忆种子”。这在智能体初始化阶段非常重要,对吧?比如说,如果你给个人智能体发送第一条消息,你可能希望它能了解你、你的目标、你的生活等。因此,现有信息和这些先例都可以用来帮助构建你的记忆种子。另一个可用于构建记忆的信息或信号是人类反馈。下一张幻灯片中,我会给出一些更具体的例子。基本上,你在智能体运行过程中提供的任何反馈,都可以被利用并提炼出来,用于后续运行,这样你就有望减少需要提供的反馈。So what kind of types of memory do we have and what signal can we used to build up memory? one important piece is kind of using already available information, kind of precedent and context to build up what I like to call like a memory seed. that's very important in the kind of like agent initialization step, right? Like if you imagine you send your first message to a personal agent, you probably want it to kind of onboard itself onto you, your goals, your life, etc. and so existing information, this precedent can be used to help build your memory seed. The second piece of information or signal that can be used to develop memory is human feedback. I'll give some more robust examples of this on the next slide. But basically any feedback that you give your agent during live runs can be used and distilled for future runs so that hopefully you have to provide less feedback.
这在某种程度上更符合你已经想要的东西。然后我认为,第三个方向更新颖、更有创新性,而我们现在之所以能讨论它,也只是因为我们已经看到智能体在现实世界中执行任务了:这些智能体运行会产生什么结果?又该如何优化?基本上,智能体运行是否带来了成功的结果?是否导致了失败,或造成了不良的外部影响?我们又该如何从中学习?这比单纯讨论人在环路中的反馈更高了一个层次。我觉得,举些例子会很有助于说明这一点。我尽量把文字压到了最少。我保证,这是我内容最密集的一张幻灯片。我们就以一个帮你处理邮件的个人智能体为例。It's kind of more on track with what you already want. And then the third that I think is a little bit more novel and innovative than we really only get to talk about now because we're actually seeing agents do things in the real world is like what are the outcomes of these agent runs and how can they be optimized? So basically like is an agent run resulting in some successful outcome? Is it resulting in a failed outcome or a poor external event? And how can we learn from those? And so that's like even higher level thinking than just the kind of in the loop human feedback. So I think some examples are really helpful for contextualizing here. I've really tried to keep the text at a minimum. I promise this is my most dense slide. so let's use the context of a personal agent that's helping you with your email.
你过去的邮件里有很多先例和信号。那么你以前给哪些人发过邮件?发送邮件时,你会用哪些类型的语言表达模式?这些都可以用来构建一份记忆种子,帮助系统了解:悉尼喜欢怎么发邮件?她对谁比较正式?对谁不那么正式?哪些关系特别重要?悉尼过去完全忽略过哪些邮件?你知道,有哪些人给悉尼发过邮件,而她没有回复,后来还因为没有及时回复而惹上麻烦?现有系统里有海量数据。所以,你的智能代理可以据此了解你的写作方式、哪些人对你重要等等。其次,现在你已经准备好部署这个帮你管理邮件的个人智能代理了。至少一开始,你可能不希望它未经你批准就直接发出邮件。there's a lot of precedent and signal in your past emails. So who have you emailed in the past? What types of language patterns do you use when sending emails? that can all be used to kind of build this memory seed for like how does Sydney like to send emails? Who is she more formal with? Who is she less formal with? what relationships are particularly important? What emails has Sydney completely ignored in the past? You know, what people have sent Sydney emails that she didn't respond to and then got in trouble for like not responding soon enough? There's tons of data in this existing system. So your agent can learn, yeah, how you write, who matters to you, etc. secondarily, now you're ready to like deploy this personal agent that's helping you manage your email. You probably don't want it like sending off emails without your approval at least to start.
因此,我希望我的个人智能体能回复收到的任何新邮件。它会基于那些初始记忆数据,判断邮件是否值得回复,也会判断它看起来是不是垃圾邮件之类的。然后,如果邮件值得回复,它就会用我的口吻起草一封回复,再让我审核这份草稿。这样一来,我们就能在这个反馈循环中获得一些非常重要的人类反馈。比如,我对草稿做了大量修改,然后把它发出去。这些修改非常有价值,对吧?智能体可以保存这些信息,以便将来遇到类似情况时写出更好的草稿。再比如,我完全否决了这份草稿,这同样是有价值的信息。又或者,我连草稿都没发出去。这种缺少反馈的情况本身也是一种信号。so I would expect my personal agent responds to any new email that comes in. It categorizes whether or not it is worthy of a response on the back of that seed memory data and also, you know, like does this look like spam, etc. And then if it is worthy of a response, drafts a response in my voice and then has me approve that draft. So there's some pretty important human feedback we can get on this loop. So let's say I heavily edit the draft and then send it off. There's a ton of value in those edits that I provided, right? The agent can save that information to help write a better draft for a similar case in the future. let's say I like completely reject the draft. Also valuable information there. Let's say I don't even send the draft. The kind of lack of feedback there is also signal.
而所有这些都能帮助进一步提炼有关我个人表达风格的信息,比如哪些内容你不希望被发送出去,等等。最后,我也非常鼓励大家开始从智能体所带来的结果来思考,因为我认为,这最终才是我们希望它们帮助实现的目标。我的邮件收到回复了吗?这次回复是否带来了什么积极结果?我的邮件没有收到回复吗?为什么?因此,重要的是,智能体不能只知道最初收到的邮件草稿,还要了解自己采取行动后会产生什么后果。and all of this can help to, you know, further distill information about like my personal voice, what you don't want sent, etc. And then finally, and I would like really encourage folks to start thinking in terms of outcomes for agents because I think that's ultimately what we want them to help provide. did my email get a reply? Was there some like beneficial outcome of this response? Did my email not get a reply? Why is that? and so it's important for the agent not to only be aware of, you know, that initial email draft coming in, but also consequences of its actions in the first place.
梦境与个人偏好Dreaming and personal preferences
我想稍微聊聊“做梦”。这又是一个挺有意思的人类概念,对吧?做梦,或者说睡眠及其过程,是我们提炼信息、学习信息的方式。因此,我们把智能体的“做梦”称为随着时间推移从经验中学习的过程。智能体会生成轨迹,基本上就是它所走路径的记录。我们加入这个“做梦”过程,用来回顾人工反馈、结果等信息。你可以把这些信息提炼成记忆,然后智能体在下一次运行时就会用到这些记忆,希望下次能表现得更好。记住东西很容易,知道该记住什么却很难。举个挺个人的例子:我在 LangChain 使用一个设计智能体,帮我生成符合品牌风格的幻灯片。I'm going to talk a little bit about dreaming. Again, another like pretty human concept, right? Dreaming is how or you know, kind of sleep and that process is how we distil and learn information and so we call dreaming for agents the process of learning from experience over time. So your agent generates traces, basically a record or a trajectory of the path it takes. We add this dreaming process in that reviews, you know, human feedback, outcomes, etc. You can distil that information into memories and then said agent on the next run uses those memories and hopefully is better off the next time. remembering is pretty easy. knowing what to remember is really difficult. So I'll give a like pretty personal example. I use a design agent at LangChain to help me generate on-brand slides.
比如说,我做这份演示文稿时,用的就是一个非常、你知道的,空白朴素的 Google Slides 模板。然后我把它交给我们的 Content Studio——这是这个智能体的名字——让它帮我把演示文稿做得更好看一些,用上 LangChain 的蓝色,还用上别人告诉我应该使用的字体。不过我也有自己的偏好。比如你会注意到,所有内容都是小写的。这可不是我们的品牌规范。我每晚都会运行一个“dreaming”任务,它会查看我和这个 Content Studio 智能体的所有对话,并提炼出一份记录 Sydney 个人偏好的记忆文件。幸运的是,我甚至不用特意让它帮我把内容改成小写;但如果团队里的其他人使用它,它就不会自动这么做。所以,这算是一个例子,说明我的个人偏好是如何融入智能体基础设施中的。For example, like I wrote this presentation in like very, you know, blank plain Google Slides template and then I gave it to our content studio is the name of the agent to help me give it this like nice LangChain blue and like use the font that I've been told that we're supposed to use. but I also have like personal preferences. For example, you'll notice like everything is lowercase. That's not like our brand standard. and so I have a dreaming job every night that looks over all of my conversations with this content studio agent and like distils Sydney's personal preferences memory file. So luckily I didn't even have to ask it to do the lowercase for me, but if someone else on our team used it, it wouldn't do that automatically. So that's kind of an example of like how my personal preferences get baked into the agent infrastructure.
有益的行动与有益的沉默Useful actions and useful silence
我觉得这是一个特别有帮助的模型。再说一次,如何在人类注意力和主动性之间取得平衡确实很难。你希望智能体在确实需要你参与时通知你,这大概就是这里左上角的类别。你肯定不希望它在某件事不值得占用你时间时还把你拉进来。比如,替你起草一封回复新闻简报或垃圾邮件的邮件。最可能造成严重后果的情况是错失机会,也就是智能体没能正确识别信号。我们的目标是让你拥有足够强大的记忆系统,从而能够很好地识别信号。而有用的沉默也很有价值,对吧?比如,对于某件事来说,智能体不通知你往往才是最好的情况。我之前提到过这一点。I think this is a super helpful model. again, the like human attention and proactiveness is a tough balance to strike. You would like your agent to notify you when it's relevant for you to be in the loop. And that's kind of this top left category here. you definitely don't want it to loop you in when something is not worth your time. An example here is like drafting a reply to a newsletter or to some spam email. the most potentially consequential one is like missed opportunities where your agent doesn't perceive signal correctly. The goal is that you would have a robust enough memory system that it could perceive signal well. and then useful silence is also valuable, right? like your agent not notifying you is often like the best case to some event. I mentioned this earlier.
沉默实际上是非常强的信号。如果我没有回应,而且没有任何后果,那我们或许应该继续保持这种状态,并将其纳入记忆系统。Silence is really high signal. If I don’t respond and there’s no consequence, we should probably keep it that way and build that into the memory system.
为评审而构建的界面Interfaces built for review
接下来是用户体验。那么,你的智能体如何联系到你?它如何呈现信息?你该如何充分利用我们都只有那么一点点的注意力?首先,要打造以审核为核心的智能体界面。以电子邮件场景为例,可以设计一个不错的界面,让你能批量审核这些草稿。如果每来一封新的邮件草稿,Slack 里就收到一条通知,而我又没有方便的方式来编辑草稿,那会让我觉得很烦。这就是我们使用的个人智能体及其收件箱的一个例子。第二点可能也是最重要的一点:智能体应该出现在你本来就会工作的地方。非得专门去找你的智能体,实在太不方便了。Next up is UX. So how does your agent reach you? How does it present information? How do you preserve the you know minimal attention span that we all have and make the most of that? The first thing is building agent interfaces that are kind of review focused. So an example with the email use case is like having a nice UI where you can review these drafts in bulk. It would be quite annoying to me if like every new email draft came in Slack and I didn't have like a nice way to edit the drafts, etc. so this is an example of like the personal agent we use and the inbox for that. The second thing and maybe this is the most important is agents are located like where you already do work. it's not convenient at all to like basically have to go look for your agent.
你只是希望它正好出现在你想要的位置。所以,就我做的大部分工作而言,尤其是电子邮件这个场景,我发现单独设置一个专为审核优化的收件箱会很有帮助。另一个例子是,我已经在 Slack 上开展工作,并让智能体在那里采取行动:我 90% 的编码工作都是通过 Slack 完成的。这些智能体也会在事情准备好时通过 Slack 提醒我审核,或者跟进合适的审核者,因为你通常就是在 Slack 上请同事审核内容的。我还提到过,这是一项对个人智能体相当重要的基础能力;不过,我认为默认采用异步交互的用户体验也很有价值,这样你会觉得自己始终能和智能体保持持续互动。与此同时,当确实有事需要你关注时,你也希望智能体能紧急打断你;否则,它可以把事项排队,留待你审核。You just want to like have it be exactly where you want it to be. so for most of the work that I do that is in Slack for the email use case specifically, I do find having like a separate inbox optimized for review as helpful. Another example of like where I already do work and agents taking action there is like I do 90% of my coding through Slack. and then said agents will also like ping me for review in Slack when things are ready or like follow-up with appropriate reviewers because that's where you like ask your coworkers to review things. And then I mentioned this as a primitive that's pretty important for personal agents but I think having the UX be async by default so that you feel like you always get that kind of continuous interaction experience with your agent is valuable and then you want the agent to be able to like interrupt you with urgency when something really needs your attention or kind of queue up things for your review otherwise.
目标约束与渐进式自主性Goal constraints and gradual autonomy
一个有挑战的地方是,如果你让这些智能体去执行某些目标,它们往往会过度优化你设定的特定目标。我会说,这就是我们今天聚在这里讨论的智能体循环的致命弱点:如果你构建一个系统,让它不断循环并优化某个目标,那么即使存在特定领域的要求,或者近乎常识的要求,它也会把这个目标做得非常好。所以这里的一项挑战是对齐。如果你给智能体设定了优化 X 的目标,你可能就需要相当明确地说明,同时还要考虑 Y,也就是特定领域的规则、法规、背景等。我一直在琢磨的一个想法是逐步开放自主权。我们已经看到,渐进式披露是一种对智能体非常有益的设计策略。One challenging thing is that if you set these agents off to work on goals they will tend to like really over optimize for the specific goal that you provided. That's I would say like the Achilles heel of the agent loop that we are all here because of today is that like if you build a system to loop and optimize a goal it'll do a really good job of doing that despite like domain specific or like almost common sense requirements. so one challenge here is like alignment. If you give your agent the goal to optimize X you probably need to like do a pretty good job of clarifying like given Y and that's your like domain specific rules, regulations, context, etc. One idea that I've been toying around with is this idea of like progressive disclosure of autonomy. So like we've already seen that progressive disclosure is a really beneficial design tactic for agents.
它们的上下文窗口有限。你希望根据具体任务的相关性,逐步披露信息。我想,你也希望基本上能逐渐让智能体不再事事都需要你介入。所以理想情况下,我希望我的智能体能够自行发送邮件,而不必每封都经过我的正式批准;或者确保编码任务只需要我最后盖章批准一下。要做到这一点,确实只有建立健全的记忆系统才行,这样智能体不仅能了解你的偏好,还能随着时间推移逐渐赢得你的信任。Their context windows are limited. You want to progressively disclose information as is relevant to any given task. I think you also want to be able to basically wean your agents off of the need to have you in the loop for things. So ideally like I would like my agents to be able to send emails without my you know official stamp on all of them or you know make sure that something only needs like a final stamp of approval on a coding task and that's really only possible with like robust memory system where agents can learn not only your preferences, but also kind of gain your trust over time.
面向人类的编排与上下文Orchestration and context for humans
那么接下来是什么?我可能会后悔在这里说,我们基本上已经把 harness 的问题解决了。要为任何给定的智能体设计一个有效的 harness,仍然非常困难。不过我确实觉得,关注重点正在从 harness 设计更多地转向智能体编排。你可以说这两者是相关的。我觉得编排主要关注的是:你在哪里调用智能体?智能体之间如何通信?又该如何让它们在一段时间内协同完成更大的目标——这些目标在大约一年前,甚至更不用说两年前,都是我们无法想象的?这并不是说 harness 工程就不再是挑战了,只是眼下这些问题更像是尚未解决的难题。那么我说的上下文工程是什么意思?这就是我们过去三年来一直在谈的事情:针对任何给定的任务,在恰当的时机向模型提供恰当的上下文。So what's next? I maybe will regret having like the harnesses mostly solved up here. It's still like super hard to design an effective harness for any given agent. but I do think that the focus is moving more from like harness design to agent orchestration. you could argue that the two are related. I think orchestration mostly focuses on like where do you access your agents? How do your agents communicate with each other? and how do you get them to work on bigger goals over kind of time horizons that we couldn't have imagined like a year or certainly not two years ago. this is not to say that like harness engineering is not still a challenge, but these are more of the kind of unsolved problems right now. so what do I mean by context engineering? This is like the thing we've been talking about for three years, which is like get the right context at the right time to the model for any given task.
现在我们需要做的,可以说是把方向转过来,为人类做这件事。也就是说,让人类参与其中,在恰当的时机,为任务提供合适的上下文,服务于人类的目标。这基本上就是这场演讲所阐述的“注意力工程”论点。嗯,我对主动式智能体非常期待,也很乐意探讨它们带来的挑战,比如如何平衡主动性、注意力和记忆。欢迎大家提问。now we're kind of needing to like flip and do this for humans. So get your like human in the loop, the right context at the right time for the task in service of the human's goal. and so this is all about the basically like attention engineering thesis of this talk. And yeah. so very excited about proactive agents and the challenges that poses in terms of like balancing proactivity and attention and memory and happy to take some questions.
问答:记忆、技能与工具Q&A: memory, skills and tools
观众:那么,在构建 harness 时,你提到了当记忆与你个人相关时,它的强大之处;但你也提到了你们在 LangChain 内部为设计构建的那种 harness。我想这就是……好了。你在工作中发现了什么实用的经验法则,可以用来决定如何把知识分配到记忆、技能,以及使用它们时的工具调用中?比如用你举的电子邮件例子来说,我们可以有一段关于如何写邮件的记忆;也可以把关于如何写邮件的内容放在某个技能里,但最终的事实来源还是已发送的邮件,也就是一次工具调用。那么,你发现了什么实用的经验法则,可以帮助判断某项内容应该归入这三类中的哪一类,还是应该归入其他类别?Audience member: So when building a harness, you mentioned the power of using memory when it's specific to you, but also you're talking about the kind of harness you've built for design within LangChain. I think this is There we go. what is a useful heuristic you've found within your work for divvying up knowledge between memory, skills, and then tool calls as you use them. So like using your email example, we could have a memory about how to write emails. You could have a skill where it lives in one place about how to write emails, but also the source of truth is ultimately like email sent, which would be a tool call. So what is one of the useful heuristics you've found for deciding whether it should fit in one of those three or another category?
Sydney Runkle:是的,这是个好问题。我觉得关于记忆,有一点我刚才没有提到:我会把记忆分成三种类型。我想谨慎一点,不要过度依赖我们对人类记忆的理解,但我确实觉得,这是一种很有帮助的思路,可以用来考虑应该向智能体提供哪些类型的信息。三种类型分别是程序性记忆,也就是“这是完成某项特定任务的方法”;语义记忆,更多是信息、事实和知识;第三种是情景记忆,也就是记住之前的互动。我通常会把程序性记忆归为技能。我认为技能很大程度上是以工作流程为导向的内容,比如“这是处理某个具体请求的方法”。Sydney Runkle: Yeah, great question. So I think one thing I didn't talk about here with regards to memory is like the three types of memory that I think about. I want to be careful not to like over index too much on how we think about human memory, but I do think it's a helpful way to basically think about like what types of information should I present to my agents. So the three types are like procedural, which is like here is how you do this certain task. semantic is more like information and facts and knowledge. And then the third is like episodic. So like remembering previous interactions. and I generally like to bucket like procedural memory into skills. I think of skills is very much like workflow oriented things. Like here's how you, you know, go about addressing this specific request.
几乎是在引导智能体沿着某条特定路线行动。我觉得,语义记忆更像是把信息存储在文件里,作为一个基础的起点。而情景记忆,我觉得基本上就是搜索之前的对话线程和会话,找出相关信息。我觉得,确实有一个很难划分的界限:什么属于组织记忆,什么属于个人记忆。我们内部其实经常争论这个问题,因为有些事情我应该使用 LangChain 蓝色,即使我更喜欢旧的 LangChain 绿色,我的选择也会被覆盖,你懂吧。不过,我也可以加入一点个人风格。我觉得这算是一个持续存在的挑战;但比如在 LangChain,组织记忆总是会覆盖个人记忆。almost guiding the agent on a certain track. semantic memory I think about more as just like storing information in files as like a basic starting point. And then episodic I think of like basically searching over previous threads and sessions for relevant information. I think yeah, definitely a hard split is like what is organizational memory versus what is personal memory. We're actually having this debate internally a lot because like there are some things that like I should use the LangChain blue, like even if I like old LangChain green, like I'm being overridden, you know. but also like I am allowed to add in a little bit of like personal flare. and so I that I think that's kind of like an ongoing challenge, but we do have like org memory always override personal memory for like agents at LangChain, for example.
权限与组织记忆Permissions and organizational memory
观众:追问一个问题。你们如何管理组织记忆的权限?Audience member: One follow-up. How do you manage permissions for organizational memory?
Sydney Runkle:我们做了很多基于角色的权限管理。比如说,销售代表使用 GTM 智能体的权限,和部署工程师的权限就不同。所以,这基本上就是一些相对枯燥的东西,比如 ABAC、RBAC 等等。但我们会根据你的角色,动态组装上下文,只包含相关技能;相关记忆或指南也是如此。对,我们也会提供一些构建模块和专业见解,介绍如何为你的智能体实现这些功能。最后还想补充一点:我们在多人协作场景下的权限管理方面遇到了一些挑战。正如我之前提到的,我们的智能体都在 Slack 里。Sydney Runkle: We do a lot of like role based permissioning. So like you know, a sales rep has different permissions for using the GTM agent than like a deployed engineer for example. And so it's really just like the you know boring pieces of like ABAC, RBAC etc. But we basically assemble this like just in time context where like relevant skills are only included based on your role, relevant memory or guidelines, same thing. Yeah and we try to like offer kind of building blocks and thought leadership on like how to do that for your agent as well. And one last note that I'll have there is we are having challenges with the permissioning in like multiplayer scenarios. So like I mentioned the agents that we have are in Slack.
所以这有点难,比如我在一个线程里,记忆和上下文都已经加载好了,然后你加入这个线程——那我们该用什么样的游戏?要在里面包含哪些上下文?我觉得这还没有解决,不过正在推进。对。So it's a little bit hard like if I'm in a thread and my memory and context is loaded and then you jump in the thread like what's the right kind of game like what context do we include there? Unsolved but work in progress I would say. Yeah.
观众:在 LangChain,如果有人向组织技能或组织记忆推送更新或更改,谁来决定是否批准?大家会花多少时间讨论这个更新或更改是否获批,并向整个组织开放?这类讨论是怎么进行的?会不会花很多时间?我想你们应该经常向这些内容推送大量更新。Audience member: At LangChain when an update gets pushed or a change gets pushed to an organizational skill or even organizational memory who gets to decide or how much time is spent debating whether that update or change is approved and then accessible across the entire organization? How do those conversations go and do they take a lot of time? I'd assume you all are pushing a lot of updates to these things on a regular basis.
Sydney Runkle:是的,这是个很好的问题。我觉得可能最相关的 agent 是我们的 go-to-market agent,现在组织里有数百人在使用它,而且我们在开发方面确实会尽量快速迭代。个人记忆的管控宽松得多。比如,我们允许 agent 添加个人记忆更新,比如记住 Sydney 喜欢用小写字母,完全不设防护措施。但目前,组织记忆会经过我们的 GTM 工程团队。这个团队由开发人员组成,他们会与相关的 GTM 团队密切合作。比如,营销团队对与营销相关的技能有很大的发言权;设计团队也会对内容工作室的技能有很多发言权。所以,我们仍会通过 PR 审核相当谨慎地把关,同时也会与这些团队合作。Sydney Runkle: Yeah that's a great question. So I think probably the most relevant agent for this is our like go-to-market agent which is used by hundreds of people across the org now and we do try to like rapidly iterate on development wise. Personal memory is much less locked down. Like we allow the agent to add personal memory updates. So like remember that Sydney likes lowercase letters for example with no guardrails. But for org memory that like goes through right now our like GTM engineering team. And so that is a team of developers that works very closely with basically the relevant GTM teams. So for example like our marketing team has like a huge say in the skills that are related to marketing or like design team, you know lots of say on the like content studio skills. So we do still gate it pretty like carefully on PR review accompanied by like working with those teams.
是的,我觉得技能是对非常特定领域的知识进行抽象的一种很棒的方式。是的。and yeah, I think skills are like a great abstraction for like very domain specific knowledge. yeah.
内存更新与维护Memory updates and maintenance
观众:谢谢,这场演讲非常有意思。我想知道你们是如何考虑应该多频繁地创建记忆的。因为如果你说每发生一件事,我就创建一份幻灯片——而且全部用小写字母,你懂的——如果你基于这些来创建记忆,就会过度强调、过度补偿,对吧?但如果你等太久才创建这些记忆,试图从全局角度看情况,那创建记忆的速度又不够快,也就无法随着偏好的形成及时做出反应。那么你们如何看待这种权衡?Audience member: Thanks. Super interesting talk. I'm curious about how you think about how often you should create memories because if you say on every event if I create one slideshow that's all lowercase you know, if you're creating memories based on that you will over index and over compensate, right? But if you I guess if you wait too long to create those memories and try to get a global view of the situation then you're not creating memories fast enough and reacting to preferences as they develop. So how do you think about that tradeoff?
Sydney Runkle:是的,这是个很棒的问题。我确实还在为自己的智能体构思流水线而苦恼。我觉得,这也是一种很好的方式,能让人切身体会到这种痛点:天哪,广大智能体开发者到底该如何管理这些更新?正如我之前提到的,我觉得记忆维护这部分特别难。总体来说,我倾向于把两者结合起来:一方面,比较频繁地扫描对话线程,查找相关信息并将其注入记忆,这很好;另一方面,也安排一些次级任务,负责更多记忆清理和管理工作,比如去重等,这也很好。我还想说,智能体用得越多,记忆就会越完善。没错。所以,使用得越多,基本上需要运行的记忆任务也就越多。Sydney Runkle: Yeah, it's a great question. I'm definitely still struggling with like dreaming pipelines for my personal agents and I think like that's a great way to kind of feel the pain of like oh man how are agent developers at large supposed to like manage these updates? As I mentioned earlier, I think the like memory maintenance part is super difficult. my general push would be like more having some balance of like pretty frequent updates to scan threads for relevant information and like inject those into memory is good and then also having secondary jobs that do more of the like memory cleanup and management, you know, for like deduplicating things etc. also good. I would also say just like the more an agent gets used the more that memory will start to be refined. yeah. And so yeah, more usage means like more memory jobs basically.
然后最后一个小轶事是,我的记忆梦境任务一开始简直太爱记东西了。它会记住我以前给过的每一条反馈,但这些反馈根本无法泛化到其他内容上,所以一开始挺麻烦的。对。and then last anecdotal thing is like my memory dreaming job was like way too memory happy at first. Like it was remembering like every single piece of feedback that I like ever gave that was not generalizable at all to like other content which was a pain at first. Yeah.
观众:有没有什么好用的工具,特别是在多人游戏环境中,用于内存管理的?Audience member: Is there a good tool that you would recommend for memory management like specially in a multiplayer setting?
Sydney Runkle:好问题。我觉得有两件事。一是你需要一个运行框架,能够根据用户权限、角色等信息,妥善组装我刚才提到的即时上下文。二是你还需要基础设施来为你搭建那种类似「dreaming」的流水线。我有偏见,毕竟 LangChain 有一个基于我们开源项目构建的智能体开发平台。所以我会建议从它开始。Sydney Runkle: Great question. I think there's two things. One is like you want a harness that does a good job of like assembling the just-in-time context that I mentioned based on like user permissions and role, etc. And then you also want like infrastructure to do that like dreaming pipeline for you. I'm biased. We have a like agent building platform at LangChain that's like fully built on our open source. So that's what I would recommend for starting.
显著性、到期时间与记忆表示形式Salience, expiry and memory representations
观众:有个关于记忆的进阶话题想快速问一下。我在想,也想听听你对此的看法:我们谈到记忆时,对吧?通常会涉及某种时间维度。比如,我昨天做的事可能比一个月前做的事重要得多,对吧?举个例子。关于记忆还有一点,就是我们往往会把记忆存成 token,比如词语。但有时候,偏好并不总是用 token 来表示效果最好,有时用数学形式表示反而更好。你有没有想过这一点?你们在这方面已经做出什么了吗?Audience member: Quick question about maybe more advanced topics on memory. Like I was thinking and I wanted to get your thoughts on this is like when we think about memories, right? Generally there's a certain aspect like temporal. Like things that I did yesterday probably matter a lot more than things I did a month ago, right? For example. The other thing about memory is we tend to store memory as like tokens, like words. but sometimes preference isn't always best represented as tokens. Sometimes it's better as math. Have you ever thought about that? Like have you built in that area yet?
Sydney Runkle:这是个很好的问题。我先回答第一部分,基本上就是记忆的时间衰减或显著性。也就是说,不只是时间衰减的问题,有些你表达过的偏好可能始终有效,而且非常重要;另一些偏好可能就没那么重要。我举个例子。假如有个智能体帮你点餐,你可能希望它记住你这周人在纽约,这样它就应该在纽约帮你点餐。但你对花生过敏这一点,它就应该始终牢记在心。我觉得这又回到了那个梦境流水线基础设施的问题。而且,就拿食物偏好这个例子来说,这确实是非常特定于领域的。Sydney Runkle: That’s a great question. So I'll answer the first part first, which is basically this like temporal decay or like salience of memories. Like how not only like temporal decay, but like there are certain preferences that you might express that are like always and will be super important and then others that like maybe it doesn't matter as much. I'll give an example. Like if you have an agent assisting you with your food orders, like you probably want it to remember that you're like in New York this week, so it should order things in New York. But also like you're allergic to peanuts, that should always be like top of mind for your agent. again, I think that just goes into the like dreaming pipeline infrastructure and again with this like you know food preferences case, like that's super domain specific.
所以,你的梦境处理流水线里应该有一些信息会像一个很大的红旗,比如过敏信息就在这个文件里。至于数学表示形式,我觉得这是个特别有意思的概念。我还没有深入探索太多。我的一般做法是先从简单的开始,然后逐步揭示复杂性,对吧?这是对我自己而言。而且我还是觉得,我们还没有真正掌握那些基于文件系统偏好的梦境处理流水线。不过,确实非常有意思。我觉得你甚至可以想想食品这个使用场景,比如某家餐厅的氛围是什么样的,以及根据我的其他偏好,我会不会喜欢它。这就不只是基于语言了。还有其他问题吗?嗯,我想最后总结一下:我对主动式智能体非常期待。So there should be like information in your dreaming pipeline that's like big red flag. Like allergies are in you know this file. in terms of like mathematical representations, I think that's a super interesting concept. I have not explored a ton with that. My general default is to like start simple and then like basically progressive disclosure of like complexity, right? For myself. And I still feel like we haven't mastered the like dreaming pipelines that are just the like file system based preferences. but yeah, super interesting. I think you could even like think about for the food use case, like what is the vibe of like a certain restaurant and like would I like it based on my other preferences? That's not like just linguistically based. Any other questions? yeah, I guess I'll just conclude with I'm like very excited about proactive agents.
我认为,智能体开发大体上正朝着这个方向发展。如果你有任何问题或想法,随时可以私信我。谢谢。I think this is generally the direction that agent building is going in. and my DMs are always open if you have questions or ideas. Thanks.