memory-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemory Setup Skill
记忆设置技能
Transform your agent from goldfish to elephant. This skill helps configure persistent memory for Moltbot/Clawdbot.
将你的Agent从只有7秒记忆的金鱼变成过目不忘的大象,该技能可帮助你为Moltbot/Clawdbot配置持久化记忆。
Quick Setup
快速设置
1. Enable Memory Search in Config
1. 在配置文件中启用记忆搜索
Add to (or ):
~/.clawdbot/clawdbot.jsonmoltbot.jsonjson
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}添加以下配置到(或)中:
~/.clawdbot/clawdbot.jsonmoltbot.jsonjson
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}2. Create Memory Structure
2. 创建记忆目录结构
In your workspace, create:
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在你的工作区中创建如下目录结构:
workspace/
├── MEMORY.md # 长期维护的记忆文件
└── memory/
├── logs/ # 日常日志(命名格式为YYYY-MM-DD.md)
├── projects/ # 项目专属上下文
├── groups/ # 群组聊天上下文
└── system/ # 偏好设置、安装记录3. Initialize MEMORY.md
3. 初始化MEMORY.md
Create in workspace root:
MEMORY.mdmarkdown
undefined在工作区根目录创建文件:
MEMORY.mdmarkdown
undefinedMEMORY.md — Long-Term Memory
MEMORY.md — 长期记忆
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
undefined- 沟通风格
- 工具和工作流偏好
undefinedConfig Options Explained
配置选项说明
| Setting | Purpose | Recommended |
|---|---|---|
| Turn on memory search | |
| Embedding provider | |
| What to index | |
| When to index | |
| Relevance threshold | |
| Max snippets returned | |
| 设置项 | 用途 | 推荐值 |
|---|---|---|
| 开启记忆搜索 | |
| 嵌入模型提供商 | |
| 要索引的内容来源 | |
| 索引时机 | |
| 相关性阈值 | |
| 返回的最大片段数 | |
Provider Options
提供商可选值
- — Voyage AI embeddings (recommended)
voyage - — OpenAI embeddings
openai - — Local embeddings (no API needed)
local
- — Voyage AI嵌入模型(推荐)
voyage - — OpenAI嵌入模型
openai - — 本地嵌入模型(无需API密钥)
local
Source Options
来源可选值
- — MEMORY.md + memory/*.md files
memory - — Past conversation transcripts
sessions - — Full context (recommended)
both
- — MEMORY.md + memory目录下所有.md文件
memory - — 过往对话记录
sessions - — 全部上下文(推荐)
both
Daily Log Format
日常日志格式
Create daily:
memory/logs/YYYY-MM-DD.mdmarkdown
undefined每日创建文件,格式如下:
memory/logs/YYYY-MM-DD.mdmarkdown
undefinedYYYY-MM-DD — Daily Log
YYYY-MM-DD — 日常日志
[Time] — [Event/Task]
[时间] — [事件/任务]
- What happened
- Decisions made
- Follow-ups needed
- 发生的内容
- 做出的决策
- 需要跟进的事项
[Time] — [Another Event]
[时间] — [其他事件]
- Details
undefined- 详情
undefinedAgent Instructions (AGENTS.md)
Agent使用说明(AGENTS.md)
Add to your AGENTS.md for agent behavior:
markdown
undefined添加以下内容到AGENTS.md中定义Agent行为:
markdown
undefinedMemory Recall
记忆召回
Before answering questions about prior work, decisions, dates, people, preferences, or todos:
- Run memory_search with relevant query
- Use memory_get to pull specific lines if needed
- If low confidence after search, say you checked
undefined在回答关于过往工作、决策、日期、人物、偏好或待办的问题前:
- 使用相关关键词运行memory_search
- 必要时使用memory_get拉取特定行内容
- 如果搜索后置信度较低,告知用户你已经查询过记忆库
undefinedTroubleshooting
故障排查
Memory search not working?
记忆搜索不工作?
- Check in config
memorySearch.enabled: true - Verify MEMORY.md exists in workspace root
- Restart gateway:
clawdbot gateway restart
- 检查配置中是否设置正确
memorySearch.enabled: true - 确认工作区根目录存在MEMORY.md文件
- 重启网关:
clawdbot gateway restart
Results not relevant?
搜索结果不相关?
- Lower to
minScorefor more results0.2 - Increase to
maxResults30 - Check that memory files have meaningful content
- 将调低到
minScore获取更多结果0.2 - 将调高到
maxResults30 - 检查记忆文件内容是否有实际意义
Provider errors?
提供商报错?
- Voyage: Set in environment
VOYAGE_API_KEY - OpenAI: Set in environment
OPENAI_API_KEY - Use provider if no API keys available
local
- Voyage:在环境变量中设置
VOYAGE_API_KEY - OpenAI:在环境变量中设置
OPENAI_API_KEY - 如果没有API密钥,可以使用提供商
local
Verification
验证
Test memory is working:
User: "What do you remember about [past topic]?"
Agent: [Should search memory and return relevant context]If agent has no memory, config isn't applied. Restart gateway.
测试记忆功能是否正常工作:
用户:「你记得[过往话题]的相关内容吗?」
Agent:[应该搜索记忆库并返回相关上下文]如果Agent没有相关记忆,说明配置未生效,请重启网关。
Full Config Example
完整配置示例
json
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
},
"workspace": "/path/to/your/workspace"
}json
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
},
"workspace": "/path/to/your/workspace"
}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. 🐘
没有记忆的情况下:
- Agent在会话之间会遗忘所有内容
- 重复提问,丢失上下文
- 项目推进没有连续性
有记忆的情况下:
- 可以回忆过往对话内容
- 了解你的使用偏好
- 跟踪项目历史进度
- 长期构建使用关联
金鱼→大象。🐘