关于 memory-setup
memory-setup 是为 Moltbot/Clawdbot 配置持久记忆的技能,面向需要跨会话保留上下文的 Agent 使用者。它说明如何设置记忆搜索、索引来源、记忆文件结构及检索指引。
主要功能
- 01配置记忆搜索参数
- 02选择记忆和会话索引来源
- 03规划长期记忆与日志目录
- 04设置嵌入提供方
- 05提供记忆检索指引
适用场景
- 01让 Agent 回忆过往对话
- 02查找项目决策和进展
- 03保存偏好与待办事项
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ sundial-org/ awesome-openclaw-skills --skill memory-setup安装后在 Claude Code 中输入/memory-setup确认已加载。
详细介绍
记忆设置技能
让你的 Agent 从金鱼变成大象。此技能可帮助为 Moltbot/Clawdbot 配置持久记忆。
快速设置
1. 在配置中启用记忆搜索
添加到 ~/.clawdbot/clawdbot.json(或 moltbot.json):
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}
2. 创建记忆结构
在工作区中创建:
workspace/
├── MEMORY.md # Long-term curated memory
└── memory/
├── logs/ # Daily logs (YYYY-MM-DD.md)
├── projects/ # Project-specific context
├── groups/ # Group chat context
└── system/ # Preferences, setup notes
3. 初始化 MEMORY.md
在工作区根目录中创建 MEMORY.md:
# MEMORY.md — Long-Term Memory
## About [User Name]
- Key facts, preferences, context
## Active Projects
- Project summaries and status
## Decisions & Lessons
- Important choices made
- Lessons learned
## Preferences
- Communication style
- Tools and workflows
配置选项说明
| 设置 | 用途 | 建议值 |
|---|---|---|
enabled | 启用记忆搜索 | true |
provider | 嵌入提供方 | "voyage" |
sources | 索引内容 | ["memory", "sessions"] |
indexMode | 索引时机 | "hot"(实时) |
minScore | 相关性阈值 | 0.3(数值越低,结果越多) |
maxResults | 返回的片段数上限 | 20 |
提供方选项
voyage— Voyage AI 嵌入(推荐)openai— OpenAI 嵌入local— 本地嵌入(无需 API)
来源选项
memory— MEMORY.md + memory/*.md 文件sessions— 过去的对话记录both— 完整上下文(推荐)
每日日志格式
每天创建 memory/logs/YYYY-MM-DD.md:
# YYYY-MM-DD — Daily Log
## [Time] — [Event/Task]
- What happened
- Decisions made
- Follow-ups needed
## [Time] — [Another Event]
- Details
Agent 指令(AGENTS.md)
在 AGENTS.md 中添加以下内容以设置 Agent 行为:
## Memory Recall
Before answering questions about prior work, decisions, dates, people, preferences, or todos:
1. Run memory_search with relevant query
2. Use memory_get to pull specific lines if needed
3. If low confidence after search, say you checked
故障排除
记忆搜索无法使用?
- 检查配置中的
memorySearch.enabled: true - 确认工作区根目录中存在 MEMORY.md
- 重启网关:
clawdbot gateway restart
结果不相关?
- 将
minScore降至0.2,以获取更多结果 - 将
maxResults提高至30 - 检查记忆文件是否包含有意义的内容
提供方错误?
- Voyage:在环境中设置
VOYAGE_API_KEY - OpenAI:在环境中设置
OPENAI_API_KEY - 如果没有可用的 API 密钥,请使用
local提供方
验证
测试记忆是否正常工作:
User: "What do you remember about [past topic]?"
Agent: [Should search memory and return relevant context]
如果 Agent 没有记忆,说明配置未生效。请重启网关。
完整配置示例
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
},
"workspace": "/path/to/your/workspace"
}
为什么这很重要
没有记忆:
- Agent 会忘记不同会话之间的所有内容
- 重复提问,丢失上下文
- 无法持续跟进项目
有了记忆:
- 回忆过往对话
- 了解你的偏好
- 跟踪项目历史
- 随时间建立关系
金鱼 → 大象。🐘
评论
支持 Markdown