Appearance
Exa Search
OpenClaw 支持将 Exa AI 用作 web_search 提供商。Exa 提供神经搜索、关键词搜索和混合搜索模式,并内置内容提取能力(高亮句、全文、AI 摘要)。
获取 API Key
第一步:创建账户
在 exa.ai 注册并在控制台生成 API key。
第二步:存储 API key
在 Gateway 环境中设置 EXA_API_KEY,或通过以下命令配置:
bash
openclaw configure --section web配置
json5
{
plugins: {
entries: {
exa: {
config: {
webSearch: {
apiKey: "exa-...", // 如果设置了 EXA_API_KEY 环境变量则可省略
},
},
},
},
},
tools: {
web: {
search: {
provider: "exa",
},
},
},
}环境变量替代方案:在 Gateway 环境中设置 EXA_API_KEY。对于 gateway 安装,将其放在 ~/.openclaw/.env 中。
工具参数
| 参数 | 说明 |
|---|---|
query | 搜索查询(必填) |
count | 返回结果数(1-100) |
type | 搜索模式:auto、neural、fast、deep、deep-reasoning 或 instant |
freshness | 时间过滤:day、week、month 或 year |
date_after | 该日期之后的结果(YYYY-MM-DD) |
date_before | 该日期之前的结果(YYYY-MM-DD) |
contents | 内容提取选项(见下方) |
内容提取
Exa 可以在搜索结果旁返回提取的内容,传入 contents 对象来启用:
javascript
await web_search({
query: "transformer architecture explained",
type: "neural",
contents: {
text: true, // 完整页面文本
highlights: { numSentences: 3 }, // 关键句子
summary: true, // AI 摘要
},
});| 内容选项 | 类型 | 说明 |
|---|---|---|
text | boolean | { maxCharacters } | 提取完整页面文本 |
highlights | boolean | { maxCharacters, query, numSentences, highlightsPerUrl } | 提取关键句子 |
summary | boolean | { query } | AI 生成摘要 |
搜索模式
| 模式 | 说明 |
|---|---|
auto | Exa 自动选择最佳模式(默认) |
neural | 基于语义/含义的搜索 |
fast | 快速关键词搜索 |
deep | 深度彻底搜索 |
deep-reasoning | 带推理的深度搜索 |
instant | 最快速结果 |
注意事项
- 如果未提供
contents选项,Exa 默认使用{ highlights: true },结果包含关键句摘录 - 来自 Exa API 响应的
highlightScores和summary字段在可用时会被保留 - 结果描述优先从 highlights 解析,其次是 summary,最后是全文
freshness与date_after/date_before不能同时使用,只能选择一种时间过滤模式- 每次查询最多返回 100 条结果(受 Exa 搜索类型限制)
- 结果默认缓存 15 分钟(可通过
cacheTtlMinutes配置) - Exa 是官方 API 集成,返回结构化 JSON 响应
小龙虾养成 Tips:如果你的龙虾需要处理大量信息检索任务,Exa 的
neural模式配合highlights内容提取是个不错的组合,既能语义搜索又能直接拿到关键段落,省去二次解析的麻烦。
相关文档
- Web Search 总览 — 所有提供商与自动检测
- Brave Search — 带国家/语言过滤的结构化结果
- Perplexity Search — 支持域名过滤的结构化结果