记忆
记忆类型
短期记忆
当前会话中的上下文信息
长期记忆
持久化存储的知识和偏好
配置
yaml
memory:
# 短期记忆配置
short_term:
max_entries: 100
ttl: 3600 # 1小时
# 长期记忆配置
long_term:
enabled: true
storage: sqlite
path: ~/.moltbot/memory.db
# 记忆压缩
compaction:
enabled: true
interval: 86400 # 每天
threshold: 1000 # 1000条后压缩使用记忆
bash
# 存储记忆
/clawd 记住我的邮箱是 user@example.com
# 查询记忆
/clawd 我的邮箱是什么?
# 列出所有记忆
/memory list
# 清除记忆
/memory clear记忆格式
json
{
"key": "user_email",
"value": "user@example.com",
"type": "preference",
"created_at": "2026-01-28T10:00:00Z",
"updated_at": "2026-01-28T10:00:00Z"
}