WeKnora icon indicating copy to clipboard operation
WeKnora copied to clipboard

[Feature] Web search provider support for Bocha AI Search (博查)

Open vicfei opened this issue 3 months ago • 0 comments

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-search with Authorization: Bearer <key>; official URL hardcoded (SSRF-safe, consistent with Tavily/Metaso)
  • Request: query, freshness (noLimit/oneDay/oneWeek/oneMonth/oneYear, default noLimit), summary (default on — long summaries preferred as snippets), count (1–50)
  • Response: Bing-compatible data.webPages.value[] mapped to WebSearchResult (name→Title, url→URL, summary||snippet→Snippet, datePublished/dateLastCrawled→PublishedAt)
  • Tenant-facing config fields (freshness, summary) surfaced through the existing GET /web-search/types dynamic 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.

vicfei avatar Sep 05 '26 09:09 vicfei