所有 memory search 配置项位于 agents.defaults.memorySearch(openclaw.json)。
Provider 选择
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
provider | string | 自动检测 | embedding 适配器 ID |
model | string | provider 默认 | embedding 模型名 |
fallback | string | "none" | 主 provider 失败时的备用 |
enabled | boolean | true | 是否启用 memory search |
自动检测顺序:local → github-copilot → openai → gemini → voyage → mistral → deepinfra → bedrock(ollama 需手动指定)
API Key 解析
| Provider | 环境变量 | Config 路径 |
|---|---|---|
| OpenAI | OPENAI_API_KEY | models.providers.openai.apiKey |
| Gemini | GEMINI_API_KEY | models.providers.google.apiKey |
| Voyage | VOYAGE_API_KEY | models.providers.voyage.apiKey |
| Mistral | MISTRAL_API_KEY | models.providers.mistral.apiKey |
| Bedrock | AWS SDK 凭证链 | 无需 API key |
混合搜索配置
位于 memorySearch.query.hybrid:
| 配置项 | 默认值 | 说明 |
|---|---|---|
enabled | true | 启用 BM25 + 向量混合搜索 |
vectorWeight | 0.7 | 向量分数权重 |
textWeight | 0.3 | BM25 分数权重 |
mmr.enabled | false | 启用 MMR 多样性重排 |
temporalDecay.enabled | false | 启用时间衰减(近期优先) |
temporalDecay.halfLifeDays | 30 | 分数半衰期(天) |
多模态 Memory(Gemini)
需要 gemini-embedding-2-preview,在 extraPaths 中索引图像和音频:
| 配置项 | 默认值 | 说明 |
|---|---|---|
multimodal.enabled | false | 启用多模态索引 |
multimodal.modalities | — | ["image"]、["audio"] 或 ["all"] |
QMD 后端
设置 memory.backend = "qmd" 启用,配置项位于 memory.qmd:
{
memory: {
backend: "qmd",
qmd: {
includeDefaultMemory: true,
update: { interval: "5m", debounceMs: 15000 },
limits: { maxResults: 6, timeoutMs: 4000 },
},
},
}Dreaming(梦境)
配置位于 plugins.entries.memory-core.config.dreaming(非 memorySearch):
{
plugins: {
entries: {
"memory-core": {
config: {
dreaming: {
enabled: true,
frequency: "0 3 * * *",
model: "anthropic/claude-sonnet-4-6",
},
},
},
},
},
}相关页面
- docs/concepts/concept-memory
- ref-api-usage-costs