PlugMem: A Task-Agnostic Plugin Memory Module for LLM Agents
MemoryAgentKnowledge Graph270+ICML 2026CCF-A伊利诺伊大学厄巴纳-香槟分校清华大学Microsoft ResearchPlugMem:面向 LLM 智能体的任务无关插件式记忆模块
Abstract
Long-term memory is essential for large language model (LLM) agents operating in complex environments, yet existing memory designs are either task-specific and non-transferable, or task-agnostic but less effective due to low task-relevance and context explosion from raw memory retrieval. We propose PlugMem, a task-agnostic plugin memory module that can be attached to arbitrary LLM agents without task-specific redesign. Motivated by the fact that decision-relevant information is concentrated as abstract knowledge rather than raw experience, we draw on cognitive science to structure episodic memories into a compact, extensible knowledge-centric memory graph that explicitly represents propositional and prescriptive knowledge. This representation enables efficient memory retrieval and reasoning over task-relevant knowledge, rather than verbose raw trajectories, and departs from other graph-based methods like GraphRAG by treating knowledge as the unit of memory access and organization instead of entities or text chunks. We evaluate PlugMem unchanged across three heterogeneous benchmarks (long-horizon conversational question answering, multi-hop knowledge retrieval, and web agent tasks). The results show that PlugMem consistently outperforms task-agnostic baselines and exceeds task-specific memory designs, while also achieving the highest information density under a unified information-theoretic analysis. Code and data are available at GitHub.
长期记忆对于在复杂环境中运行的大语言模型(LLM)智能体至关重要,但现有记忆设计要么针对特定任务、无法迁移,要么虽与任务无关,却因任务相关性低以及检索原始记忆造成上下文爆炸而效果较弱。 我们提出 PlugMem,一种任务无关的插件式记忆模块,无需针对特定任务重新设计即可挂接到任意 LLM 智能体。 鉴于与决策相关的信息集中存在于抽象知识而非原始经验中,我们借鉴认知科学,将情景记忆组织成紧凑、可扩展且以知识为中心的记忆图,显式表示命题性知识和规定性知识。 这种表示能够对与任务相关的知识进行高效记忆检索与推理,而不是处理冗长的原始轨迹;它也不同于 GraphRAG 等其他图方法,因为其将 知识 而非实体或文本块作为记忆访问与组织的基本单位。 我们在三个异构基准上以完全相同的方式评估 PlugMem,分别涵盖长程对话问答、多跳知识检索和网页智能体任务。 结果表明,PlugMem 持续优于任务无关基线和任务特定的记忆设计,并在统一的信息论分析下实现了最高的信息密度。 代码和数据可在 GitHub 获取。

1. Introduction

