Files
nexus/wiki/concepts/Memory-目录.md
2026-04-17 09:34:39 +08:00

43 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
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.
---
title: "Memory 目录"
type: concept
tags: [OpenClaw, Agent, 长期记忆]
---
## 定义
Memory 目录是 OpenClaw workspace 中的长期记忆存储机制,按日期滚动存储 Agent 与用户的对话中积累的重要信息。
## 职责
- 解决 LLM 对话无状态问题(每次新会话什么都不记得)
- 存储用户偏好、工作背景、项目经验等持续信息
- 支持 Agent 在多个会话之间积累理解
## 运作机制
```
对话发生
Agent 通过普通文件工具把重要信息写入 `memory/` 或 `MEMORY.md`
下次对话开始
Agent 通过 `memory_search` / `memory_get` 检索相关记忆
相关记忆被注入到当前对话的上下文里
Agent 表现出"我记得你说过……"的能力
```
## 记忆方案
- **builtin**:默认方案,原始记忆是 Markdown 文件,系统维护本地索引
- **qmd**:底层围着 Markdown 文件转,换了一套更强的检索/索引方式
## 关键点
对 Agent 来说,真正算数的长期记忆,是 workspace 里那些 Markdown 文件,不是什么看不见摸不着的黑盒数据库。
## 来源
- [[万字讲透OpenClaw🦞从"能用"到"真好用"的分水岭Workspace 深度解析]]
## 相关
- [[Workspace]]:包含 memory/ 目录的工作台目录
- [[SOUL.md]]:配合 memory/ 实现个性化
- [[USER.md]]:配合 memory/ 固化用户偏好