Files
nexus/wiki/concepts/双层记忆架构.md

37 lines
1.4 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: "双层记忆架构"
type: concept
tags: [openclaw, memory, agent, long-term, short-term]
last_updated: 2026-04-15
---
## Definition
OpenClaw Agent 的记忆体系,由短期记忆层、长期记忆层和 self-improving 层三层构成,各司其职实现上下文连续性和持续进化。
## 三层架构
### 短期记忆层
- 媒介memory/YYYY-MM-DD.md 每日文件
- 职责:保存当天对话记录、操作、遇到的问题、未完成事项
- 触发:每次 Session 启动时检查并创建当天文件(修复无对话日记忆断层问题)
### 长期记忆层
- 媒介memory-lancedb-pro基于 LanceDB 的向量数据库)
- 职责:重要的决策、用户偏好、反复使用的流程,通过语义搜索找回
- 机制hybrid retrieval向量 + BM25Weibull 衰减
### Self-Improving 层
- 媒介LEARNINGS.md / ERRORS.md
- 职责每次踩坑都记录Pattern-Key 追踪重复Recurrence-Count 量化系统性
- 触发:每日 23:00 定时复盘
## 分工原则
- 每日文件:管上下文(接上昨天的工作)
- 向量数据库:管知识(语义搜索)
- self-improving管成长错误不重复
## Connections
- [[Self-Improving Skill]] ← 成长层 ← [[双层记忆架构]]
- [[memory-lancedb-pro]] ← 长期层 ← [[双层记忆架构]]
- [[记忆断层]] ← 问题 ← [[双层记忆架构]]