Skip to main content

Exa 搜索

OpenClaw 支持 Exa AI 作为 web_search 提供商。Exa 提供 神经、关键词和混合搜索模式,并内置内容 提取(高亮、文本、摘要)。

获取 API 密钥

1

创建账户

exa.ai 注册并从您的 仪表板生成 API 密钥。
2

存储密钥

在 Gateway(网关) 环境中设置 EXA_API_KEY,或通过以下方式配置:
openclaw configure --section web

配置

{
  plugins: {
    entries: {
      exa: {
        config: {
          webSearch: {
            apiKey: "exa-...", // optional if EXA_API_KEY is set
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "exa",
      },
    },
  },
}
环境变量替代方案: 在 Gateway(网关) 环境中设置 EXA_API_KEY。 对于网关安装,请将其放入 ~/.openclaw/.env 中。

工具参数

参数描述
query搜索查询(必填)
count返回的结果数量(1-100)
type搜索模式:autoneuralfastdeepdeep-reasoninginstant
freshness时间筛选器:dayweekmonthyear
date_after此日期之后的结果(YYYY-MM-DD)
date_before此日期之前的结果(YYYY-MM-DD)
contents内容提取选项(见下文)

内容提取

Exa 可以在搜索结果的同时返回提取的内容。传递一个 contents 对象以启用:
await web_search({
  query: "transformer architecture explained",
  type: "neural",
  contents: {
    text: true, // full page text
    highlights: { numSentences: 3 }, // key sentences
    summary: true, // AI summary
  },
});
内容选项类型描述
textboolean | { maxCharacters }提取完整页面文本
highlightsboolean | { maxCharacters, query, numSentences, highlightsPerUrl }提取关键句子
summaryboolean | { query }AI 生成的摘要

搜索模式

模式描述
autoExa 选择最佳模式(默认)
neural语义/基于含义的搜索
fast快速关键词搜索
deep彻底的深度搜索
deep-reasoning带推理的深度搜索
instant最快结果

注意事项

  • 如果未提供 contents 选项,Exa 默认为 { highlights: true } 以便结果包含关键句子摘录
  • 结果在可用时保留 Exa API 响应中的 highlightScoressummary 字段
  • 结果描述首先从高亮中解析,然后是摘要,接着是 全文 — 以可用者为准
  • freshnessdate_after/date_before 无法组合使用 — 使用一种 时间过滤模式
  • 每个查询最多可返回 100 个结果(取决于 Exa 搜索类型 的限制)
  • 结果默认缓存 15 分钟(可通过 cacheTtlMinutes 配置)
  • Exa 是带有结构化 JSON 响应的官方 API 集成

相关


本页面源自 openclaw/openclaw,由 BeaversLab 翻译,遵循 MIT 协议 发布。
Last modified on March 27, 2026