OpenClaw SiliconFlow Memory
Goal
Configure OpenClaw memory_search to use SiliconFlow embeddings reliably, then verify indexing and retrieval.
Use this skill to:
- - switch memory embeddings to SiliconFlow
- standardize on INLINECODE1
- set
fallback: "none" for clearer debugging - add curated external Markdown paths to semantic memory
- diagnose failed indexing or failed retrieval
Workflow
1. Inspect the memory config surface first
Before changing config, inspect the relevant schema paths:
- - INLINECODE3
- INLINECODE4
- INLINECODE5
Then inspect the current config with gateway config.get so the patch is based on the latest hash.
Important:
- - Configure memory under
agents.defaults.memorySearch, not top-level memorySearch. - For OpenAI-compatible embedding endpoints, set
remote.apiKey explicitly.
2. Apply the recommended memorySearch config
Use gateway config.patch and keep the configuration explicit.
Recommended baseline:
CODEBLOCK0
Why this baseline works well:
- -
provider: "openai" matches SiliconFlow's OpenAI-compatible embeddings API - INLINECODE12 is a strong default for mixed Chinese/English Markdown recall
- INLINECODE13 avoids silently switching providers during debugging
- explicit
remote.baseUrl and remote.apiKey remove ambiguity
3. Add external knowledge paths conservatively
When indexing a local knowledge base, prefer curated paths instead of adding the entire repo at once.
Good first candidates:
- - source notes
- concepts
- project overviews
- indexes
- README-style top-level knowledge summaries
Avoid adding these in the first pass unless the user explicitly wants them indexed:
- - inbox or capture folders
- daily journals
- templates
- archives
- noisy exports or generated files
Example:
CODEBLOCK1
4. Validate in this order
After config reload/restart, validate in a fixed order:
- 1. INLINECODE16
- INLINECODE17
- INLINECODE18
- tool-layer
memory_search with the same query
Success signs:
- - INLINECODE20
- INLINECODE21 increases as expected
- INLINECODE22
- retrieval returns snippets from the intended external paths
5. Use known text for verification
Do not validate with vague keywords only.
Prefer a phrase that appears verbatim in the indexed notes, such as:
- - a README opening sentence
- a project title
- a section heading
- a unique domain phrase
This makes it easier to distinguish:
- - indexing failure
- retrieval quality issues
- query mismatch
Common failures
404 page not found
Interpret this as: the endpoint likely does not provide embeddings at the configured route.
Typical cause:
- - using a chat/completions proxy that does not expose INLINECODE24
Action:
- - switch to SiliconFlow's embeddings endpoint
- confirm
remote.baseUrl is INLINECODE26 - confirm the embedding model name is valid
fetch failed
Interpret this as: the request could not complete at all.
Typical causes:
- - bad API key
- unreachable endpoint
- transient network issue
- provider auto-detection picked the wrong backend
Action:
- - make
provider, model, remote.baseUrl, and remote.apiKey explicit - retry INLINECODE32
EBUSY: resource busy or locked
Interpret this as: the SQLite memory store is locked during reindex.
Action order:
- 1. retry the index once after current memory operations settle
- restart OpenClaw and retry
- if the lock persists, reboot the machine and retry
Do not assume config is wrong just because reindex failed with EBUSY.
Recommended operating style
- - keep the embedding provider explicit
- keep
fallback: "none" during setup and debugging - add knowledge paths in small batches
- validate with both CLI and tool-layer retrieval
- prefer high-signal Markdown sources over raw dumps
Completion checklist
Before declaring success, confirm all of the following:
- - SiliconFlow API key is configured
- INLINECODE36 is active
- INLINECODE37 shows INLINECODE38
- reindex succeeds
- indexed file count reflects the intended extra paths
- at least one query returns a result from the external knowledge base
OpenClaw SiliconFlow 记忆配置
目标
配置 OpenClaw 的 memory_search 以可靠地使用 SiliconFlow 嵌入,然后验证索引和检索。
使用此技能可以:
- - 将记忆嵌入切换到 SiliconFlow
- 标准化使用 BAAI/bge-m3
- 设置 fallback: none 以便更清晰地调试
- 将精选的外部 Markdown 路径添加到语义记忆
- 诊断索引失败或检索失败
工作流程
1. 首先检查记忆配置表面
在更改配置之前,检查相关的模式路径:
- - agents.defaults.memorySearch
- agents.defaults.memorySearch.remote
- agents.defaults.memorySearch.extraPaths
然后使用 gateway config.get 检查当前配置,以便补丁基于最新的哈希值。
重要提示:
- - 在 agents.defaults.memorySearch 下配置记忆,而不是顶层 memorySearch。
- 对于兼容 OpenAI 的嵌入端点,请显式设置 remote.apiKey。
2. 应用推荐的 memorySearch 配置
使用 gateway config.patch 并保持配置显式。
推荐的基线配置:
json5
agents: {
defaults: {
memorySearch: {
provider: openai,
model: BAAI/bge-m3,
fallback: none,
remote: {
baseUrl: https://api.siliconflow.cn/v1/,
apiKey: YOURSILICONFLOWAPI_KEY
}
}
}
}
此基线配置效果良好的原因:
- - provider: openai 匹配 SiliconFlow 的兼容 OpenAI 的嵌入 API
- model: BAAI/bge-m3 是中英文混合 Markdown 检索的强默认选择
- fallback: none 避免在调试期间静默切换提供商
- 显式的 remote.baseUrl 和 remote.apiKey 消除了歧义
3. 谨慎添加外部知识路径
在索引本地知识库时,优先选择精选路径,而不是一次性添加整个仓库。
良好的首选候选:
- - 源笔记
- 概念
- 项目概览
- 索引
- README 风格的高级知识摘要
除非用户明确要求索引,否则在第一轮中避免添加以下内容:
- - 收件箱或捕获文件夹
- 每日日志
- 模板
- 归档
- 嘈杂的导出或生成文件
示例:
json5
agents: {
defaults: {
memorySearch: {
extraPaths: [
D:/Knowledge/README.md,
D:/Knowledge/Notes/02-Sources,
D:/Knowledge/Notes/03-Concepts,
D:/Knowledge/Notes/05-Projects,
D:/Knowledge/Notes/09-Indexes
]
}
}
}
4. 按此顺序验证
在配置重新加载/重启后,按固定顺序验证:
- 1. openclaw memory status --deep
- openclaw memory index --force
- openclaw memory search <索引文档中的已知短语>
- 使用相同查询的工具层 memory_search
成功标志:
- - Embeddings: ready
- Indexed: N/N files 按预期增加
- Dirty: no
- 检索返回来自预期外部路径的片段
5. 使用已知文本进行验证
不要仅使用模糊的关键词进行验证。
优先使用索引笔记中逐字出现的短语,例如:
- - README 的开头句子
- 项目标题
- 章节标题
- 独特的领域短语
这有助于区分:
常见故障
404 page not found
解释为:端点可能未在配置的路由上提供嵌入。
典型原因:
- - 使用了未暴露 /embeddings 的聊天/补全代理
操作:
- - 切换到 SiliconFlow 的嵌入端点
- 确认 remote.baseUrl 是 https://api.siliconflow.cn/v1/
- 确认嵌入模型名称有效
fetch failed
解释为:请求完全无法完成。
典型原因:
- - API 密钥错误
- 端点不可达
- 临时网络问题
- 提供商自动检测选择了错误的后端
操作:
- - 显式设置 provider、model、remote.baseUrl 和 remote.apiKey
- 重试 openclaw memory status --deep
EBUSY: resource busy or locked
解释为:重新索引期间 SQLite 记忆存储被锁定。
操作顺序:
- 1. 在当前记忆操作稳定后重试索引一次
- 重启 OpenClaw 并重试
- 如果锁仍然存在,重启机器并重试
不要仅仅因为重新索引因 EBUSY 失败就认为配置错误。
推荐操作风格
- - 保持嵌入提供商显式
- 在设置和调试期间保持 fallback: none
- 小批量添加知识路径
- 使用 CLI 和工具层检索进行验证
- 优先选择高信号 Markdown 源而不是原始转储
完成检查清单
在宣布成功之前,确认以下所有内容:
- - SiliconFlow API 密钥已配置
- BAAI/bge-m3 已激活
- openclaw memory status --deep 显示 Embeddings: ready
- 重新索引成功
- 索引文件数量反映了预期的额外路径
- 至少有一个查询从外部知识库返回结果