Summary
Add Brave Search API as an alternative SearchProvider alongside Serper and Tavily. The provider architecture in apps/desktop/src/main/ai/tools/providers/ is already pluggable (clean SearchProvider interface), making this a straightforward addition.
Motivation
-
Brave Search is what Claude Code itself uses for its built-in WebSearch tool. However, when Claude Code is invoked programmatically (via the Claude Agent SDK), Anthropic restricts web search access. Since Auto Claude now uses its own independent search tools via the Vercel AI SDK, adding Brave Search as a provider would give users a familiar, battle-tested search backend without any Anthropic restrictions.
-
Many developers already have a Brave Search API subscription — either through Brave Premium or as a standalone API plan. Supporting it means they don't need to sign up for yet another service (Serper/Tavily).
-
Free tier available — Brave Search API offers 2,000 free queries/month, which is competitive with Serper's 2,500 one-time free credits.
Proposed Implementation
Create apps/desktop/src/main/ai/tools/providers/brave-search.ts implementing the existing SearchProvider interface:
export class BraveSearchProvider implements SearchProvider {
readonly name = 'brave';
async search(query: string, options?: SearchOptions): Promise<SearchResult[]> {
// GET https://api.search.brave.com/res/v1/web/search?q=...
// Header: X-Subscription-Token: <BRAVE_SEARCH_API_KEY>
}
}
Configuration via BRAVE_SEARCH_API_KEY environment variable (same pattern as SERPER_API_KEY and TAVILY_API_KEY).
Update createSearchProvider() in providers/index.ts to select the provider based on which API key is available (with fallback chain: Serper → Brave → Tavily).
API Reference
Scope
Summary
Add Brave Search API as an alternative
SearchProvideralongside Serper and Tavily. The provider architecture inapps/desktop/src/main/ai/tools/providers/is already pluggable (cleanSearchProviderinterface), making this a straightforward addition.Motivation
Brave Search is what Claude Code itself uses for its built-in
WebSearchtool. However, when Claude Code is invoked programmatically (via the Claude Agent SDK), Anthropic restricts web search access. Since Auto Claude now uses its own independent search tools via the Vercel AI SDK, adding Brave Search as a provider would give users a familiar, battle-tested search backend without any Anthropic restrictions.Many developers already have a Brave Search API subscription — either through Brave Premium or as a standalone API plan. Supporting it means they don't need to sign up for yet another service (Serper/Tavily).
Free tier available — Brave Search API offers 2,000 free queries/month, which is competitive with Serper's 2,500 one-time free credits.
Proposed Implementation
Create
apps/desktop/src/main/ai/tools/providers/brave-search.tsimplementing the existingSearchProviderinterface:Configuration via
BRAVE_SEARCH_API_KEYenvironment variable (same pattern asSERPER_API_KEYandTAVILY_API_KEY).Update
createSearchProvider()inproviders/index.tsto select the provider based on which API key is available (with fallback chain: Serper → Brave → Tavily).API Reference
GET https://api.search.brave.com/res/v1/web/searchX-Subscription-TokenheaderScope
brave-search.tsproviderBRAVE_SEARCH_API_KEYto.env.example