Skip to content

Exa 搜尋

OpenClaw 支援將 Exa AI 作為 web_search 提供商。Exa 提供神經、關鍵字和混合搜尋模式,並具有內建內容 提取功能(亮點、文字、摘要)。

  1. 建立帳號

    exa.ai 註冊,並從您的 儀表板生成 API 金鑰。

  2. 儲存金鑰

    在 Gateway 環境中設定 EXA_API_KEY,或透過以下方式進行設定:

    Terminal window
    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搜尋查詢(必填)
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 欄位
  • 結果描述優先從 highlights 解析,然後是 summary,接著是 full text — 取決於何者可用
  • freshnessdate_after/date_before 不能組合使用 — 請使用一種 時間篩選模式
  • 每次查詢最多可傳回 100 個結果(受限於 Exa 搜尋類型 限制)
  • 結果預設快取 15 分鐘(可透過 cacheTtlMinutes 設定)
  • Exa 是官方 API 整合,提供結構化 JSON 回應