ActiveGraph: 长期运行 Agent 的连续性架构层 ✍ Yohei🕐 2026-05-20📦 9.6 KB 🟢 已读 𝕏 文章列表 文章作者 Yohei 提出了 ActiveGraph 的概念,旨在解决长期运行 AI Agent 的状态连续性问题。作者回顾了 BabyAGI 的发展历程,指出当前 Agent 系统主要围绕“反应”构建,缺乏持续的状态管理。ActiveGraph 试图将任务、记忆、决策、证据等所有状态视为一个共享的演化图,从而实现 Agent 的持久化、自我修正和逻辑追溯,适用于需要严格推理过程的企业级场景。 Agent架构ActiveGraphBabyAGI状态管理连续性GraphRAGAI推理Yohei Nakajima # ActiveGraph: A Continuity Layer for Long-Running Agents **作者**: Yohei **日期**: 2026-05-19T21:20:32.000Z **来源**: [https://x.com/yoheinakajima/status/2056847496668959038](https://x.com/yoheinakajima/status/2056847496668959038) ---  I might be going crazy, but I think I designed a novel way to architect AI agents based on much older designs. This introduces the concept, code to come soon. In the previous article, I wrote about the broader statefulness problem in AI agents: traces, memory, graphs, event logs, workflows, and the feeling that everyone is rebuilding the same missing layer slightly differently. This article introduces ActiveGraph, a project that came out of this exploration. Looking back at the BabyAGI lineage, this project increasingly feels less like a separate framework and more like the next architectural step. BabyAGI started by turning model output into persistent tasks. The later versions kept pushing further toward persistent state: dependencies, memory, functions, tools, logs, replay, and continuity. In many ways, Active Graph feels like a kind of “BabyAGI 4” moment, even if the architecture now deserves its own name. In 2023, BabyAGI started with a simple idea: take the output of an LLM, turn it into a task, save that task, and loop. The core loop was extremely simple. The original version was about a hundred lines of Python. No real tools, no durable execution, no production memory, no careful error recovery. But it showed something important very early: when model output stops being disposable text and becomes structured state, the system starts behaving differently. The system suddenly had continuity. A normal LLM response disappears after generation. A task can persist. It can be reprioritized, extended, revisited, completed, ignored, or used as context for future work. That shift, from text to persistent state, was the real BabyAGI idea. Over the next few years, I kept running into the same pattern from different directions. Tasks became dependency graphs. Tools became plugins. Plugins became functions. Functions gained logs, versions, triggers, and dependency resolution. The graph experiments explored structured memory and relationships. Later versions added persistent tools, multi-channel I/O, async execution, retries, repair, context management, and budgets. The loop stayed relatively small. The infrastructure around the loop kept growing. Over time, the pattern became hard to ignore. The hard part of long-running agents may not be the loop itself. It may be the continuity layer around it. Most agent systems today are still organized around reactions. A prompt comes in. A model reasons. A tool is called. A message comes back. More advanced systems add planners, workflows, memory, multi-agent handoffs, evals, reflection, and real-time interfaces. These are all useful. But most systems still orbit the same center: the model call, the message, the next action. That works well for short tasks. It gets harder once the system needs to run for hours, days, or indefinitely. A long-running agent does not just need to answer well. It needs to maintain a coherent evolving picture of: - what it believes, - why it believes it, - what it is doing, - what changed, - what depends on what, - what evidence supports what, - what is stale, - what failed, - what was approved, - and what should happen next. In other words, it needs state. “State” is a technical word, but the human version is intuitive. Humans are not fundamentally reactive beings. A message does not produce a response in isolation. It perturbs an existing system of: - memory, - beliefs, - relationships, - goals, - habits, - obligations, - emotions, - and history. Reaction is one expression of state. It is not the whole system. This is why even very capable AI systems can still feel strangely discontinuous over time. They can react intelligently in the moment, summarize context, call tools, write code, draft memos, and hold conversations. But they often struggle to maintain a coherent evolving model of: - what is true, - what changed, - what matters, - and what should now happen because of it. Real-time models make this even more obvious. They make AI feel more present. They improve responsiveness, interruption, voice, video, and interaction. But presence is not continuity. A brilliant real-time model without persistent state is still mostly stream in, reaction out. Humans are not stream processors. We are persistent systems interacting through streams. Conversation modifies state. It does not define the being. This is the direction Active Graph came from. Not “agents as a graph.” Not graph memory. Not workflow DAGs. Not a claim that graphs solve AGI. More like: > what if long-running agents need a continuity layer built around evolving state itself? Across the graph experiments, memory systems, and later BabyAGI versions, I kept running into the same thing: once tasks, claims, evidence, memory, tools, decisions, and failures all need to coexist in the same system, the state starts naturally becoming graph-shaped. The graph becomes the place where: - tasks, - claims, - evidence, - documents, - memories, - decisions, - risks, - goals, - tools, - failures, - and relationships all coexist in one evolving system. Events record what changed. Behaviors react to those changes. Relations carry meaning: - this supports that, - this contradicts that, - this depends on that, - this was derived from that. Patches separate: > the system wants to change something from: > the change is now accepted. The trace explains how anything came to exist. That may sound like a lot, but the motivation is simple. Long-running agents keep reinventing the same surrounding pieces: - task managers, - memory stores, - context retrieval, - approval queues, - logs, - evals, - enrichment pipelines, - self-reflection loops. Active Graph asks whether those should be separate modules at all. Maybe they are all operations over shared evolving state. A task is state. A memory is state. A claim is state. A contradiction is state. A decision is state. A failed behavior is state. A proposed self-improvement is state. Once those live together, different things become natural. A claim without evidence can create a research task. Two contradictory claims can trigger review. A completed dependency can unblock work. A stale source can mark a memo stale. A risky memory update can stay proposed until approved. A repeated failure can suggest a change to the system’s own behavior. A run can pause, resume, fork, and explain itself. This is where the graph matters. A workflow graph usually models computation: planner → researcher → critic → writer. Active Graph models the world the computation acts on. The next step does not need to be hardcoded into a process diagram. It can emerge from what changed in the world. That is also why the event log matters. The graph represents what is. The events capture what happened. Together, they let the system reconstruct how its current reality came to exist. Not just: > what did the model say? But: - why does this claim exist? - what evidence supports it? - which behavior created it? - what changed afterward? - what depended on it? That trace is not a debugging artifact. It is the product. This feels especially relevant for: - diligence, - research, - legal, - compliance, - scientific work, - enterprise memory, - and other domains where the intermediate reasoning matters as much as the final output. The goal is not just to produce a memo. The goal is to preserve the evolving structure behind the memo: - claims, - evidence, - contradictions, - risks, - decisions, - and revisions. It also creates a more concrete path for self-improvement. A behavior runs. The trace records what happened. An evaluator scores the outcome. The system notices that something failed. It proposes a patch to a prompt, rule, policy, or behavior. A fork tests the change. A diff compares the result. A winning change can be promoted. That is not mystical reflection. It is self-modification with lineage. I do not want to overstate this. Active Graph is not an AGI system. It is not obvious that this architecture is “the” answer. The ingredients have a long history: - blackboard systems, - event sourcing, - rules engines, - actor systems, - reactive databases, - workflow engines, - knowledge graphs, - version control. The interesting question is whether this combination belongs in the agent runtime layer. My guess is yes. LLMs gave us powerful inference. Tool use gave models ways to act. Real-time models give them presence. Agent loops gave them persistence of execution. But persistent agency probably needs something else too: > continuity of state. BabyAGI made tasks persistent. Active Graph asks what happens when the whole operating reality of an agent becomes persistent state. Not as a feature inside the loop. As the substrate the loop runs on. LLMs reason. Agent loops act. Active Graph explores continuity. ## 相关链接 - [Yohei](https://x.com/yoheinakajima) - [@yoheinakajima](https://x.com/yoheinakajima) - [22K](https://x.com/yoheinakajima/status/2056847496668959038/analytics) - [article](https://x.com/yoheinakajima/status/2056598291316634079) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [5:20 AM · May 20, 2026](https://x.com/yoheinakajima/status/2056847496668959038) - [22.2K Views](https://x.com/yoheinakajima/status/2056847496668959038/analytics) - [View quotes](https://x.com/yoheinakajima/status/2056847496668959038/quotes) --- *导出时间: 2026/5/20 10:18:25* --- ## 中文翻译 # ActiveGraph:长期运行智能体的连续性层 **作者**: Yohei **日期**: 2026-05-19T21:20:32.000Z **来源**: [https://x.com/yoheinakajima/status/2056847496668959038](https://x.com/yoheinakajima/status/2056847496668959038) ---  我可能疯了,但我觉得基于一些更旧的设计,我构想出了一种新颖的 AI 智能体架构方式。本文介绍这一概念,代码即将发布。 在上一篇文章中,我写了关于 AI 智能体中更广泛的状态性问题:追踪、记忆、图、事件日志、工作流,以及那种大家都在以略微不同的方式重建同一个缺失层级的感觉。 这篇文章介绍了 ActiveGraph,这是一个源于该探索的项目。 回顾 BabyAGI 的谱系,这个项目越来越不像是一个独立的框架,而更像是架构演进的下一步。BabyAGI 最初是将模型输出转化为持久化的任务。后来的版本不断向持久化状态推进:依赖关系、记忆、函数、工具、日志、重放以及连续性。在许多方面,Active Graph 感觉像是一种“BabyAGI 4”时刻,即使现在的架构配得上拥有自己的名字。 2023 年,BabyAGI 始于一个简单的想法:获取大语言模型(LLM)的输出,将其转化为任务,保存该任务,然后循环。 核心循环非常简单。 最初的版本大约只有一百行 Python 代码。没有真正的工具,没有持久化执行,没有生产级记忆,也没有完善的错误恢复。但它很早就展示了一件重要的事情: 当模型输出不再是一次性文本,而是变成结构化状态时,系统的行为开始变得不同。 系统突然拥有了连续性。 普通的 LLM 响应在生成后就会消失。而任务可以持久存在。它可以被重新排序、扩展、重访、完成、忽略,或作为未来工作的上下文。 那种从文本到持久化状态的转变,才是 BabyAGI 的真正理念。 在接下来的几年里,我从不同方向反复遇到同样的模式。 任务变成了依赖图。 工具变成了插件。 插件变成了函数。 函数获得了日志、版本、触发器和依赖解析。 图的实验探索了结构化的记忆和关系。 后来的版本增加了持久化工具、多通道输入/输出、异步执行、重试、修复、上下文管理和预算。 循环保持相对较小。 循环周围的基础设施不断增长。 随着时间的推移,这种模式变得难以忽视。 长期运行的智能体,其难点可能不在于循环本身,而在于围绕它的连续性层。 如今大多数智能体系统仍然是围绕“反应”组织的。 一个提示词进来。 模型进行推理。 调用一个工具。 一条消息返回。 更先进的系统增加了规划器、工作流、记忆、多智能体交接、评估、反思和实时接口。这些都很有用。但大多数系统仍然围绕着同一个中心:模型调用、消息、下一个行动。 这对于短期任务很有效。 一旦系统需要运行数小时、数天甚至无限期,事情就变得困难了。 一个长期运行的智能体不仅需要很好地回答问题。它需要维护一个连贯的、不断演变的图景,包括: - 它相信什么, - 它为什么相信, - 它在做什么, - 什么改变了, - 什么依赖于什么, - 什么证据支持什么, - 什么已过时, - 什么失败了, - 什么被批准了, - 以及接下来应该发生什么。 换句话说,它需要状态。 “状态”是一个技术术语,但人类版本的概念很直观。 人类从根本上说不是反应性生物。 一条消息并不会孤立地产生回应。它扰动了现有的系统,该系统包含: - 记忆, - 信念, - 关系, - 目标, - 习惯, - 义务, - 情绪, - 和历史。 反应是状态的一种表达。它不是整个系统。 这就是为什么即使是非常强大的 AI 系统,随着时间的推移仍然会让人感到奇怪的断裂。 它们可以在当下做出智能的反应,总结上下文,调用工具,编写代码,起草备忘录并进行对话。但它们往往难以维护一个连贯的、不断演变的模型,包括: - 什么是真的, - 什么改变了, - 什么重要, - 以及因此接下来应该发生什么。 实时模型使这一点更加明显。 它们让 AI 感觉更具临场感。它们提高了响应速度、中断处理、语音、视频和交互能力。 但临场感不是连续性。 一个没有持久化状态的卓越实时模型,主要仍然是“流输入,反应输出”。 人类不是流处理器。 我们是通过流进行交互的持久系统。 对话修改状态。它并不定义存在本身。 这就是 Active Graph 的由来方向。 不是“作为图的智能体”。 不是图记忆。 不是工作流 DAG(有向无环图)。 也不是声称图能解决 AGI(通用人工智能)。 更像是: > 如果长期运行的智能体需要一个围绕不断演变的状态本身构建的连续性层,会怎样? 在图实验、记忆系统以及后来的 BabyAGI 版本中,我一直遇到同样的事情:一旦任务、主张、证据、记忆、工具、决策和失败都需要在同一个系统中共存,状态就会自然地呈现出图的形状。 图变成了一个场所,在这里: - 任务, - 主张, - 证据, - 文档, - 记忆, - 决策, - 风险, - 目标, - 工具, - 失败, - 和关系 都在一个不断演变的系统中共存。 事件记录发生了什么变化。 行为对这些变化做出反应。 关系承载意义: - 这个支持那个, - 这个反驳那个, - 这个依赖于那个, - 这个源于那个。 补丁将以下两者区分开来: > 系统想要改变某些东西 与: > 该改变现在被接受了。 追踪解释了任何事物是如何产生的。 这听起来可能很多,但动机很简单。 长期运行的智能体一直在重复发明同样的周边组件: - 任务管理器, - 记忆存储, - 上下文检索, - 审批队列, - 日志, - 评估, - 丰富管道, - 自我反思循环。 Active Graph 提出疑问:这些真的应该是独立的模块吗? 也许它们都是对共享的、不断演变的状态的操作。 任务是状态。 记忆是状态。 主张是状态。 矛盾是状态。 决策是状态。 失败的行为是状态。 提出的自我改进是状态。 一旦这些东西共存于一起,不同的事情就会变得自然而然。 没有证据的主张可以创建一个研究任务。 两个相互矛盾的主张可以触发审查。 完成的依赖项可以解除工作的阻塞。 过时的源可以将备忘录标记为过时。 有风险的记忆更新可以保持提议状态直到被批准。 重复的失败可以建议改变系统自身的行为。 一次运行可以暂停、恢复、分叉并解释自己。 这就是图的意义所在。 工作流图通常对计算进行建模: 规划器 → 研究员 → 评论家 → 写作者。 Active Graph 对计算所作用的世界进行建模。 下一步不需要硬编码到过程图中。它可以从世界的变化中涌现。 这也是事件日志重要的原因。 图代表“是什么”。 事件捕获“发生了什么”。 它们共同让系统能够重构其当前的现实是如何存在的。 不仅仅是: > 模型说了什么? 而是: - 为什么这个主张存在? - 什么证据支持它? - 哪个行为创建了它? - 之后发生了什么变化? - 什么依赖于它? 那个追踪不仅仅是一个调试产物。 它就是产品。 这对于以下领域感觉特别相关: - 尽职调查, - 研究, - 法律, - 合规, - 科学工作, - 企业记忆, - 以及其他中间推理过程与最终输出同样重要的领域。 目标不仅仅是生成一份备忘录。 目标是保留备忘录背后不断演变的结构: - 主张, - 证据, - 矛盾, - 风险, - 决策, - 和修订。 它还为自我改进创造了一条更具体的路径。 一个行为运行。 追踪记录发生了什么。 评估器对结果打分。 系统注意到某些东西失败了。 它提出一个针对提示词、规则、策略或行为的补丁。 一个分叉测试该变更。 一个差异比较结果。 获胜的变更可以被推广。 这不是神秘的反思。 这是带有谱系的自我修改。 我不想夸大其词。 ActiveGraph 不是 AGI 系统。这种架构是否是“那个”答案尚不明显。其组成部分有着悠久的历史: - 黑板系统, - 事件溯源, - 规则引擎, - Actor 系统, - 响应式数据库, - 工作流引擎, - 知识图谱, - 版本控制。 有趣的问题是,这种组合是否属于智能体运行时层。 我猜是的。 LLM 赋予了我们强大的推理能力。 工具使用赋予了模型行动的方式。 实时模型赋予了它们临场感。 智能体循环赋予了它们执行的持久性。 但持久化的智能体可能还需要另一件东西: > 状态的连续性。 BabyAGI 使任务持久化。 ActiveGraph 探索当智能体的整个运行现实都变成持久化状态时会发生什么。 不是作为循环内部的一个功能。 而是作为循环运行于其上的基底。 LLM 推理。 智能体循环行动。 ActiveGraph 探索连续性。 ## 相关链接 - [Yohei](https://x.com/yoheinakajima) - [@yoheinakajima](https://x.com/yoheinakajima) - [22K](https://x.com/yoheinakajima/status/2056847496668959038/analytics) - [article](https://x.com/yoheinakajima/status/2056598291316634079) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [5:20 AM · May 20, 2026](https://x.com/yoheinakajima/status/2056847496668959038) - [22.2K Views](https://x.com/yoheinakajima/status/2056847496668959038/analytics) - [View quotes](https://x.com/yoheinakajima/status/2056847496668959038/quotes) --- *导出时间: 2026/5/20 10:18:25*
R Run Your Harness Outside of the Sandbox (Why and How) 本文探讨了2026年以来关于Agent运行位置的争论,指出行业趋势是将Agent运行在沙箱之外。作者详细解释了沙箱内运行的三个主要问题:爆炸半径、信任边界和沙箱的间歇性运行,并提出了将沙箱作为工具暴露的正确架构,最后提供了基于Vercel AI SDK的实现示例和生产环境中的挑战。 技术 › Agent ✍ Nathan Flurry🕐 2026-07-28 Agent沙箱架构设计DevOps后端LLM安全性生产环境Vercel AI SDK状态管理
G Graph Engineering:从 0 到 1 小白完整教程 文章介绍了 Graph Engineering,一种通过流程图协调多个 AI 协作完成复杂任务的方法。它将复杂任务拆解为节点、边和状态,解决了单 Loop 应对复杂任务时的局限性。文章详细解析了 Graph 的核心概念、与 Loop 的关系、四个核心模块及具体实践模板,并提供了新手学习路径。 技术 › Agent ✍ Adrian Punk🕐 2026-07-27 Graph EngineeringAgentLLMAI 协作工作流Loop Engineering教程节点设计状态管理AI 架构
金 金融中的图工程:设计稳健的Agent图 本文探讨了金融领域中Agent图的设计与实现。文章指出,Agent图解决了脚本在等待、重启和并行分支上的缺陷,并通过状态图而非DAG来实现条件路由和循环。重点讨论了状态管理、并行拓扑模式(如Fan-out、Supervisor)以及在金融任务中的实际应用。 技术 › Agent ✍ zostaff🕐 2026-07-25 Agent图工程状态管理并行计算金融LangChain拓扑模式
如 如何在 AI 领域赢得最大市场 文章探讨了计算历史上的专业化趋势,指出 AI 推理需求正在爆发,通用 GPU 已无法满足其对内存和能效的特定要求。文中以 Google 的 TPU 为例,介绍了定制化硬件的兴起。重点分析了初创公司 Etched 如何押注专用推理芯片,通过低电压推理和集群级内存技术,试图解决算力与能耗问题,抢占这一巨大的市场份额。 技术 › 芯片 ✍ Sarah Wang🕐 2026-07-24 AI推理芯片专用硬件EtchedTPU能效比计算架构LLM
K Kimi K3 + 图工程:降低85%成本并提升18%准确率 文章介绍了通过结合 Kimi K3 模型与图工程构建 AI 系统的方法。相比传统 RAG,该架构利用知识图谱存储实体关系,能处理复杂推理,实现成本降低85%和准确率提升18%。文章引用微软 GraphRAG 等研究,详细阐述了如何从零开始构建该系统。 技术 › LLM ✍ Noisy🕐 2026-07-23 Kimi K3图工程GraphRAG知识图谱RAG架构设计LLM成本优化
M Meet Pocket: Persistent, infinite context for coding agents Pocket 是一个为编程代理提供无限上下文的持久化工具,允许代理存储和检索整个代码库及相关上下文,从而更高效地处理大型项目。该工具基于 Polygres 架构,目前免费提供,并赠送 50 美元积分。 技术 › Agent ✍ dale🕐 2026-07-23 Pocket代码代理无限上下文PolygresgraphRAG代码库持久化免费工具
G Graph Engineering 101: When a Loop Isn’t Enough 文章探讨了AI Agent从简单的ReAct循环向图工程架构的演进。循环模式在处理复杂、多步骤及需人工介入的任务时存在状态持久化、错误处理和分支逻辑的局限性。图工程通过显式的节点、边和状态管理,解决了并发、暂停恢复及复杂流程控制问题,为构建更健壮的Agent系统提供了架构基础。 技术 › Agent ✍ Alex Prompter🕐 2026-07-22 AgentGraph EngineeringReActLangGraph架构设计状态管理LLM
图 图工程究竟是什么? 文章探讨了AI工程领域的新术语“图工程”。它并非新发明,而是对多Agent协作系统的宏观视角,通过节点和边映射工作流、状态和依赖关系,解决复杂系统的架构与调试问题。 技术 › Agent ✍ Towards AI🕐 2026-07-20 Graph EngineeringAgentWorkflowAI架构Claude动态工作流状态管理
图 图工程如何取代RAG:微软、斯坦福和Anthropic的实践 文章介绍了图工程相比传统RAG在复杂问题回答上的优势,通过微软GraphRAG、斯坦福DSPy及Anthropic Claude的案例,展示了图结构如何提升AI准确性和降低成本。核心观点是图工程能捕捉实体间关系,而非仅检索文本片段。 技术 › LLM ✍ Sprytix🕐 2026-07-20 图工程RAGGraphRAG知识图谱ClaudeStanford DSPyMicrosoftAnthropicKEPLER关系记忆
如 如何使用 Claude Code 创建循环工作流 本文提出了一种通过“循环”机制优化 Claude 工作流的方法,旨在解决传统一次性会话在重复性任务中效率低下的问题。作者定义了包含触发、上下文、行动、验证、状态更新和决策的六步循环结构,并详解了由 TASK.md、PROGRESS.md、LOOP_INSTRUCTIONS.md 和 outputs 组成的四文件系统,以实现状态持久化和流程自动化。 技术 › Claude Code ✍ Rahul🕐 2026-07-07 Claude Code工作流自动化Prompt工程状态管理效率提升
T Token省35%、工具调用暴降94%!本地知识图谱改变的5个编程习惯 作者分享了使用本地知识图谱重塑编程习惯的经历。文章详细对比了RAG和知识图谱的区别,介绍了Graph RAG的概念,并展示了如何利用开源工具CodeGraph将代码库转化为知识图谱。这一改变使Token消耗降低35%,工具调用减少94%,显著提升了开发效率。 技术 › DevOps ✍ 雪踏乌云🕐 2026-06-17 知识图谱RAGGraphRAGCodeGraphAI编程本地知识库开发效率Hermes Agent工具调用Token优化
长 长任务 Agent 的最小工程闭环 本文针对长任务 Agent 容易出现的“带不住状态、估不准工作量、评不好输出”三大问题,提出工程化的解决方案。文章通过引入状态层、规划层和验证层,构建了一个包含监督机制的五层架构,旨在通过外部控制和证据链,而非单纯的 Prompt 优化,来实现稳定、可落地的 Agent 系统。 技术 › Agent ✍ 烟花老师🕐 2026-05-26 Agent工程化Claude长任务状态管理验证层规划Harness系统架构