Skip to main content
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。 对于 gateway 安装,请将其放在 ~/.openclaw/.env 中。

工具参数

query
string
required
搜索查询。
count
number
返回的结果数量(1–100)。
type
'auto' | 'neural' | 'fast' | 'deep' | 'deep-reasoning' | 'instant'
搜索模式。
freshness
'day' | 'week' | 'month' | 'year'
时间筛选。
date_after
string
此日期之后的结果(YYYY-MM-DD)。
date_before
string
此日期之前的结果(YYYY-MM-DD)。
contents
object
内容提取选项(见下文)。

内容提取

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 字段
  • 结果描述会优先从高亮内容解析,其次是摘要,最后是全文文本——使用任何可用的内容
  • freshness 不能与 date_after/date_before 组合使用——请选择一种时间筛选模式
  • 每个查询最多可返回 100 条结果(受 Exa 搜索类型限制)
  • 结果默认缓存 15 分钟(可通过 cacheTtlMinutes 配置)
  • Exa 是一个官方 API 集成,提供结构化 JSON 响应

相关内容