[Feature]: Add Serply as a web search provider
Affected Component
Backend Service & API
Problem Description
WeKnora ships 13 web search providers, but the only way to get Google results is Google Custom Search, which needs both an API key and a Programmable Search Engine ID and returns results scoped to that engine. Tenants who want plain Google SERP results have no option, and the only provider that honours the agent tool's per-call country / freshness filters today is Brave. Every other provider returns an error when those filters are set.
Proposed Solution
Add serply as a web search provider, following the Brave adapter (internal/infrastructure/web_search/brave.go) and the Bocha wiring (#3036):
- Endpoint:
GET https://api.serply.io/v1/searchwith anX-Api-Keyheader; official URL hardcoded (SSRF-safe), redirects refused so the key never leaves the official host, 4MB response cap, proxy support throughNewSearchHTTPClient. - Response:
results[]withtitle/link/descriptionmapped toWebSearchResult.numis clamped to 10 because the API serves one Google results page per call; the caller's limit is applied client-side. - Filters: implements
FilteredWebSearchProvider.countrymaps to Google'sgl(omitted forALL),freshnesspd/pw/pm/pymaps totbs=qdr:d|w|m|y. Serply has no date-range filter, so theYYYY-MM-DDtoYYYY-MM-DDform returns a clear error instead of being dropped silently, consistent with the "never ignore requested filters" rule. - Wiring: type constant and metadata (
RequiresAPIKey,SupportsProxy), registry factory, service validation, frontend provider union, swagger enum entries, docs table row. Noextra_configfields are needed. - Tests mirror
brave_test.go: request mapping, default and clampednum,ALLhandling, date-range rejection, error paths that do not leak the upstream body.
Alternatives
Keep using Google Custom Search (engine ID required, scoped results), or self-host SearXNG with the Google engine enabled (unkeyed, but scrapes and needs its own host).
Impact
Additive. Nothing changes for tenants who do not create a Serply configuration.
Use Case
An agent that needs Google-quality results with region and recency control, for example web_search with country: "GB" and freshness: "pd" for today's UK coverage of a topic.
Additional Information
Disclosure: I work with Serply. I have the implementation with tests ready and verified against the live API (region and qdr freshness confirmed, date ranges confirmed unsupported). I will open the PR right after this issue, the same way #3035 led to #3036.
PR opened: #3330