Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

OpenClaw 的跨会话记忆不是藏在模型里的隐藏状态,而是写进工作区的 Markdown 文件,再经过索引检索和长期整理被重新带回上下文。模型下次能用到什么,取决于有什么被写下来,以及这些内容有没有被载入或检索到。

需要先说明一点:官方架构文档描述的是五个功能层级,并没有“三层架构”这个官方术语。本文标题里的“三层”是为了便于理解所做的编辑归纳,后文会说明它与官方模型怎样对应、哪里对不上。

记忆到底存在哪里

OpenClaw 概览文档指出,记忆以普通 Markdown 文件的形式保存在 agent 工作区,默认工作区是 ~/.openclaw/workspace。文档的核心提醒是:模型只会“记得”被写到磁盘上的内容。想确认某件事是否留存,最可靠的做法是直接打开记忆文件查看。

工作区里与记忆相关的文件有三类:

  • USER.md:可选,保存用户偏好和个人背景。它不会自动创建。
  • MEMORY.md:保存整理后的长期事实与决定。
  • memory/YYYY-MM-DD.md:按日期保存工作过程中的详细记录和观察,供检索使用,不会每次会话整体载入。

官方的五层模型与“三层”归纳

官方架构文档划分的层级是:指令层、整理后的核心记忆、情节记录、未来意图,以及供人检查的 review 材料。这比三层更细。为了让读者抓住主要流程,可以把它们归并成下面三组。这是解释性分组,不是一一对应的官方映射。

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
归纳后的层 包含什么 作用
核心层 USER.md、MEMORY.md 承载用户模型和整理后的长期事实,会话启动时按预算载入
记录层 每日记忆文件,以及可选的会话记录 保存较细的经历与上下文,需要时再搜索
检索与整理层 SQLite 索引、关键词/向量检索、压缩前 flush、dreaming 负责找回内容、争取保存机会和整理,本身不是被保存的内容

三分法漏掉了两个官方层级:指令层和 review 材料。未来意图(prospective intents)也容易被误读。它表达的是“触发条件满足时要执行什么”,不是“记住一条事实”。如果你想让 agent 在某个时机做某事,那属于意图,不属于 MEMORY.md 里的事实。

内容怎样被写入和整理

日常记录

工作中的观察和细节先进入按日期命名的情节记录。它们体量可以较大,因为不会整体注入上下文,只在检索命中时才出现。

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

压缩前的 memory flush

长对话被压缩之前,系统可以运行一次 silent turn,提醒 agent 把重要内容写进记忆文件。这是一次保存机会,不是完整性保证:最终保留什么,仍取决于 agent 在这一轮写了什么。

dreaming:筛选与长期提升

官方把 dreaming 描述为对候选记录进行筛选,并把符合条件的内容整理进 MEMORY.md 或 USER.md。架构文档强调来源信息和提升门控:不可信或系统来源的材料不会进入其所述的长期提升路径,不会仅因为被写进记录就变成可信的长期事实。官方还提到,记忆步骤失败时应降级处理,而不是阻断回复。

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

这套机制能降低重要上下文随会话结束或压缩而丢失的风险。它不能保证模型记录了所有内容,也不能保证每次检索都命中正确的片段。

索引与搜索如何工作

默认的 Memory Core 会索引 MEMORY.md、已存在的根目录 USER.md 和 memory/*.md。它把内容切成块,文档给出的默认参数是 400 tokens 一块、重叠 80 tokens,然后写入每个 agent 专属的 SQLite 数据库。

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

搜索可以综合关键词匹配、向量相关性、近期性和重要性。向量部分需要可用的 embedding 配置。如果 embedding 不可用,文档所述的关键词搜索回退能保留一部分检索能力,但结果不等同于语义向量检索。

embedding provider 怎么选

文档列出的 provider 类型包括 OpenAI、Ollama、LM Studio 和 local,涵盖托管与本地/自托管两类。它们是可配置的选项,文档并没有把其中任何一种定为唯一推荐。可以从三个角度比较:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
比较角度 需要问的问题
运行位置与数据边界 embedding 是发送到托管服务,还是在本机或自托管环境里运行?具体隐私边界要看所用 provider 的设置和政策。
配置与凭据 托管服务是否需要密钥?本地方案是否需要额外安装和模型文件?它们都是需要配置的选项,不是零配置。
语义检索可用性 embedding 失效时是否接受只剩关键词搜索?

价格、速度和隐私承诺,不能从 provider 的名字推断,需要按各家的实际条款核实。

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

使用边界:核心记忆也有预算

MEMORY.md 写得太长时,磁盘上的原文件不会受影响,但注入上下文的副本可能因超出 bootstrap 文件预算而被截断。应对办法有三个:

  • 把细节移到每日记录里。
  • 在核心文件中只保留简短摘要。
  • 检查当前上下文状态,并以你所用版本的文档为准。

跨会话“失忆”的排查顺序

下面的顺序是根据文档里的机制推导出来的,不是 OpenClaw 官方给出的完整诊断流程。

  1. 确认内容是否真的写进了文件。打开工作区里的 MEMORY.md 和 memory/ 下的当日文件,查找相关内容。没写入就谈不上持久记忆。
  2. 确认文件处在载入或检索路径上。检查文件位置和命名是否符合 MEMORY.md、根目录 USER.md、memory/*.md 的约定。
  3. 检查索引和 embedding 配置。语义搜索不命中时,确认 provider 是否可用;不可用时,系统可能只在做关键词匹配。
  4. 检查核心记忆的上下文预算。如果 MEMORY.md 很长,载入的副本可能已被截断,需要精简或下沉细节。

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.