← Back to PRs

#14445: feat: add SerpApi search provider plugin with vertical search support

by xiaoyaner0201 open 2026-02-12 04:38 View on GitHub →
gateway agents stale size: XL
## Summary Add a **serpapi-search** extension plugin that integrates [SerpApi](https://serpapi.com) as a web search provider, with support for 20+ vertical search engines. Also adds an `engine` parameter to the `web_search` tool schema so LLMs can request specific search verticals directly (e.g. `engine='scholar'`, `engine='news'`). ## Depends on This PR builds on the extensible search provider architecture from **#11444**. The base branch includes those commits — once #11444 is merged, this PR will have a clean diff of just the SerpApi plugin + engine param. ## Features - **SerpApi integration** with configurable API key and default engine - **20+ vertical search engines**: Google (default), News, Scholar, Images, Shopping, Maps, Jobs, Finance, Patents, YouTube, Bing, Baidu, Yandex, Naver, etc. - **Engine-specific result parsing**: organic results, news articles, scholar papers, shopping products, map places, job listings, etc. - **Knowledge graph & answer box** extraction when available - **`engine` parameter** added to `web_search` tool schema and `SearchProviderPlugin` type for vertical routing - Proper error handling and timeout support ## Files changed - `extensions/serpapi-search/` — New plugin (index.ts, README, manifest, package.json) - `src/agents/tools/web-search.ts` — Add `engine` to tool schema and pass through to provider - `src/plugins/types.ts` — Add `engine?` to SearchProviderPlugin params type ## Testing Tested locally with SerpApi free tier: - ✅ Default Google search - ✅ Google Scholar vertical (`engine='scholar'`) - ✅ Google News vertical (`engine='news'`) - ✅ YouTube search (`engine='youtube'`) - ✅ Engine-specific result parsing <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR introduces a plugin-based registry for `web_search` providers, refactors the built-in Brave and Perplexity implementations into `SearchProviderPlugin`s, and adds a new `serpapi-search` provider plugin with an `engine` parameter for vertical routing (news/scholar/images/shopping/maps/etc.). It also updates tool/config typings to allow arbitrary provider IDs registered by plugins. Key correctness issue found: the new example `kagi-search` plugin’s manifest schema currently prevents users from configuring the required `apiKey`, which will cause the plugin to fail validation and not load. <h3>Confidence Score: 4/5</h3> - Mostly safe to merge once the kagi-search manifest schema mismatch is fixed - Core refactor to a provider registry is straightforward and keeps built-in Brave/Perplexity behavior encapsulated; main concrete breakage is the kagi-search plugin manifest rejecting its own apiKey config, which would prevent loading when configured. - extensions/kagi-search/openclaw.plugin.json <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs