跳过正文

AI Agent

读完 Codex 源码后,我认为最值得企业 Agent 借鉴的是这 5 个设计

可以把 Codex 想成一支小型施工队:模型像会判断下一步的现场负责人,Agent Harness 则是围绕他的派工台、门禁、档案柜和进度看板。源码真正展示的,不只是“负责人会下命令”,而是整套系统如何让工作安全开工、暂停后接着做,并让用户始终知道事情进行到了哪里。 很多 Agent 教程只有这样一个循环: 1 2 3 4 5 6 while True: response = model(messages, tools) if response.tool_calls: messages += execute(response.tool_calls) else: return response.text 它没有错,只是省略了真正困难的部分:几张工单能否同时开工?测试十分钟不退出时由谁保管现场?每次查看进度是否都要打扰用户?一句“还在检查”会不会被误认为已经交付?用户不知道操作手册叫什么时,系统能否主动找到?用户明确说“不要停”后,任务怎样跨越多轮处理仍不丢失? 这次我没有再从界面现象反推实现,而是阅读了官方 openai/codex 仓库在 commit bb5054f 的 Rust 源码。下文的组件名、状态分支和数值都能在对应源码中找到;产品未来仍可能演进,但这些设计已经足够回答一个问题:企业 Agent Harness 应该替模型承担什么? 先看懂:Agent 的一轮 Turn 到底做了什么 # 把一次完整用餐看成一个 Thread:它是整件事情的总账。前菜、主菜和甜点可以是不同 Turn;每个 Turn 都是从“用户提出这一轮要求”到“这一轮结果真正交付”的完整周期。 一轮 Turn 像一次点单到上菜:中间可以反复派出多张工具工单,也可以完全不调用工具。 顺着图走,一轮通常包含六件事:

Five Codex Harness Designs Worth Copying After Reading the Source

Think of Codex as a small construction crew. The model is the site lead deciding what should happen next. The agent harness is everything around that lead: dispatch desk, access control, job records, and the progress board. The source is valuable not merely because the lead can issue commands, but because the surrounding system keeps work safe, recoverable, and understandable to the customer. Many agent tutorials reduce the loop to this:

How Agents Remember You: Human Memory Science and a Code Audit of Six Open-Source Systems

Almost every agent project now claims to provide “long-term memory.” For one project, that means embedding chat history. For another, it means maintaining a user profile. A third lets the model edit Markdown files. A fourth builds a bitemporal knowledge graph. All four use the word memory, but they are not the same system and should not be placed on one undifferentiated leaderboard. To decide whether a system genuinely remembers, I would rather ask three questions:

Agent 如何记住你:人脑记忆史与六大开源系统代码审计

几乎每个 Agent 项目都说自己有「长期记忆」。 有的意思是把聊天记录做 embedding,有的意思是维护一份用户画像,有的意思是让模型自己修改 Markdown,还有的已经做到了双时序知识图谱。它们都叫 memory,却不是同一种东西,也不该放在一张跑分榜上直接比较。 要判断一个系统是不是真的「会记」,我更愿意问三个问题: 一次经历之后,系统里的什么状态发生了变化? 这个状态存在哪里,谁能修改,什么时候失效? 下一次行动前,它如何被准确、合规地带回来? 这篇文章从这三个问题出发。前半段把人类记忆科学与 Agent 记忆技术放在同一条历史轴上;后半段直接读代码,对照 Mem0、Letta、Graphiti、LangMem、Cognee 与 MemoryOS 的宣传卖点、实际数据流、系统边界和对应的记忆范式。 先给结论: 今天主流的 Agent 并没有获得一种像人脑那样的统一「记忆器官」。工程上真正有效的是一条闭环:经历 → 写入门控 → 表征 → 存储 → 检索 → 上下文组装 → 行动反馈 → 巩固 / 修订 / 遗忘。不同开源项目,只是选择接管这条闭环的不同部分。 下面这张图不是某个产品的组件架构,而是全文共用的判断坐标系。它要回答的不是「数据放在哪」,而是「一次过去的经历如何真正影响下一次行动」。阅读时先沿中间的七步主环看信息如何从经历变成行动;再看左侧三种载体,区分当前任务、跨会话记忆与真实世界状态;右侧说明每一步完成的变换,底部则展示长期运行后必须发生的巩固、修订与遗忘。这样能避免把数据库、Context、缓存和真实状态都笼统地叫作“记忆”。

OpenClaw Memory in Practice: From 'Vector Search Is Down But Everything Still Works' to Zero-Cost NVIDIA Embeddings

OpenClaw’s vector retrieval silently failed — but BM25 text search kept the memory system running for two weeks unnoticed. Should you even bother fixing it? Here’s how I used NVIDIA’s free embedding API to complete the picture at zero cost.

Claude's Tool Calling Paradigm Shift: A Deep Dive into Programmatic Tool Calling and Dynamic Filtering

The important change is not “two more tool features.” It is the movement of multi-step orchestration into a code-execution environment, with only a compact result returning to model context. Background: The Cost Problem in Agent Tool Calling # In traditional agent tool-calling, every tool invocation requires a full cycle of “model inference → tool execution → result return → model re-inference.” This seemingly natural loop breaks down at scale in three ways:

Claude 工具调用范式转移:Programmatic Tool Calling 与 Dynamic Filter 深度解读

真正的变化不是“又多了两个工具功能”,而是 Agent 开始把多步工具编排移入代码执行环境,并只把压缩后的结果带回模型上下文。 背景:Agent 工具调用的成本困境 # 在传统 Agent 工具调用模型中,每调用一个工具都需要完成一次"模型推理 → 工具执行 → 结果返回 → 模型再推理"的完整回合。这个看似自然的循环,在工具调用变多时会暴露出三个致命问题: 上下文污染:每个工具的结果都被原封不动地注入上下文窗口。查 20 个员工的报销记录,2000+ 条费用明细全部进入 context,即使你只需要知道"哪 3 个人超预算了"。 推理开销:每个工具调用都需要一次完整的模型推理。5 个工具调用 = 5 次推理 pass,每次几百毫秒到几秒不等。 噪声导致准确率下降:当上下文窗口塞满了中间结果,模型不得不在大量噪声中寻找信号。Context Rot 研究 表明,LLM 在复杂任务上的性能会随上下文增长而下降 50-70%。 正如 Bruno 在 Claude Code Architecture Guide 中所指出的:“Outer Loop(模型外的一切:上下文管理、工具调用、验证、记忆巩固)开始比模型推理本身更决定系统质量。” Anthropic 在 2025 年 11 月到 2026 年 2 月间陆续推出的一系列工具使用增强功能,本质上都是为了解决 Outer Loop 的效率问题。其中 Programmatic Tool Calling (PTC) 和 Dynamic Filtering 是最具范式转移意义的两项。