Large language model (LLM) agents increasingly operate in settings that require long-term memory, where relevant information is distributed across long interaction histories and must be reused to support future decisions. However, naively accumulating past interactions as raw context quickly leads to unbounded memory growth, high computational cost, and degraded performance. To address this, many agent architectures rely on external memory modules to store and retrieve past experience. Yet most existing memory designs tightly couple memory representation and retrieval to specific tasks or benchmarks, relying on hand-crafted heuristics for what to store and how to use it. While effective in narrow settings, such task-specific memory modules fail to generalize: a memory system optimized for long-horizon conversations does not readily transfer to web navigation, and vice versa. This limitation motivates the need for a task-agnostic plug-and-play memory module that can be attached to arbitrary LLM agents without task-specific redesign, reducing per-task engineering overhead and enabling a single memory module to be reused across diverse agentic settings.
大语言模型(LLM)智能体越来越多地在需要长期记忆的环境中运行,其中相关信息分散在漫长的交互历史中,并且必须被重复利用以支持未来决策。 然而,将过去交互简单地作为原始上下文不断累积,很快就会导致记忆无限增长、计算成本高昂和性能下降。 为了解决这一问题,许多智能体架构依赖外部记忆模块来存储和检索过去的经验。 但现有大多数记忆设计都将记忆表示和检索与特定任务或基准紧密耦合,依靠人工设计的启发式规则决定存储什么以及如何使用。 这类任务特定的记忆模块虽然在狭窄场景中有效,却无法泛化:针对长程对话优化的记忆系统不能直接迁移到网页导航,反之亦然。 这一局限促使我们需要一种 任务无关、即插即用 的记忆模块,它无需针对特定任务重新设计即可挂接到任意 LLM 智能体,从而减少每项任务的工程开销,并使单个记忆模块能够在不同智能体场景中复用。
Designing such a general plugin memory module is challenging. The most straightforward task-agnostic approach is retrieval-based memory, where all past experiences are stored as raw text chunks and retrieved by relevance (optionally augmented with reasoning, as in RAG). However, this paradigm often fails in practice due to knowledge sparsity. Memories that are truly useful for decision-making are typically condensed and abstract forms of knowledge, whereas raw memories are verbose, episodic, and dominated by low-level information. For example, when recommending recipes, an agent benefits from knowing a user’s dietary preferences and restrictions, which are compact factual propositions distilled from many interactions, rather than re-reading long conversation histories. Similarly, when shopping on a previously unseen web interface, an agent needs generalizable procedural knowledge, i.e., how to search, filter, and check out, not raw trajectories containing full-page observations with thousands of irrelevant tokens. Treating raw episodic memory as directly usable knowledge therefore imposes an unnecessary context burden and obscures the information most relevant for decision-making.
设计这样一种通用插件式记忆模块颇具挑战。 最直接的任务无关方法是基于检索的记忆,即把所有过去经验存为原始文本块,并按相关性检索,必要时再像 RAG 那样加入推理。 然而,这一范式在实践中常因 知识稀疏 而失效。 真正有助于决策的记忆通常是凝练、抽象的知识,而原始记忆冗长、情景化,并且主要由低层信息构成。 例如,在推荐菜谱时,智能体受益于了解用户的饮食偏好和限制;这些信息是从多次交互中提炼出的紧凑事实命题,而不是重新阅读漫长的对话历史。 类似地,在此前未见过的网页界面上购物时,智能体需要的是可泛化的程序性知识,即如何搜索、筛选和结账,而不是包含完整页面观察和数千个无关 token 的原始轨迹。 因此,把原始情景记忆视为可直接使用的知识会造成不必要的上下文负担,并掩盖与决策最相关的信息。
Prior work has attempted to bridge this gap by compressing or summarizing memory, but largely in task-specific ways. Memory modules are often engineered to perform well on a particular benchmark, such as conversational long-term memory or web-based agents, implicitly assuming a single dominant type of memory. When applied to a different task domain, these designs rarely transfer without significant task-specific modifications. This raises a key challenge: how can we design a general-purpose memory module that simultaneously supports multiple memory types and adapts to the diverse demands of agentic tasks, and evaluate it in a way that jointly reflects decision utility and agent-side cost, while allowing cross-task comparability?
以往工作尝试通过压缩或总结记忆来弥合这一差距,但大多采用任务特定的方式。 记忆模块通常针对某个特定基准进行工程设计,例如对话长期记忆或网页智能体,并隐含地假设存在一种占主导地位的记忆类型。 当应用于不同的任务领域时,这些设计若不进行大量任务特定修改,往往很难迁移。 这提出了一个关键挑战:如何设计一种通用记忆模块,使其既能同时支持多种记忆类型并适应智能体任务的不同需求,又能以共同反映决策效用和智能体侧成本、同时允许跨任务比较的方式对其进行评估?
To address the design side of this challenge, we ground our approach in a principled account of memory organization from cognitive science. Decades of research suggest that the human brain makes a fundamental distinction between episodic memory (detailed records of experience) and knowledge-level memory, which can be further divided into semantic memory (knowing that; factual propositions) and procedural memory (knowing how; action-oriented prescriptions). Episodic memory serves as the source from which propositional and prescriptive knowledge are abstracted, while the latter forms are most directly useful for reasoning and decision-making. This perspective suggests that effective agent memory should not merely retrieve past experiences, but actively transform raw episodic memory into structured, knowledge-dense representations.
为解决这一挑战中的设计问题,我们以认知科学对记忆组织的原则性解释作为方法基础。 数十年的研究表明,人脑从根本上区分情景记忆(经验的详细记录)和知识层记忆;后者又可进一步分为语义记忆(“知道什么”,即事实性 命题)和程序性记忆(“知道怎么做”,即面向行动的 规程)。 情景记忆是抽象出命题性知识和规定性知识的来源,而后两种形式对推理和决策最为直接有用。 这一视角表明,有效的智能体记忆不应只是检索过去经验,而应主动将原始情景记忆转换为结构化、知识密集的表示。
Based on these principles, we introduce a novel plugin memory module PlugMem, that performs memory-to-knowledge abstraction and supports the unified management of multiple key memory types across agentic tasks. As shown in Figure 2, our approach consists of: i) a structuring module that standardizes heterogeneous raw memories and extracts propositional and prescriptive knowledge through hierarchical abstraction, organizing them into a memory graph; ii) a retrieval module that selects task-relevant subgraphs; and iii) a reasoning module that further adapts and compresses retrieved knowledge for the base agent. Unlike conventional knowledge graphs that operate on entities and relations, our memory graph operates on knowledge units (i.e., propositions and prescriptions) which form the fundamental units of memory access and manipulation. PlugMem can be viewed as a knowledge-centric form of GraphRAG tailored for memory management, where graph nodes are knowledge rather than entities or text chunks.
基于这些原则,我们提出一种新的插件式记忆模块 PlugMem,它执行 从记忆到知识的抽象,并支持跨智能体任务统一管理多种关键记忆类型。 如 图2 所示,我们的方法包括:i) 一个 结构化模块,对异构原始记忆进行标准化,并通过分层抽象提取命题性知识和规定性知识,将其组织成记忆图;ii) 一个选择与任务相关子图的 检索模块;以及 iii) 一个进一步为基础智能体适配并压缩所检索知识的 推理模块。 传统知识图谱以实体和关系为操作对象,而我们的记忆图以 知识单元(即命题和规程)为操作对象;这些知识单元构成记忆访问和操作的基本单位。 PlugMem 可以视为一种面向记忆管理、以知识为中心的 GraphRAG,其中图节点表示知识而非实体或文本块。
Complementary to the design of a general-purpose memory module, we contribute a novel utility-cost analysis framework that enables fair comparison between different memory designs across tasks, capturing both performance improvements and memory efficiency. Specifically, we measure the information density of memory, defined as the decision-relevant information gain provided to the base agent per memory token. We implement PlugMem and evaluate it on three heterogeneous and challenging benchmarks: long-horizon conversational question answering, multi-hop knowledge retrieval over Wikipedia, and web-based agent tasks. Using the same memory module implementation across all settings, we demonstrate consistent performance gains over vanilla task-agnostic baselines and task-specific memory modules, while incurring lower agent-side memory cost, as illustrated in Figure 1. Ablation studies further clarify the roles of different components. Since agentic memory ultimately serves decision-making, task performance is primarily determined by whether retrieval brings the most useful memory to bear at decision time. Our structuring module incrementally enhances retrieval by organizing heterogeneous experience into knowledge-centric memory units, yielding additional performance gains. Meanwhile, the reasoning module substantially improves efficiency, reducing memory token usage by one to two orders of magnitude through task-adaptive condensation. We provide illustrative benchmark examples in the Appendix.
作为通用记忆模块设计的补充,我们还提出一种新的效用—成本分析框架,使不同任务上的记忆设计能够得到公平比较,同时刻画性能提升与记忆效率。 具体而言,我们衡量记忆的 信息密度,其定义为每个记忆 token 为基础智能体带来的决策相关信息增益。 我们实现了 PlugMem,并在三个异构且富有挑战的基准上进行评估:长程对话问答、Wikipedia 上的多跳知识检索,以及网页智能体任务。 在所有场景中使用完全相同的记忆模块实现,我们相较普通任务无关基线和任务特定记忆模块取得了持续的性能提升,同时产生更低的智能体侧记忆成本,如 图1 所示。 消融研究进一步阐明了不同组件的作用。 由于智能体记忆最终服务于决策,任务性能首先取决于检索能否在决策时调取最有用的记忆。 我们的结构化模块将异构经验组织为以知识为中心的记忆单元,从而逐步增强检索并带来额外性能提升。 与此同时,推理模块通过任务自适应的凝练大幅提升效率,将记忆 token 使用量减少一到两个数量级。 附录中给出了说明性的基准示例。
In summary, our contributions are fourfold:
- Design principles: cognitively motivated principles for task-agnostic memory in LLM agents.
- Evaluation framework: an information-theoretic measure of memory utility and efficiency.
- General memory module: a plugin memory system applicable across heterogeneous agentic benchmarks.
- Reproducibility: released code and experimental results.
总之,我们的贡献包括四个方面:
- 设计原则: 由认知理论启发的 LLM 智能体任务无关记忆原则。
- 评估框架: 对记忆效用与效率进行信息论衡量的方法。
- 通用记忆模块: 可应用于异构智能体基准的插件式记忆系统。
- 可复现性: 已发布代码和实验结果。
2. Related Work
Cognitive Science Based Agent Memory. Cognitive science characterizes long-term memory as persistent storage, and distinguishing episodic, semantic, and procedural memory. In agentic settings, interactions are naturally episodic, from which reusable abstractions can be derived, e.g., factual information such as user preferences can be distilled into semantic memory, while action strategies can be abstracted as procedural memory. These abstractions align with more general knowledge notions: propositional knowledge as factual statements and prescriptive knowledge as generalized goal-directed procedures.
基于认知科学的智能体记忆。 认知科学将长期记忆描述为持久存储,并区分情景记忆、语义记忆和程序性记忆。 在智能体环境中,交互天然具有情景性,并可从中导出可复用的抽象,例如用户偏好等事实信息可以提炼为语义记忆,而行动策略可以抽象为程序性记忆。 这些抽象与更一般的知识概念相一致:命题性知识是事实陈述,规定性知识则是泛化的目标导向流程。
Building on these insights, recent systems incorporate different memory types to support long-context understanding, long-term interactions, structured memory organization, and experience-driven strategy refinement. However, most approaches are task-specific and do not jointly support multiple memory types. In contrast, PlugMem standardizes heterogeneous episodic experience and organizes extracted knowledge into a propositional-prescriptive structure, enabling task-agnostic reuse.
基于这些认识,近期系统引入不同记忆类型,以支持长上下文理解、长期交互、结构化记忆组织和经验驱动的策略改进。 然而,大多数方法都是任务特定的,并不同时支持多种记忆类型。 相比之下,PlugMem 对异构情景经验进行标准化,并把所提取知识组织成命题—规程结构,从而实现任务无关的复用。
Memory Module Designs. Many agent memory systems adopt retrieval-based external memory, storing past interactions and retrieving them at inference time. Early task-agnostic methods rely on flat retrieval over unstructured episodic memory, such as vanilla retrieval and RAG, resulting in redundant and episode-specific memory reuse. Later work introduces structure over episodic memory, including hierarchical and graph-based retrieval (e.g., GraphRAG) to support multi-hop reasoning. While improving access efficiency, these methods largely preserve episodic traces as the primary memory unit. In parallel, task-specific systems explicitly transform experience into higher-level representations, such as temporal knowledge graphs or workflow memories. Although effective within fixed tasks, their abstractions are tightly coupled to task assumptions and limit transferability.
记忆模块设计。 许多智能体记忆系统采用基于检索的外部记忆,在推理时存储并检索过去交互。 早期任务无关方法依赖对无结构情景记忆的平面检索,例如普通检索和 RAG,因而造成冗余且局限于具体情景的记忆复用。 后续工作在情景记忆之上引入结构,包括支持多跳推理的分层检索和图检索,例如 GraphRAG。 这些方法虽然提高了访问效率,却大多仍将情景轨迹作为主要记忆单元。 与此同时,任务特定系统会显式地把经验转换成更高层表示,例如时序知识图谱或工作流记忆。 这些抽象虽然在固定任务内有效,却与任务假设紧密耦合,限制了可迁移性。
Overall, as shown in Table 1, prior work highlights a distinction between improving retrieval over episodic memory and transforming experience into reusable knowledge, with only the latter supporting cross-task generalization. PlugMem adopts this principle by organizing memory around propositional and prescriptive knowledge units, enabling more effective retrieval of decision-relevant information, while retaining episodic traces as verifiable evidence. For a more detailed discussion of related work, including the full versions of the above sections and additional discussion on memory benchmarks, see the Appendix.
总体而言,如 表1 所示,以往工作揭示了两类思路的区别:改进对情景记忆的检索,以及把经验转换为可复用知识;只有后者支持跨任务泛化。 PlugMem 采用这一原则,围绕命题性和规定性知识单元组织记忆,使与决策相关的信息能够被更有效地检索,同时保留情景轨迹作为可验证证据。 关于相关工作的更详细讨论,包括上述各部分的完整版以及记忆基准的补充讨论,见附录。
3. Methodology
We present PlugMem, a task-agnostic plugin memory module to support long-term decision-making for LLM agents. Rather than treating past interactions as flat episodic text, PlugMem structures experience into knowledge-level representations that are more compact, generalizable, and directly relevant to downstream retrieval and reasoning. As shown in Figure 2, PlugMem consists of three core components: a structuring module that standardizes heterogeneous episodic memories and induces propositional and prescriptive knowledge; a retrieval module that selects relevant knowledge from structured memory graphs via abstraction-aware retrieval; and a reasoning module that further adapts retrieved knowledge into actionable guidance for the base agent. In the following sections, we describe each component in detail.
我们提出 PlugMem,一种任务无关的插件式记忆模块,用于支持 LLM 智能体的长期决策。 PlugMem 不把过去交互视为扁平的情景文本,而是将经验组织成更紧凑、更具泛化能力、并且与后续检索和推理直接相关的知识层表示。 如 图2 所示,PlugMem 由三个核心组件构成:结构化模块,用于标准化异构情景记忆并归纳命题性知识和规定性知识;检索模块,通过感知抽象层次的检索,从结构化记忆图中选择相关知识;以及 推理模块,用于进一步把检索到的知识转化为基础智能体可直接执行的指导。 下面我们详细介绍各个组件。

