概述

Brave Search API 是 OpenClaw web_search 的一个提供商,提供结构化搜索结果(标题、URL、摘要)。支持 llm-context 模式(返回预提取文本块和来源,适合 LLM grounding)。

核心功能

  • 标准 web 搜索模式:返回标题、URL、摘要
  • llm-context 模式:返回预提取文本块和来源引用
  • 支持国家/语言过滤(country、language、search_lang)
  • 时间过滤:freshness(day/week/month/year)或 date_after/date_before
  • 结果缓存 15 分钟
  • 自动检测优先级:order 10(最高优先级 API 提供商)

配置/使用

{
  plugins: {
    entries: {
      brave: {
        config: {
          webSearch: {
            apiKey: "BRAVE_API_KEY_HERE",
            mode: "web",  // 或 "llm-context"
            baseUrl: "https://api.search.brave.com",
          },
        },
      },
    },
  },
  tools: {
    web: {
      search: {
        provider: "brave",
        maxResults: 5,
      },
    },
  },
}

环境变量:BRAVE_API_KEY

注意事项

  • 每月 $5 免费额度(约 1000 次查询)
  • llm-context 模式不支持 ui_lang;date_before 需配合 date_after 使用
  • 启用 brave.http 诊断 flag 可记录请求/响应调试信息(不记录 API key 和响应体)

相关页面

  • concepts/tool-web — Web 搜索工具总览与提供商对比
  • concepts/tool-perplexity-search — Perplexity 搜索(支持域名过滤)
  • concepts/tool-exa-search — Exa 神经搜索(支持内容提取)