Memory Setup Skill
Transform your agent from goldfish to elephant. This skill helps configure persistent memory for Moltbot/Clawdbot.
Quick Setup
1. Enable Memory Search in Config
Add to ~/.clawdbot/clawdbot.json (or moltbot.json):
CODEBLOCK0
2. Create Memory Structure
In your workspace, create:
CODEBLOCK1
3. Initialize MEMORY.md
Create MEMORY.md in workspace root:
CODEBLOCK2
Config Options Explained
| Setting | Purpose | Recommended |
|---|
| INLINECODE3 | Turn on memory search | INLINECODE4 |
| INLINECODE5 |
Embedding provider |
"voyage" |
|
sources | What to index |
["memory", "sessions"] |
|
indexMode | When to index |
"hot" (real-time) |
|
minScore | Relevance threshold |
0.3 (lower = more results) |
|
maxResults | Max snippets returned |
20 |
Provider Options
- -
voyage — Voyage AI embeddings (recommended) - INLINECODE16 — OpenAI embeddings
- INLINECODE17 — Local embeddings (no API needed)
Source Options
- -
memory — MEMORY.md + memory/*.md files - INLINECODE19 — Past conversation transcripts
- INLINECODE20 — Full context (recommended)
Daily Log Format
Create memory/logs/YYYY-MM-DD.md daily:
CODEBLOCK3
Agent Instructions (AGENTS.md)
Add to your AGENTS.md for agent behavior:
CODEBLOCK4
Troubleshooting
Memory search not working?
- 1. Check
memorySearch.enabled: true in config - Verify MEMORY.md exists in workspace root
- Restart gateway: INLINECODE23
Results not relevant?
- - Lower
minScore to 0.2 for more results - Increase
maxResults to INLINECODE27 - Check that memory files have meaningful content
Provider errors?
- - Voyage: Set
VOYAGE_API_KEY in environment - OpenAI: Set
OPENAI_API_KEY in environment - Use
local provider if no API keys available
Verification
Test memory is working:
CODEBLOCK5
If agent has no memory, config isn't applied. Restart gateway.
Full Config Example
CODEBLOCK6
Why This Matters
Without memory:
- - Agent forgets everything between sessions
- Repeats questions, loses context
- No continuity on projects
With memory:
- - Recalls past conversations
- Knows your preferences
- Tracks project history
- Builds relationship over time
Goldfish → Elephant. 🐘
记忆设置技能
将您的智能体从金鱼变成大象。本技能帮助为Moltbot/Clawdbot配置持久化记忆。
快速设置
1. 在配置中启用记忆搜索
添加到 ~/.clawdbot/clawdbot.json(或 moltbot.json):
json
{
memorySearch: {
enabled: true,
provider: voyage,
sources: [memory, sessions],
indexMode: hot,
minScore: 0.3,
maxResults: 20
}
}
2. 创建记忆结构
在工作区中创建:
workspace/
├── MEMORY.md # 长期策划记忆
└── memory/
├── logs/ # 每日日志(YYYY-MM-DD.md)
├── projects/ # 项目特定上下文
├── groups/ # 群聊上下文
└── system/ # 偏好设置、配置笔记
3. 初始化MEMORY.md
在工作区根目录创建 MEMORY.md:
markdown
MEMORY.md — 长期记忆
关于[用户名]
活跃项目
决策与经验
偏好设置
配置选项说明
| 设置项 | 用途 | 推荐值 |
|---|
| 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:
markdown
YYYY-MM-DD — 每日日志
[时间] — [事件/任务]
[时间] — [另一个事件]
智能体指令(AGENTS.md)
添加到AGENTS.md以控制智能体行为:
markdown
记忆召回
在回答关于先前工作、决策、日期、人物、偏好或待办事项的问题前:
- 1. 使用相关查询运行memorysearch
- 必要时使用memoryget提取特定行
- 如果搜索后信心不足,说明已检查过
故障排除
记忆搜索不工作?
- 1. 检查配置中 memorySearch.enabled: true
- 确认工作区根目录存在MEMORY.md
- 重启网关:clawdbot gateway restart
结果不相关?
- - 将 minScore 降低至 0.2 以获取更多结果
- 将 maxResults 增加至 30
- 检查记忆文件是否包含有意义的内容
提供方错误?
- - Voyage:在环境中设置 VOYAGEAPIKEY
- OpenAI:在环境中设置 OPENAIAPIKEY
- 如果没有API密钥,使用 local 提供方
验证
测试记忆是否正常工作:
用户:关于[过去的话题]你还记得什么?
智能体:[应搜索记忆并返回相关上下文]
如果智能体没有记忆,说明配置未生效。重启网关。
完整配置示例
json
{
memorySearch: {
enabled: true,
provider: voyage,
sources: [memory, sessions],
indexMode: hot,
minScore: 0.3,
maxResults: 20
},
workspace: /path/to/your/workspace
}
为什么这很重要
没有记忆:
- - 智能体会在会话间忘记一切
- 重复提问,丢失上下文
- 项目没有连续性
拥有记忆:
- - 回忆过往对话
- 了解您的偏好
- 追踪项目历史
- 随时间建立关系
金鱼 → 大象。🐘