3.1 Structuring Module
| Memory Type | Nature & Description | Knowledge-Dense Unit | Subgraph Structuring Logic |
|---|---|---|---|
| Semantic | Declarative & Static Context-independent concepts, facts, and world knowledge. | The Proposition (Fact Block) A complete statement conveying verifiable truth. | Concept-Centric Semantic Mem Structuring Logic: Concepts acts as lightweight indices pointing to heavy Proposition payloads. Structure: Concept ←mentions Proposition |
| Procedural | Executive & Goal-Oriented Dynamic “how-to” knowledge for problem solving. | The Prescription (Workflow Block) A full action sequence to execute a complex task. | Intent-Centric Procedural Mem Structuring Logic: Intents (User Goals) serve as keys to find holistic Solution blocks. Structure: Intent ←solves Prescription |
| Episodic | Autobiographical & Linear Raw record of past interactions and observations. Large volume. | The Source Trace (Event Window) A trajectory segment for grounding and verification. | Episodic Mem as the Anchor Logic: Episodic acts as the “ground truth” layer validating the abstract knowledge graphs. Structure: Knowledge ←proves Source |
As shown in Figure 3, the structuring module serves as the foundation of PlugMem by transforming raw episodic experience, such as dialogue turns, document snippets, or episodic trajectories, into knowledge representations that are reusable, compact, and aligned with agent decision-making. Specifically, we structure memory to reflect the role different information plays in reasoning and action selection.
如 图3 所示,结构化模块是 PlugMem 的基础,它把对话轮次、文档片段或情景轨迹等原始情景经验转换成可复用、紧凑且与智能体决策一致的知识表示。 具体而言,我们根据不同信息在推理和动作选择中发挥的作用来组织记忆。
Our design is guided by three principles motivated by cognitive theories of human memory. First, episodic memory captures concrete interaction traces and serves primarily as verifiable evidence rather than directly actionable knowledge. Second, decision-relevant information is most effectively represented at the knowledge level, where semantic memory encodes factual propositions (“knowing that”) and procedural memory encodes reusable strategies (“knowing how”). Third, effective long-term memory requires separating knowledge abstraction from task-specific execution details, enabling memory to generalize across heterogeneous environments. These principles imply that different memory types should be represented using structural units and organization logics aligned with their properties. Table 2 summarizes how episodic, semantic, and procedural memories are mapped to corresponding graph units and structuring mechanisms, reflecting their functional roles in abstraction, retrieval, and verification.
我们的设计遵循三个源自人类记忆认知理论的原则。 第一,情景记忆记录具体的交互轨迹,其主要作用是充当可验证证据,而不是可直接执行的知识。 第二,与决策相关的信息在知识层最适合表示:语义记忆编码事实命题,即“知道什么”;程序性记忆编码可复用策略,即“知道怎么做”。 第三,有效的长期记忆需要将知识抽象与任务特定的执行细节分离,使记忆能够在异构环境中泛化。 这些原则意味着,不同记忆类型应使用与其性质相匹配的结构单元和组织逻辑来表示。 表2 总结了情景记忆、语义记忆和程序性记忆如何映射到相应的图单元与结构化机制,并反映它们在抽象、检索和验证中的功能作用。
Building on this design, the structuring module operationalizes memory abstraction in two stages: i) standardizing heterogeneous interaction traces into a unified episodic representation, and ii) inducing propositional and prescriptive knowledge that can be independently indexed and reused across tasks. We describe each stage as follows.
在这一设计基础上,结构化模块分两个阶段实现记忆抽象:i) 将异构交互轨迹标准化为统一的情景表示;ii) 归纳可独立索引并在任务间复用的命题性知识和规定性知识。 下面分别介绍这两个阶段。

