最新资讯
bloomberg.com 台积电据报考虑生产先进 AI 存储芯片 www.infoq.com Yelp 为 AI Assistant 融合原生与服务器驱动 UI computerworld.com 英国监管机构:企业须为自家 AI 代理的错误负责 siliconangle.com Atomicwork 推出面向企业 IT 与安全的认证 AI 同事市场 computerworld.com OpenAI 收购小型软件公司以改进 Codex bdtechtalks.com Next-Concept Modeling 如何重新思考 AI 文本生成 computerworld.com Box 发布 Architect:用自然语言构建业务流程工作流 techrepublic.com Perplexity 推出 Teammates:每月 200 美元的 AI Agent 如何工作 the-decoder.com METR 称 Anthropic 或已在 7 月越过自身 AI 加速预警阈值 towardsdatascience.com 用 Ollama 和 Python 构建你的第一个多工具 AI Agent the-decoder.com Thinking Machines 的 Inkling 2 Small 称霸西方开放权重模型 dev.to 为 CI/CD 构建 AI 质量门禁
多元动态
登录 注册
AI编码 www.aibase.com ·

智能体长任务为何“失忆跑题”:AWS、Claude Code、Manus 等用四套框架机制给出答案

原文 我的收藏

文章讨论大模型在长任务中反复“遗忘”初始目标的问题,认为根源可能不在模型本身,而在包裹模型的执行框架。AWS 自研云编程智能体设计指南指出,浅层智能体在长周期中会遭遇上下文溢出、分心和跑题,无法维持状态,修复层是管理“模型之外”一切的 harness。一篇综述梳理 LangChain Deep Agents、Claude Code、Manus、OpenAI Codex 和 Amazon Bedrock AgentCore 等主流框架,称它们通过上下文预算、压缩、待办状态和跨会话记忆四类“引擎”把浅层循环变为可处理长任务的深度智能体。文章还提到单纯扩大上下文窗口并不能解决问题:Chroma 的 Context Rot 报告评测 18 个大模型后发现输入越长模型越不可靠;Anthropic 解释注意力机制对 n 个 token 产生 n² 对关系,每个额外 token 都消耗有限的“注意力预算”;Manus 称典型任务约调用工具 50 次,输入输出比接近 100:1。第一类引擎是上下文预算与卸载,Deep Agents 硬编码规则为工具返回超过 20000 token 就写入文件系统、只保留路径和前 10 行预览,会话上下文超过窗口 85% 时把旧编辑调用截断为指针;Claude Code 在加载前自动把记忆限制在 200 行或 25KB,MCP 工具模式默认只列名称、按需拉取;AWS AgentCore 演示中协调器并行启动三个浏览器子智能体,各自运行在独立 MicroVM 中,分析子智能体只接收结构化结果,预计耗时 4 到 6 分钟,串行执行可能慢至三倍。第二类引擎是压缩,当卸载不足时框架会在接近上限时总结对话并重启,Claude Code 的压缩提示保留架构决策和未解决 bug、丢弃冗余输出,压缩后重新读取最近最多五个修改过的文件并重新注入技能文本。

AI推荐理由 文章围绕长任务智能体“失忆跑题”问题,梳理 AWS、Claude Code、Manus、LangChain Deep Agents、OpenAI Codex、Amazon Bedrock AgentCore 等框架在上下文预算、压缩、待办状态和跨会话记忆四类机制上的做法,并引用 Chroma Context Rot 对 18 个模型的评测和 Anthropic 关于注意力预算的解释,信息密度较高。但正文为二手综述,未给出原始研究链接或可验证数据,部分具体数字(如 20000 token、85%、200 行/25KB)无法在片段中核实,且正文在压缩机制处被截断,因此质量分不宜过高。

72

正文

