Files
Memoh/assets/zh_getting-started_memory.md.DwSkbf1D.js
T
2026-04-24 06:37:27 +00:00

2 lines
5.6 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as r,o as a,c as o,ag as e}from"./chunks/framework.CAXxHpAX.js";const c=JSON.parse('{"title":"长期记忆","description":"","frontmatter":{},"headers":[],"relativePath":"zh/getting-started/memory.md","filePath":"zh/getting-started/memory.md","lastUpdated":1777012567000}'),n={name:"zh/getting-started/memory.md"};function s(i,t,l,h,d,g){return a(),o("div",null,[...t[0]||(t[0]=[e('<h1 id="长期记忆" tabindex="-1">长期记忆 <a class="header-anchor" href="#长期记忆" aria-label="Permalink to &quot;长期记忆&quot;"></a></h1><p>Memoh 的结构化长期记忆让机器人在<strong>多路会话</strong>里也能用上以前留下的事实。用 <strong>Memory</strong> tab 前,先给机器人配好 <strong>Memory Provider</strong>。</p><h2 id="先决条件" tabindex="-1">先决条件 <a class="header-anchor" href="#先决条件" aria-label="Permalink to &quot;先决条件&quot;"></a></h2><ol><li>在 <a href="/zh/memory-providers/">记忆提供方</a> 里建一个(内置、Mem0、OpenViking 等)。</li><li>打开机器人 <strong>General</strong>。</li><li><strong>Memory Provider</strong> 里选中。</li><li>保存。</li></ol><p>没选提供方,就没有正在使用的记忆后端。</p><hr><h2 id="在做什么" tabindex="-1">在做什么 <a class="header-anchor" href="#在做什么" aria-label="Permalink to &quot;在做什么&quot;"></a></h2><p>记忆条目的存、取、搜都由当前提供方实现;按类型和模式,可能是文件索引、稀疏向量、稠密向量、或外接 API。用户发消息时,Memoh 会尝试取出相关记忆塞进当次上下文。</p><p>本页说 <strong>长期记忆</strong><strong>会话写太长</strong> 要压短,是另一件事,见 <a href="/zh/getting-started/compaction.html">会话上下文压缩</a>。</p><hr><h2 id="在界面里" tabindex="-1">在界面里 <a class="header-anchor" href="#在界面里" aria-label="Permalink to &quot;在界面里&quot;"></a></h2><h3 id="建记忆" tabindex="-1">建记忆 <a class="header-anchor" href="#建记忆" aria-label="Permalink to &quot;建记忆&quot;"></a></h3><ul><li><strong>New Memory</strong>:手打一条。</li><li><strong>From Conversation</strong>:从已有对话里抽成记忆。</li></ul><h3 id="搜与管理" tabindex="-1">搜与管理 <a class="header-anchor" href="#搜与管理" aria-label="Permalink to &quot;搜与管理&quot;"></a></h3><ul><li><strong>Search</strong>:按 id 或文字筛。</li><li><strong>Edit</strong>:改内容。</li><li><strong>Delete</strong>:不要就删。</li></ul><hr><h2 id="记忆压缩-注意-不是会话压缩" tabindex="-1">记忆压缩(注意:不是会话压缩) <a class="header-anchor" href="#记忆压缩-注意-不是会话压缩" aria-label="Permalink to &quot;记忆压缩(注意:不是会话压缩)&quot;"></a></h2><p>积累多了可以在 <strong>Memory</strong> tab 对<strong>存储侧</strong>做 <strong>Compact</strong>:合并重复、去陈旧、压噪声。有 <strong>Ratio</strong>、<strong>Decay Days</strong> 等参数。</p><p>这和 <a href="/zh/getting-started/compaction.html">会话上下文压缩</a> 不同:后者是<strong>单路会话</strong>里把 prompt 压短,不改库里长期记忆条目的存法与合并结果。</p><hr><h2 id="rebuild" tabindex="-1">Rebuild <a class="header-anchor" href="#rebuild" aria-label="Permalink to &quot;Rebuild&quot;"></a></h2><p><strong>Rebuild</strong> 会按当前设置<strong>整库重索引</strong>。换模式、索引乱了、想全量用新设置跑一遍时有用。页面上可跟进度。</p><hr><h2 id="状态" tabindex="-1">状态 <a class="header-anchor" href="#状态" aria-label="Permalink to &quot;状态&quot;"></a></h2><p><strong>Memory</strong> tab 会显示当前该机器人的记忆后端的 <strong>Connected / Error</strong>,排障时先看一眼。</p><hr><h2 id="用量" tabindex="-1">用量 <a class="header-anchor" href="#用量" aria-label="Permalink to &quot;用量&quot;"></a></h2><p>可看 <strong>总条数</strong>、<strong>索引是否跟上</strong> 等,心里有数再调策略。</p><hr><h2 id="和「会话里那段对话」的对比" tabindex="-1">和「会话里那段对话」的对比 <a class="header-anchor" href="#和「会话里那段对话」的对比" aria-label="Permalink to &quot;和「会话里那段对话」的对比&quot;"></a></h2><table tabindex="0"><thead><tr><th>概念</th><th>作用范围</th><th>在哪动</th><th>改变什么</th></tr></thead><tbody><tr><td><strong>记忆压缩</strong></td><td>长期记忆提供方</td><td>Memory tab</td><td>改存储里条目怎么合并/精简</td></tr><tr><td><strong>上下文压缩</strong></td><td>当前这一路会话</td><td>状态区或 <code>/compact</code></td><td>用摘要把<strong>本会话</strong>历史变短,给后面轮次用</td></tr></tbody></table><p>要减「跨会话噪声」、整理记忆库 → 用 <strong>记忆压缩</strong>。<br> 要减「这一路聊太长了」→ 用 <a href="/zh/getting-started/compaction.html">会话上下文压缩</a>。</p><hr><h2 id="和机器人的关系" tabindex="-1">和机器人的关系 <a class="header-anchor" href="#和机器人的关系" aria-label="Permalink to &quot;和机器人的关系&quot;"></a></h2><ul><li>聊的时候会按配置去搜记忆。</li><li>具体用哪种后端、什么模式、embedding 等,在<strong>提供方</strong>上配,见 <a href="/zh/memory-providers/">记忆提供方</a>。</li><li>长期记忆是机器人「个性与事实」里很大一块来源。</li></ul>',35)])])}const p=r(n,[["render",s]]);export{c as __pageData,p as default};