WeKnora
WeKnora copied to clipboard
[Feature] Web search provider support for Bocha AI Search (博查)
Motivation
Bocha AI Search (博查) is a popular China-focused AI search API with a Bing-compatible response format, clean snippets and long text summaries designed for LLM consumption. WeKnora already ships several China-friendly web search providers (Baidu AI Search, Metaso, Zhipu). Adding Bocha gives tenants — especially in mainland China where Google/Bing keys are hard to obtain — another high-quality option.
Proposal
Add a bocha web search provider following the existing provider architecture (same pattern as the Metaso/Tavily adapters in internal/infrastructure/web_search/):
- Endpoint:
POST https://api.bochaai.com/v1/web-searchwithAuthorization: Bearer <key>; official URL hardcoded (SSRF-safe, consistent with Tavily/Metaso) - Request:
query,freshness(noLimit/oneDay/oneWeek/oneMonth/oneYear, defaultnoLimit),summary(default on — long summaries preferred as snippets),count(1–50) - Response: Bing-compatible
data.webPages.value[]mapped toWebSearchResult(name→Title,url→URL,summary||snippet→Snippet,datePublished/dateLastCrawled→PublishedAt) - Tenant-facing config fields (
freshness,summary) surfaced through the existingGET /web-search/typesdynamic form mechanism; API key stored via the existing encrypted parameters flow
Motivation is the same family as #2625 (Metaso provider, from issue #2562). I have a working implementation with tests ready to submit as a PR.