所有 memory search 配置项位于 agents.defaults.memorySearch(openclaw.json)。

Provider 选择

配置项类型默认值说明
providerstring自动检测embedding 适配器 ID
modelstringprovider 默认embedding 模型名
fallbackstring"none"主 provider 失败时的备用
enabledbooleantrue是否启用 memory search

自动检测顺序:local → github-copilot → openai → gemini → voyage → mistral → deepinfra → bedrock(ollama 需手动指定)

API Key 解析

Provider环境变量Config 路径
OpenAIOPENAI_API_KEYmodels.providers.openai.apiKey
GeminiGEMINI_API_KEYmodels.providers.google.apiKey
VoyageVOYAGE_API_KEYmodels.providers.voyage.apiKey
MistralMISTRAL_API_KEYmodels.providers.mistral.apiKey
BedrockAWS SDK 凭证链无需 API key

混合搜索配置

位于 memorySearch.query.hybrid:

配置项默认值说明
enabledtrue启用 BM25 + 向量混合搜索
vectorWeight0.7向量分数权重
textWeight0.3BM25 分数权重
mmr.enabledfalse启用 MMR 多样性重排
temporalDecay.enabledfalse启用时间衰减(近期优先)
temporalDecay.halfLifeDays30分数半衰期(天)

多模态 Memory(Gemini)

需要 gemini-embedding-2-preview,在 extraPaths 中索引图像和音频:

配置项默认值说明
multimodal.enabledfalse启用多模态索引
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",
          },
        },
      },
    },
  },
}

相关页面