链载Ai

标题: AI Agent 记忆技术浅析 [打印本页]

作者: 链载Ai    时间: 昨天 12:42
标题: AI Agent 记忆技术浅析

ingFang SC", "Microsoft YaHei", sans-serif;font-weight: bold;line-height: 1.5;padding-top: 10px;color: rgb(85, 85, 85);font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">什么是Agent记忆?

ingFang SC", "Microsoft YaHei", sans-serif;font-size: 18px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">Agent记忆(Agent Memory)是指AI Agent在执行任务过程中存储和管理信息的能力和机制。它类似于人类的记忆系统,使Agent能够记住过去的交互、经验和知识,并在后续任务中利用这些信息做出更好的决策。这种记忆机制对于实现持续学习和处理长期任务至关重要。

ingFang SC", "Microsoft YaHei", sans-serif;font-weight: bold;line-height: 1.5;padding-top: 10px;color: rgb(85, 85, 85);font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">什么Agent需要记忆?

ingFang SC", "Microsoft YaHei", sans-serif;font-size: 18px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">从技术角度来看,Agent的记忆本质上是对大模型有限上下文的一种扩展。在Agent的生命周期中,用户或Agent会生成大量数据,而AI大模型能够处理的上下文是有限的,通常为16K到2M tokens。这意味着,仅凭AI自身的上下文处理能力,无法直接处理如此庞大的数据量。

ingFang SC", "Microsoft YaHei", sans-serif;font-size: 18px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">从产品角度看,Agent记忆能够实现个性化交互、保持上下文连贯性,最重要的是有效降低运营成本。

ingFang SC", "Microsoft YaHei", sans-serif;font-weight: bold;line-height: 1.5;padding-top: 10px;color: rgb(85, 85, 85);font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">RAG与记忆的区别

ingFang SC", "Microsoft YaHei", sans-serif;font-size: 18px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">严格来说,记忆是RAG(Retrieval-Augmented Generation,检索增强生成)的一个子集,二者都从外部提取信息并融入到LLM(大语言模型)生成的提示中,但它们的应用场景和目标有所不同。核心区别在于:RAG侧重于知识为中心,而记忆侧重于以用户信息为中心。

ingFang SC", "Microsoft YaHei", sans-serif;font-weight: bold;line-height: 1.5;padding-top: 10px;color: rgb(85, 85, 85);font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">常见的Agent记忆机制对比

ingFang SC", "Microsoft YaHei", sans-serif;font-size: 18px;font-style: normal;font-variant-ligatures: normal;font-variant-caps: normal;font-weight: 400;letter-spacing: normal;orphans: 2;text-align: justify;text-indent: 0px;text-transform: none;widows: 2;word-spacing: 0px;-webkit-text-stroke-width: 0px;white-space: normal;background-color: rgb(255, 255, 255);text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial;">以下是目前最主流的几种记忆设计机制的对比(图片来公众号坚白Gustavo):

下面是一个具体的例子,帮助大家理解这几种记忆机制的区别:






欢迎光临 链载Ai (https://www.lianzai.com/) Powered by Discuz! X3.5