Why do agents forget and go off-track when running long tasks: AWS, Claude Code, Manus provide answers with four frameworks AIbase基地 Published inAI News · 8 min read · Sep 14, 2026 8 Large models repeatedly "forget" during long tasks, losing track of their initial goals, a longstanding issue in the intelligent agent industry. The root cause may not lie in the model itself, but in the "execution framework" that wraps it. A AWS self-developed cloud programming intelligent agent design guide points out the problem clearly: shallow agents encounter context overflow, get distracted and go off-topic during long cycles, and cannot maintain state. Fixing this layer is the harness, which manages everything "outside the model." A new study reviewing multiple mainstream frameworks has lifted the veil on this layer. LangChain Deep Agents, Claude Code, Manus, OpenAI Codex, and Amazon Bedrock AgentCore each use four "engines"—context budget, compression, to-do state, and cross-session memory—to transform shallow loops into deep agents capable of handling long tasks. The most counterintuitive point is that simply increasing the context window doesn't solve the problem. Chroma's Context Rot report evaluated 18 large models and found that even in simple retrieval tasks, the longer the input, the less reliable the model becomes. Anthropic explains that attention mechanisms generate n² pairwise relationships for n tokens, and each additional token consumes a limited "attention budget." Context is a diminishing resource, not a bucket. Manus also revealed that a typical task involves calling tools about 50 times, with an input-output ratio close to 100:1. The initial instruction gradually drifts toward the middle of the window—precisely the location where memory degradation occurs. The first engine is context budget and offloading. Deep Agents come with two hard-coded rules: if the tool returns more than 20,000 tokens, it is written to the file system, with only the path and the first 10 lines of preview retained; when the session context exceeds 85% of the window, old edit calls are truncated into pointers. Claude Code applies the same logic before loading, automatically limiting memory to 200 lines or 25KB, with the MCP tool mode defaulting to listing names and pulling them as needed. AWS AgentCore's demonstration is even more thorough: the coordinator spawns three browser sub-agents in parallel, each operating in its own MicroVM. The analysis sub-agent only receives structured results, with an expected duration of 4 to 6 minutes, while serial execution can be up to three times slower. The second engine is compression. When offloading isn't sufficient, the framework summarizes the conversation near the limit and restarts it. Claude Code's compression prompt retains architectural decisions and unresolved bugs, discards redundant outputs, and after compression, re-reads the last up to five modified files and re-injects the skill text. It also writes the complete original record to disk, allowing facts lost in the summary to be retrieved later. Deep Agents takes "preserving the goal" as a structural feature, with the summary document specifically dividing sessions into intent, generated products, and next steps. Compression has been pushed down to the API level: OpenAI Responses API provides server-side compression via `compact_threshold`, and Codex relies on it to handle long programming tasks. The Claude platform also offers customizable compression editing options with writeable instructions. The third engine is to-do state and "chanting." Manus' approach is simple—create a `todo.md` and step-by-step check off items, effectively embedding the goal at the end of the context, pushing back against "being submerged in the middle." However, this is not always effective: Deep Agents changed its to-do middleware to optional in version 0.7 released in July 2026, as evaluation showed that turning it off slightly increased rewards and reduced costs. LangChain still recommends re-enabling it for long tasks, weak models, and interfaces needing progress display. The fourth engine is cross-session memory. Claude Code re-loads CLAUDE.md and automatic memory after each compression. AgentCore Memory runs extraction strategies in the background, allowing the coordinator to recall them directly instead of re-analyzing. However, research from ETH Zurich casts cold water: context files like AGENTS.md typically do not improve success rates, yet increase reasoning costs by 20% to 23%, with each reload being a fixed tax on the attention budget. Therefore, Claude Code recommends keeping CLAUDE.md under 200 lines. The study finally reminds us that whether a framework truly "grasps the goal" must be verified through forced compression tests—the most dangerous failure is when an agent immediately asks for clarification after a summary or incorrectly declares a task completed. In other words, keeping an agent from getting lost on a long journey isn't about how big the model is, but how finely tuned these engines are. LargeModelExecutionFrameworkContextAgent This article is from AIbase Daily Scan to view Welcome to the [AI Daily] column! This is your daily guide to exploring the world of artificial intelligence. Every day, we present you with hot topics in the AI field, focusing on developers, helping you understand technical trends, and learning about innovative AI product applications. —— Created by the AIbase Daily Team © Copyright AIbase Base 2024, Click to View Source -

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容