3.1.1 Standardize
Episodic memory constitutes the fundamental substrate from which semantic and procedural memories are derived. For agents, episodic memories originate from heterogeneous sources, including user--agent interactions, factual documents, and action trajectories in complex environments. This heterogeneity motivates a unified, task-agnostic representation that can support downstream knowledge induction.
情景记忆构成派生语义记忆和程序性记忆的基础。 对于智能体而言,情景记忆来自异构来源,包括用户与智能体的交互、事实文档,以及复杂环境中的动作轨迹。 这种异构性促使我们采用一种统一且任务无关的表示,以支持后续知识归纳。
Episodic Formalization. We represent a raw interaction trace as a sequence of observation-action pairs:
情景形式化。 我们将原始交互轨迹表示为一系列观察-动作对:
While episodic memory is widely used in agent systems, its internal structure is often treated as unstructured text. In contrast, we explicitly formalize episodic memory at the step level by mapping each interaction into a structured tuple. Specifically, each pair
尽管情景记忆已广泛用于智能体系统,其内部结构却常被视为无结构文本。 相比之下,我们在步骤层面显式形式化情景记忆,将每次交互映射为一个结构化元组。 具体而言,每个
Here
其中,
Implementation details of episodic standardization, including the prompt template, are provided in the Appendix.
情景标准化的实现细节(包括提示模板)见附录。
3.1.2 Extract Knowledge
We focus this section on the design of the knowledge extraction and organization process. Implementation details, including model choices, parameter settings, and prompt configurations, are deferred to the Appendix. Given standardized episodic memory
本节重点介绍知识抽取与组织过程的设计。 模型选择、参数设置和提示配置等实现细节见附录。 给定标准化情景记忆
Semantic Memory. The semantic memory module extracts and stores factual knowledge from episodic memory to support later retrieval. Given an episodic unit
语义记忆。 语义记忆模块从情景记忆中提取并存储事实知识,以支持后续检索。 给定一个情景单元
The extracted propositions and concepts are stored in a semantic graph
提取出的命题和概念存储在语义图
Procedural Memory. The procedural memory module extracts reusable action strategies from episodic trajectories to support future decision making. Given an episodic sequence
程序性记忆。 程序性记忆模块从情景轨迹中提取可复用的动作策略,以支持未来决策。 给定情景序列
To enable quality-aware reuse, each induced prescription is assigned a scalar return score. The score is obtained using an LLM-based evaluator that assesses whether the intent is achieved and how well the prescription is executed. The extracted intents and prescriptions are stored in a procedural memory graph
为支持感知质量的复用,每个归纳出的规程都会被赋予一个标量 回报 分数。 该分数由基于 LLM 的评估器给出,评估器判断意图是否达成以及规程执行得如何。 提取出的意图和规程存储在程序性记忆图
First, hierarchical edges link each high-level intent node to its associated low-level prescription nodes. Second, provenance edges link prescription nodes to their originating episodic units in the episodic graph
第一,层级 边将每个高层意图节点连接到与之相关的低层规程节点。 第二,来源 边将规程节点连接到情景图
3.2 Retrieval Module
This section describes the high-level retrieval process over semantic and procedural memory graphs. Detailed prompt templates, the step-by-step retrieval algorithm, and more technical details are deferred to the Appendix. In the structuring stage, PlugMem constructs three interlinked memory graphs: an episodic graph
本节介绍语义记忆图和程序性记忆图上的高层检索过程。 详细提示模板、逐步检索算法以及更多技术细节见附录。 在结构化阶段,PlugMem 构建三个相互连接的记忆图:情景图
Given a task description or query
给定任务描述或查询
Retrieval begins by encoding
检索首先将
Only low-level nodes are retained as candidates, while high-level nodes serve exclusively as intermediate traversal signals. When
只有低层节点会作为候选项保留,而高层节点仅充当中间遍历信号。 当
3.3 Reasoning Module
The reasoning module is a test-time running module that transforms retrieved memory into immediately actionable guidance for the playing agent. In many cases, retrieved memory may contain multiple overlapping or verbose descriptions of past interactions that are individually relevant but collectively redundant for the current decision. The reasoning module leverages the LLM to aggregate and condense such information into a compact, task-aligned representation, distilling the shared signal across messages into a single actionable summary. More technical details are included in the Appendix.
推理模块是一个 测试时运行模块,它把检索到的记忆转换成执行智能体可立即采用的行动指导。 在许多情况下,检索到的记忆可能包含多段相互重叠或冗长的过去交互描述;它们各自相关,但对当前决策而言整体上存在冗余。 推理模块利用 LLM 聚合并凝练这些信息,形成紧凑且与任务一致的表示,把多条信息中的共同信号提炼成一份可执行摘要。 更多技术细节见附录。
3.4 Summary and Supported Operations
As shown in Figure 3 and Figure 4, starting from raw agent interactions, PlugMem standardizes episodic memory, extracts semantic and procedural knowledge, organizes them into structured memory graphs, and enables retrieval and reasoning over stored experience to support downstream decision making. At the system level, PlugMem supports a set of basic memory graph operations, including: i) create, which inserts newly observed episodic experience into structured memory, ii) retrieve, which retrieves relevant semantic, procedural, or episodic memory given a task or query, iii) update, which revises existing memory entries when new evidence becomes available, and iv) delete, which removes obsolete or low-utility memory.
如 图3 和 图4 所示,PlugMem 从原始智能体交互出发,对情景记忆进行标准化,提取语义知识和程序性知识,将其组织成结构化记忆图,并对已存经验执行检索和推理,以支持后续决策。 在系统层面,PlugMem 支持一组基本记忆图操作,包括:i) 创建,将新观察到的情景经验插入结构化记忆;ii) 检索,根据任务或查询检索相关的语义记忆、程序性记忆或情景记忆;iii) 更新,在获得新证据时修订已有记忆条目;iv) 删除,移除过时或低效用的记忆。
The benchmark evaluations in the main paper primarily evaluate the create and retrieve operations. Additional experiments evaluating the effectiveness of the update and delete operations are provided in the Appendix.
主文中的基准评估主要考察 创建 和 检索 操作。 评估 更新 和 删除 操作有效性的额外实验见附录。



