Skip to main content
Exa AI 是一个 web_search 提供商,支持神经、关键词和混合搜索模式,并内置内容提取(高亮、文本、摘要)。

安装插件

openclaw plugins install @openclaw/exa-plugin
openclaw gateway restart

获取 API key

1

Create an account

exa.ai 注册,并从你的仪表盘生成 API key。
2

Store the key

在 Gateway 网关环境中设置 EXA_API_KEY,或通过以下命令配置:
openclaw configure --section web

配置

{
  plugins: {
    entries: {
      exa: {
        config: {
          webSearch: {
            apiKey: "exa-...", // optional if EXA_API_KEY is set
            baseUrl: "https://api.exa.ai", // optional; OpenClaw appends /search
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "exa",
      },
    },
  },
}
**环境替代方案:**在 Gateway 网关环境中设置 EXA_API_KEY。对于 Gateway 网关安装,请将它放在 ~/.openclaw/.env 中。参见环境变量

Base URL 覆盖

设置 plugins.entries.exa.config.webSearch.baseUrl,将 Exa 搜索请求路由到兼容代理或替代端点。OpenClaw 会通过前置 https:// 来规范化裸主机,并追加 /search,除非路径已经以它结尾。解析后的端点是搜索缓存键的一部分,因此来自不同端点的结果绝不会共享。

工具参数

query
string
required
搜索查询。
count
number
default:"5"
要返回的结果数(1-100,受 Exa 搜索类型限制约束)。
type
'auto' | 'neural' | 'fast' | 'deep' | 'deep-reasoning' | 'instant'
搜索模式。
freshness
'day' | 'week' | 'month' | 'year'
时间筛选器。不能与 date_after/date_before 组合使用。
date_after
string
此日期之后的结果(YYYY-MM-DD)。
date_before
string
此日期之前的结果(YYYY-MM-DD)。
contents
object
内容提取选项(见下文)。

内容提取

传入 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 生成的摘要
如果省略 contents,Exa 默认使用 { highlights: true },因此结果会包含关键句摘录。结果描述会优先取自高亮,其次是摘要,再其次是完整文本 — 以最先可用的为准。结果还会在可用时保留 Exa API 响应中的原始 highlightScoressummary 字段。

搜索模式

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

说明

  • count 最多接受 100,受 Exa 搜索类型限制约束。
  • 结果默认缓存 15 分钟。配置共享的 tools.web.search.cacheTtlMinutes(分钟)和 tools.web.search.timeoutSeconds(默认 30s),即可更改所有 web_search 提供商(包括 Exa)的缓存和请求超时。

相关