用分层树结构记忆任务状态,让大模型更稳地完成多步骤任务。
Task Memory Engine (TME): Enhancing State Awareness for Multi-Step LLM Agent Tasks
- 构建任务树追踪每步输入输出与关系,实现结构化记忆
- 动态生成提示,任务完成率显著提升,错误率降低37%
- 适合需要长期规划的智能体开发,轻量易集成
大型语言模型正被用于执行多步骤任务,但现有框架往往缺乏对任务状态的结构化理解,依赖线性提示拼接或浅层记忆缓冲,导致性能脆弱、频繁幻觉且长程连贯性差。本文提出任务记忆引擎(TME),一种轻量级结构化记忆模块,通过分层任务记忆树(TMT)追踪任务执行过程。树中每个节点对应一个任务步骤,存储相关输入、输出、状态及子任务关系。引入提示合成方法,根据当前激活节点路径动态生成提示,显著提升执行一致性与上下文锚定能力。在多步骤智能体任务的案例研究与对比实验中,TME展现出更高的任务完成准确率和更可解释的行为,且实现开销极小。核心组件参考实现已开源,支持可复用子步骤、任务路径汇聚与共享依赖,为未来基于有向无环图(DAG)的记忆架构奠定基础。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are increasingly used as autonomous agents for multi-step tasks. However, most existing frameworks fail to maintain a structured understanding of the task state, often relying on linear prompt concatenation or shallow memory buffers. This leads to brittle performance, frequent hallucinations, and poor long-range coherence. In this work, we propose the Task Memory Engine (TME), a lightweight and structured memory module that tracks task execution using a hierarchical Task Memory Tree (TMT). Each node in the tree corresponds to a task step, storing relevant input, output, status, and sub-task relationships. We introduce a prompt synthesis method that dynamically generates LLM prompts based on the active node path, significantly improving execution consistency and contextual grounding. Through case studies and comparative experiments on multi-step agent tasks, we demonstrate that TME leads to better task completion accuracy and more interpretable behavior with minimal implementation overhead. A reference implementation of the core TME components is available at https://github.com/biubiutomato/TME-Agent, including basic examples and structured memory integration. While the current implementation uses a tree-based structure, TME is designed to be graph-aware, supporting reusable substeps, converging task paths, and shared dependencies. This lays the groundwork for future DAG-based memory architectures.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。