4. Experiments
4.1 Evaluation Framework
We evaluate PlugMem using standard benchmark-wise metrics (e.g., accuracy, F1-score, success rate, etc.) to measure end-task performance. However, such metrics alone are insufficient for evaluating agentic memory, as they fail to capture the trade-off between decision-relevant utility and agent-side cost. We therefore propose an information-theoretic measure that quantifies the decision-relevant information gain per memory token contributed by the memory module. Specifically, for each decision instance with state
我们使用各基准的标准指标(例如准确率、F1 分数、成功率等)评估 PlugMem,以衡量最终任务性能。 然而,仅凭这些指标不足以评估智能体记忆,因为它们无法反映决策相关效用与智能体侧成本之间的权衡。 因此,我们提出一种信息论度量,用于量化记忆模块贡献的 每个记忆 token 所带来的决策相关信息增益。 具体而言,对于状态为
We normalize by memory length
我们再按记忆长度
Over a dataset, we report a global, amortized density via a ratio-of-sums:
在整个数据集上,我们使用和之比报告全局摊销密度:
Measured in bits per token, our metric is task-agnostic and thus comparable across tasks. Cross-task variation in its magnitude reflects a utility–cost trade-off: higher density arises when memory yields larger decision-relevant gains or does so with fewer tokens, while lower density occurs when the base agent already solves the task well or when useful memory must be expressed verbosely. The Appendix details the complete analysis framework and additional components beyond the main-text description.
我们的指标以 bit/token 计量,与任务无关,因此可以在任务之间进行比较。 该指标大小的跨任务变化反映了效用与成本的权衡:当记忆带来更大的决策相关增益,或以更少 token 实现这种增益时,密度更高;当基础智能体已经能很好地解决任务,或有用记忆必须冗长表达时,密度更低。 完整分析框架以及主文描述之外的其他组成部分见附录。
4.2 Common Experimental Setup
We evaluate PlugMem unchanged across three heterogeneous benchmarks that stress different aspects of agentic memory: i) LongMemEval for long-horizon conversational memory, ii) HotpotQA for multi-hop knowledge retrieval and reasoning, and iii) WebArena for interactive web-based decision-making. Across all benchmarks, we adopt a unified memory evaluation protocol to ensure fair comparison. Unless otherwise specified, we use NV-Embed-v2 for embedding-based retrieval. Retrieval is performed under a fixed budget (e.g., top-K retrieval), which is held constant across methods within each benchmark.
我们以完全相同的 PlugMem 配置在三个异构基准上进行评估,它们分别强调智能体记忆的不同方面:i) LongMemEval,考察长程对话记忆;ii) HotpotQA,考察多跳知识检索与推理;iii) WebArena,考察交互式网页决策。 在所有基准上,我们采用统一的记忆评估协议,以确保公平比较。 除非另有说明,我们使用 NV-Embed-v2 进行基于嵌入的检索。 检索在固定预算下进行(例如 top-K 检索),并在每个基准的不同方法之间保持一致。
For PlugMem, the structuring and reasoning modules are instantiated using Qwen2.5-32B/72B-Instruct and GPT-4o, while all base agents are driven by the same model unless explicitly stated. Decoding parameters are fixed across methods to eliminate confounding effects. For WebArena, we distinguish between online and offline evaluation phases to assess knowledge transfer and reuse; the detailed experimental design is described in Section 4.5.
对于 PlugMem,结构化模块和推理模块使用 Qwen2.5-32B/72B-Instruct 与 GPT-4o 实例化;除非明确说明,所有基础智能体均由同一模型驱动。 不同方法使用固定的解码参数,以消除混杂影响。 对于 WebArena,我们区分在线与离线评估阶段,以考察知识迁移和复用;详细实验设计见第 4.5 节。
Baselines are grouped into three categories:
- Vanilla, which do not rely on external memory.
- Task-agnostic, which employ generic retrieval or agentic memory mechanisms not tailored to the benchmark.
- Task-specific, which incorporate benchmark-specific memory representations or retrieval heuristics.
基线分为三类:
- 普通基线,不依赖外部记忆。
- 任务无关基线,采用并非针对该基准定制的通用检索或智能体记忆机制。
- 任务特定基线,采用针对基准设计的记忆表示或检索启发式方法。
Detailed benchmark-specific settings, prompt templates, and benchmark-level analysis are provided in the Appendix.
各基准的详细设置、提示模板和基准层分析见附录。
| Method | Emb | LLM | Acc. | #Tok Avg. | Info. Density |
|---|---|---|---|---|---|
| Vanilla Baseline | |||||
| No Context | - | Q72 | 14.8 | - | - |
| All Context | - | Q72 | 62.4 | 107K | 4.2e-5 |
| Task-Agnostic | |||||
| Vanilla Retrieval | NVE | Q72 | 63.6 | 3742.52 | 1.2e-3 |
| A-Mem† | NVE | 4o + Q72 | 61.0 | 4225.85 | 1.0e-3 |
| Task-Specific | |||||
| Zep* | BGE-m3 | 4o | 71.2 | 1600 | - |
| LiCoMemory† | NVE | 4o + Q72 | 73.0 | 5914.85 | 9.3e-4 |
| Ours | |||||
| PlugMem | NVE | Q32 + Q72 | 75.1 | 362.58 | 1.6e-2 |
| Mem. Method | Emb | LLM | EM | F1 | #Tok Avg. | Info. Density |
|---|---|---|---|---|---|---|
| Vanilla Baseline | ||||||
| No Context | - | Q32 | 22.1 | 31.0 | - | - |
| Gold Context | - | Q32 | 69.2 | 82.1 | 86.5 | 1.6e-1 |
| Task-Agnostic | ||||||
| Vanilla Retrieval | NVE | Q32 | 51.7 | 62.7 | 659.2 | 1.2e-2 |
| A-Mem | NVE | Q32 | 43.8 | 53.6 | 695.6 | 1.2e-2 |
| Task-Specific | ||||||
| GraphRAG* | NVE | L70 | 55.2 | 68.6 | - | - |
| RAPTOR | NVE | Q32 | 56.7 | 69.7 | 806.3 | 1.1e-2 |
| PropRAG | NVE | Q32 | 57.8 | 72.1 | 626.1 | 1.9e-2 |
| HippoRAG2 | NVE | Q32 | 60.0 | 73.3 | 595.1 | 1.9e-2 |
| Ours | ||||||
| PlugMem | NVE | Q32 | 61.4 | 74.1 | 81.6 | 1.4e-1 |
| Method | Emb | Agent | SR % (on/off) | #Tok Avg. | Info. Density | ||
|---|---|---|---|---|---|---|---|
| Shopping | GitLab | Multi-site | |||||
| Vanilla Baseline | |||||||
| AgentOccam* | - | 4o | 42.1/43.6 | 37.8/39.2 | 20.0/15.8 | - | - |
| Task-Agnostic | |||||||
| Van. Retrieval | NVE | Q32+4o | 43.0/42.3 | 40.5/41.3 | 10.0/18.4 | 8733 | 2.0e-6 |
| A-Mem | NVE | Q32+4o | 44.7/44.3 | 37.8/38.5 | 20.0/15.8 | 20516 | 3.4e-7 |
| Task-Specific | |||||||
| AWM | - | 4o | 26.3/28.2 | 27.0/27.3 | - | 696 | -7.9e-4 |
| Ours | |||||||
| PlugMem | NVE | Q32+4o | 52.6/58.4 | 51.4/55.2 | 20.0/21.6 | 301 | 1.4e-3 |
4.3 RQ1: Does PlugMem Improve Performance and Memory Efficiency Across Tasks?
Our first research question examines whether a single, task-agnostic memory module can consistently improve agent performance while reducing memory consumption across heterogeneous tasks. Results on LongMemEval, HotpotQA, and WebArena (Table 3, Table 4, and Table 5) show a consistent pattern despite large differences in task structure and interaction modality. First, PlugMem improves end-task performance over both task-agnostic and task-specific baselines. Second, these gains are achieved with substantially fewer memory tokens injected into the agent context. Thus, PlugMem attains the highest information-gain density under the unified information-theoretic analysis introduced in Section 4.1. This trade-off is further illustrated by the utility–cost visualization in Figure 5, where PlugMem consistently shifts toward higher utility and lower agent-side cost across all three benchmarks.
我们的第一个研究问题考察:单个任务无关记忆模块能否在异构任务上持续提升智能体性能,同时减少记忆消耗。 LongMemEval、HotpotQA 和 WebArena 上的结果(表3、表4 和 表5)呈现出一致模式,尽管这些任务的结构和交互模态存在很大差异。 第一,PlugMem 在最终任务性能上同时优于任务无关基线和任务特定基线。 第二,这些提升是在向智能体上下文注入显著更少的记忆 token 的情况下取得的。 因此,在第 4.1 节提出的统一信息论分析下,PlugMem 实现了最高的 信息增益密度。 图5 的效用-成本可视化进一步展示了这一权衡:在三个基准上,PlugMem 始终向更高效用和更低智能体侧成本的方向移动。
The results indicate that PlugMem retrieves more decision-relevant memory. By abstracting raw experience into compact propositional and prescriptive knowledge, the memory module provides higher utility per token, enabling the base agent to reason more effectively under tight context budgets.
结果表明,PlugMem 检索到了 更多与决策相关的记忆。 通过把原始经验抽象成紧凑的命题性知识和规定性知识,该记忆模块为每个 token 提供了更高效用,使基础智能体能在严格的上下文预算下更有效地推理。
4.4 RQ2: What Is the Role of Each Component in PlugMem?
We next analyze the contribution of each component in PlugMem via ablations on all benchmarks (Table 6, Table 7, and Table 8). Removing retrieval leads to the most severe performance degradation across tasks, underscoring that memory is only useful when relevant experience can be accessed at decision time. However, this does not imply that retrieval alone drives performance gains. Rather, retrieval determines whether memory is operative at all, while its effectiveness is bounded by how memory is represented.
接下来,我们通过所有基准上的消融实验(表6、表7 和 表8)分析 PlugMem 各组件的贡献。 移除检索会在各任务上造成最严重的性能下降,这表明只有在决策时能够访问相关经验,记忆才 有用。 然而,这并不意味着性能提升仅由检索驱动。 更准确地说,检索决定记忆是否真正发挥作用,而其有效性受记忆表示方式的限制。
| Method | Emb | LLM | Acc. | #Tok Avg. | Info. Density |
|---|---|---|---|---|---|
| PlugMem | NVE | Q32 + Q72 | 75.1 | 362.58 | 1.6e-2 |
| No Structuring | NVE | Q32 + Q72 | 62.8 | 311.12 | 1.4e-2 |
| No Retrieval | - | Q32 + Q72 | 57.2 | 591.2 | 6.8e-3 |
| No Reasoning | NVE | Q32 | 72.4 | 9478.59 | 5.8e-4 |
| Method | Emb | LLM | EM | F1 | #Tok Avg. | Info. Density |
|---|---|---|---|---|---|---|
| PlugMem | NVE | Q32 | 61.4 | 74.1 | 81.6 | 1.4e-1 |
| No Structuring | NVE | Q32 | 51.4 | 62.0 | 116.7 | 6.8e-2 |
| No Retrieval | - | Q32 | 20.0 | 24.3 | 8.01 | -3.8e-1 |
| No Reasoning | NVE | Q32 | 59.3 | 71.8 | 635.1 | 1.7e-2 |
1 In No Retrieval, we randomly sample corpus items to fit the reasoning module's context window. The sampled items are often irrelevant, so the reasoning module outputs little to no distilled context, yielding a much smaller #Tok Avg. (e.g., 8).
| Method | Emb | Agent | SR % (on/off) | #Tok Avg. | Info. Density | ||
|---|---|---|---|---|---|---|---|
| Shopping | GitLab | Multi-site | |||||
| PlugMem | NVE | Q32+4o | 52.6/58.4 | 51.4/55.2 | 20.0/21.6 | 301 | 1.4e-3 |
| No Structuring | NVE | Q32+4o | 50.0/51.7 | 41.7/42.0 | 20.0/18.4 | 243 | 7.2e-4 |
| No Retrieval | NVE | Q32+4o | 42.1/46.3 | 45.8/44.0 | 20.0/15.8 | 286 | 3.8e-4 |
| No Reasoning | NVE | Q32+4o | 52.6/53.7 | 41.7/43.4 | 20.0/18.4 | 374 | 5.6e-4 |
| No Human Demo | NVE | Q32+4o | 52.6/52.3 | 51.4/51.0 | 20.0/18.4 | 261 | 1.2e-3 |
The structuring module improves retrieval by organizing memory at appropriate abstraction levels, allowing the retriever to more effectively identify and access task-relevant knowledge. The reasoning module plays a complementary role, primarily affecting memory efficiency by controlling how retrieved knowledge is compressed and consumed. Overall, retrieval determines whether memory helps, structuring determines what can be retrieved, and reasoning determines how efficiently retrieved memory can be used. Retrieval thus constitutes the defining bottleneck, while structuring and reasoning modulate effectiveness and efficiency once retrieval is in place.
结构化模块通过在适当抽象层次上组织记忆来改善检索,使检索器能更有效地识别并访问与任务相关的知识。 推理模块发挥互补作用,主要通过控制检索知识的压缩和消费方式来影响记忆效率。 总体而言,检索决定记忆 是否 有帮助,结构化决定 能够检索什么,推理则决定 检索到的记忆能以多高效率使用。 因此,检索构成决定性的瓶颈;一旦具备检索能力,结构化和推理便会调节其有效性与效率。
4.5 RQ3: Knowledge Transfer and Memory Reuse
Our third research question evaluates whether agent memory can support transferable knowledge that generalizes across task instantiations and environments. To this end, we design a specialized evaluation protocol on WebArena. We focus on the Shopping, GitLab, and Multi-site subsets. Shopping and GitLab are procedure-heavy domains with large task volumes and relatively low baseline success rates, avoiding saturation effects. The Multi-site subset further requires compositional skills across multiple websites, making it particularly challenging and well-suited for evaluating cross-task knowledge reuse.
我们的第三个研究问题考察智能体记忆能否支持可迁移知识,使其在不同任务实例和环境间泛化。 为此,我们在 WebArena 上设计了一套专门的评估协议。 我们重点考察 Shopping、GitLab 和 Multi-site 子集。 Shopping 和 GitLab 是程序性要求较高的领域,任务量大且基线成功率相对较低,因而可避免饱和效应。 Multi-site 子集还要求跨多个网站组合技能,因此尤其具有挑战性,也很适合评估跨任务知识复用。
To explicitly test memory evolution and reuse, we split tasks into an online set and an offline set based on WebArena's intent templates. For each template, one instantiation is assigned to the online set, while the remaining instantiations form the offline set. The agent is first evaluated on the online set, during which PlugMem is allowed to insert and retrieve memory. We then augment the memory module with a small number of high-quality human demonstrations, representing external sources of procedural knowledge analogous to tutorials or experience sharing. Finally, we evaluate on the offline set, where memory insertion is largely disabled and only retrieval is allowed.
为显式测试记忆演化与复用,我们依据 WebArena 的意图模板将任务划分为 在线 集和 离线 集。 对于每个模板,一个实例被分配到在线集,其余实例组成离线集。 我们首先在在线集上评估智能体,在此期间允许 PlugMem 插入和检索记忆。 随后,我们向记忆模块加入少量高质量人类示范,它们代表类似教程或经验分享的外部程序性知识来源。 最后,我们在离线集上评估,此时基本禁用记忆插入,只允许检索。
This protocol evaluates memory as reusable knowledge rather than episodic recall. The agent evaluated on the offline set can be viewed as a new agent that inherits a pre-built memory graph, testing whether accumulated procedural and semantic knowledge can mitigate cold-start issues. Additional experimental details and implementation specifics are provided in the Appendix. As shown in Table 5, PlugMem significantly improves success rates on the offline set across domains, with strong gains on the Multi-site tasks. These results demonstrate effective reuse of accumulated procedural and semantic knowledge, mitigating cold-start issues and supporting compositional generalization.
这一协议把记忆作为可复用知识而非情景回忆来评估。 离线集上的智能体可被视为继承了预构建记忆图的新智能体,由此检验积累的程序性知识和语义知识能否缓解冷启动问题。 更多实验细节和具体实现见附录。 如 表5 所示,PlugMem 显著提高了各领域离线集上的成功率,并在 Multi-site 任务上取得强劲增益。 这些结果表明,积累的程序性知识和语义知识得到了有效复用,从而缓解冷启动问题并支持组合泛化。
4.6 Discussion: Why Can a Task-Agnostic Memory Outperform Task-Specific Designs?
A natural question is why a task-agnostic memory module can outperform systems tailored to individual benchmarks. Our results suggest that the key difference lies not in rejecting task-specific heuristics, but in prioritizing what fundamentally makes agentic memory effective. Task-specific designs often encode benchmark-specific insights through customized memory units or transformations, implicitly assuming that relevant memory will be available when needed. While effective within their scope, such approaches conflate memory transformation with memory utility.
一个自然的问题是:为什么任务无关记忆模块能够优于针对单个基准定制的系统? 我们的结果表明,关键差异不在于拒绝任务特定启发式方法,而在于优先处理从根本上决定智能体记忆有效性的因素。 任务特定设计往往通过定制记忆单元或转换方式编码针对基准的经验,并隐含地假设相关记忆在需要时可以获得。 这类方法虽然在其适用范围内有效,却混淆了记忆转换和记忆效用。
In contrast, our findings highlight that agentic memory is fundamentally retrieval-driven. Without effective retrieval, neither task-specific abstractions nor carefully engineered memory representations translate into performance gains, as consistently shown in our ablations. At the same time, retrieval alone is insufficient. Its effectiveness is bounded by how memory is structured, since structuring determines which aspects of experience can be indexed and recovered. Our knowledge-centric structuring enables retrieval over semantically meaningful and decision-relevant abstractions, allowing useful information to surface at decision time.
相比之下,我们的发现强调,智能体记忆从根本上由检索驱动。 消融实验始终表明,如果没有有效检索,无论是任务特定抽象还是精心设计的记忆表示,都无法转化为性能提升。 与此同时,仅有检索也不够。 检索的有效性受记忆结构限制,因为结构化决定经验的哪些方面可以被索引和恢复。 我们以知识为中心的结构化方式能够在语义明确且与决策相关的抽象上进行检索,使有用信息能在决策时浮现。
Importantly, PlugMem is designed as a task-agnostic memory backbone that targets the shared retrieval and representation challenges underlying agentic memory designs. From this perspective, task-specific memory approaches and heuristics can be naturally layered on top of PlugMem, rather than viewed as alternatives to it. Our framework therefore provides a common foundation on which task-specific adaptations can be applied to further improve performance.
重要的是,PlugMem 被设计为任务无关的记忆骨干,针对智能体记忆设计中共同存在的检索和表示难题。 从这一视角看,任务特定的记忆方法和启发式策略可以自然叠加在 PlugMem 之上,而不应被视为它的替代方案。 因此,我们的框架提供了一个共同基础,可在其上应用任务特定适配以进一步提升性能。
We empirically validate this view through additional task-adaptation experiments, where representative task-specific heuristics and memory transformation strategies from prior baselines are integrated into PlugMem. These adaptations consistently lead to further performance improvements beyond using PlugMem alone, indicating that task-specific techniques and our task-agnostic memory design are complementary. Detailed experimental setups and results are provided in the Appendix.
我们通过额外的任务适配实验对这一观点进行实证验证,将以往基线中具有代表性的任务特定启发式方法和记忆转换策略集成到 PlugMem 中。 这些适配始终在单独使用 PlugMem 的基础上进一步提升性能,表明任务特定技术与我们的任务无关记忆设计是 互补的。 详细实验设置和结果见附录。
5. Conclusions
We presented PlugMem, a task-agnostic plugin memory module that organizes agent experience into knowledge-centric representations to enable effective retrieval of decision-relevant memory across diverse agentic tasks. Through extensive experiments, we demonstrate that PlugMem consistently improves end-task performance while reducing agent-side memory cost under a unified utility–cost evaluation framework. Beyond standalone usage, PlugMem serves as a general memory backbone that can be augmented with task-specific heuristics, with task-adaptation experiments showing further gains. Overall, these results position PlugMem as principled foundation for transferable and efficient memory in LLM agents, pointing toward more general and extensible memory systems for long-horizon decision-making.
我们提出了 PlugMem,一种任务无关的插件式记忆模块,它将智能体经验组织成以知识为中心的表示,使与决策相关的记忆能够在多种智能体任务中被有效检索。 通过广泛实验,我们证明,在统一的效用-成本评估框架下,PlugMem 能持续提升最终任务性能,同时降低智能体侧记忆成本。 除独立使用外,PlugMem 还可作为通用记忆骨干,并通过加入任务特定启发式方法进一步增强;任务适配实验也显示出额外增益。 总体而言,这些结果将 PlugMem 定位为 LLM 智能体中可迁移、高效记忆的原则性基础,并指向面向长程决策的更通用、更可扩展记忆系统。