记忆设置:为 AI 智能体启用持久上下文 - Openclaw Skills
什么是 记忆设置技能?
记忆设置技能是一个全面的配置框架,旨在消除 AI 驱动的开发工作流中的上下文丢失。通过利用 Openclaw Skills,开发者可以将他们的智能体从无状态的参与者转变为具备上下文感知能力的助手,能够跨多个会话记住过去的决策、项目历史和特定的用户偏好。
该技能建立了一个结构化的环境,使用语义搜索来存储和检索信息。它与嵌入提供商集成,对每日日志、会话转录和精选的长期记忆文件进行索引。这确保了智能体能够主动召回相关的技术细节,减少重复提问并提高复杂软件项目的连续性。
下载入口:https://github.com/openclaw/skills/tree/main/skills/jrbobbyhansen-pixel/memory-setup安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install memory-setup
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
<project>/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 memory-setup。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
记忆设置技能 应用场景
- 在跨越数周的长期软件工程项目中保持连续性。
- 检索过去编码会话中的特定架构决策或经验教训。
- 管理个性化的开发者偏好,包括编码风格和特定的工具配置。
- 自动索引每日日志以跟踪进度和待处理的后续任务。
- 在统一的工作区内为多智能体工作流创建共享知识库。
- 在全局设置中定义配置,以启用记忆搜索引擎并选择嵌入提供商。
- 在工作区中初始化专用的目录结构,以区分日志、项目上下文和系统偏好。
- 创建一个核心的 MEMORY.md 文件,作为高级项目事实和用户上下文的主要信任源。
- 智能体使用记忆搜索功能对索引的 Markdown 文件执行基于向量的查询。
- 根据检索到的片段的语义相关性,将上下文动态注入到对话中。
记忆设置技能 配置指南
要通过 Openclaw Skills 启用持久上下文,请将以下配置添加到您的 ~/.clawdbot/clawdbot.json 或 moltbot.json 文件中:
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}
使用以下命令初始化您的工作区目录结构:
mkdir -p memory/logs memory/projects memory/groups memory/system
touch MEMORY.md
最后,确保在您的环境中导出或在智能体的秘密管理中添加 Voyage AI 或 OpenAI 等提供商的 API 密钥。
记忆设置技能 数据架构与分类体系
该技能利用分层 Markdown 模式来组织和索引信息,以便高效检索。
| 数据组件 | 位置 | 内容类型 |
|---|---|---|
| 长期记忆 | /MEMORY.md |
精选事实、项目摘要和决策 |
| 每日活动 | /memory/logs/ |
记录每日任务的日期标记日志 (YYYY-MM-DD.md) |
| 项目上下文 | /memory/projects/ |
详细的技术文档和特定于项目的笔记 |
| 用户偏好 | /memory/system/ |
开发环境设置和沟通风格 |
| 会话历史 | /sessions/ |
自动生成的对话转录 |
name: memory-setup
description: Enable and configure Moltbot/Clawdbot memory search for persistent context. Use when setting up memory, fixing "goldfish brain," or helping users configure memorySearch in their config. Covers MEMORY.md, daily logs, and vector search setup.
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):
{
"memorySearch": {
"enabled": true,
"provider": "voyage",
"sources": ["memory", "sessions"],
"indexMode": "hot",
"minScore": 0.3,
"maxResults": 20
}
}
2. Create Memory Structure
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
3. Initialize MEMORY.md
Create MEMORY.md in workspace root:
# 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
Config Options Explained
| Setting | Purpose | Recommended |
|---|---|---|
enabled |
Turn on memory search | true |
provider |
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)openai— OpenAI embeddingslocal— Local embeddings (no API needed)
Source Options
memory— MEMORY.md + memory/*.md filessessions— Past conversation transcriptsboth— Full context (recommended)
Daily Log Format
Create memory/logs/YYYY-MM-DD.md daily:
# YYYY-MM-DD — Daily Log
## [Time] — [Event/Task]
- What happened
- Decisions made
- Follow-ups needed
## [Time] — [Another Event]
- Details
Agent Instructions (AGENTS.md)
Add to your AGENTS.md for agent behavior:
## 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
Troubleshooting
Memory search not working?
- Check
memorySearch.enabled: truein config - Verify MEMORY.md exists in workspace root
- Restart gateway:
clawdbot gateway restart
Results not relevant?
- Lower
minScoreto0.2for more results - Increase
maxResultsto30 - Check that memory files have meaningful content
Provider errors?
- Voyage: Set
VOYAGE_API_KEYin environment - OpenAI: Set
OPENAI_API_KEYin environment - Use
localprovider if no API keys available
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.
Full Config Example
{
"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. ??
-
08.08
猎人拿哪个卡牌好打怪物
-
08.08
明日方舟渠道服账号交易靠谱平台推荐
-
08.08
明日方舟终末地卖号平台推荐与安全交易软件指南
-
08.08
方舟生存进化手游流星锤能缠住哪些生物 方舟生存进化手游流星锤实战效果与适用龙种详解
-
08.08
Stock Market Pro:专业的财务分析与图表工具 - Openclaw Skills
-
08.08
摩尔庄园土地伯伯位置
-
-
- 他趣如何关闭在线状态
- 08.08
-
- 女神漫画登录页面漫画入口
- 08.08
-
- 热血江湖传披风技能哪个好
- 08.08
-
-
- 浮生忆玲珑什么时候上线
- 08.08
-
-
下载
- |
-
-
下载
- 《行尸走肉第一章》免安装中文汉化硬盘版下载
- 单机|436 MB
- 一款以动作冒险为主题的游戏
-
-
下载
- 《街头霸王X铁拳》免安装中文汉化硬盘版下载
- 单机|111MB
- 一款非常好玩的格斗游戏
-
-
下载
- |
-
-
下载
- 《暗黑破坏神3》免安装繁体中文正式版下载
- 单机|7630 MB
- 一款以角色扮演为主题的游戏
-
-
下载
- 《马克思佩恩3》免安装硬盘版下载
- 单机|27033 MB
- 一款以第三人称射击为主题的游戏