Large Language Model (LLM) has exhibited strong reasoning ability in text-based contexts across various domains, yet the limitation of context window poses challenges for the model on long-range inference tasks and necessitates a memory storage system. While many current storage approaches have been proposed with episodic notes and graph representations of memory, retrieval methods still primarily rely on predefined workflows or static similarity top-k over embeddings. To address this inflexibility, we introduced a novel tool-augmented autonomous memory retrieval framework (TA-Mem), which contains: (1) a memory extraction LLM agent which is prompted to adaptively chuck an input into sub-context based on semantic correlation, and extract information into structured notes, (2) a multi-indexed memory database designed for different types of query methods including both key-based lookup and similarity-based retrieval, (3) a tool-augmented memory retrieval agent which explores the memory autonomously by selecting appropriate tools provided by the database based on the user input, and decides whether to proceed to the next iteration or finalizing the response after reasoning on the fetched memories. The TA-Mem is evaluated on the LoCoMo dataset, achieving significant performance improvements over existing baseline approaches. In addition, an analysis of tool use across different question types also demonstrates the adaptivity of the proposed method.
翻译:大语言模型(LLM)已在多个领域的文本语境中展现出强大的推理能力,然而上下文窗口的限制使其在长程推理任务上面临挑战,因此需要记忆存储系统。尽管当前已提出多种采用情景化笔记和图表示的记忆存储方法,但其检索方式仍主要依赖于预定义的工作流程或基于嵌入向量的静态相似度top-k检索。为解决这种灵活性不足的问题,我们提出了一种新颖的工具增强自主记忆检索框架(TA-Mem),该框架包含:(1)记忆提取LLM智能体,通过提示使其能够根据语义相关性将输入自适应地切分为子上下文,并将信息提取为结构化笔记;(2)为多种查询方式(包括基于键的查找和基于相似度的检索)设计的多索引记忆数据库;(3)工具增强记忆检索智能体,该智能体能够根据用户输入自主选择数据库提供的适当工具进行记忆探索,并在对获取的记忆进行推理后决定是否进入下一轮迭代或生成最终响应。我们在LoCoMo数据集上对TA-Mem进行了评估,其性能较现有基线方法有显著提升。此外,针对不同问题类型的工具使用分析也验证了所提方法的自适应性。