[PR #5388] [MERGED] [FEAT] Add native Baidu Search provider for Agent web browsing #5427

Closed
opened 2026-06-05 15:21:19 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5388
Author: @jimmyzhuu
Created: 4/8/2026
Status: Merged
Merged: 4/22/2026
Merged by: @timothycarambat

Base: masterHead: codex/add-baidu-search-provider


📝 Commits (4)

  • 9df5c7c feat: add native baidu search provider for agent web browsing
  • 75c2005 chore: address baidu search review feedback
  • 30382c5 refactor baiduSearch internal util to be locally scoped
  • e5f8103 rebase 1.12.1

📊 Changes

8 files changed (+170 additions, -1 deletions)

View changed files

📝 docker/.env.example (+4 -1)
📝 frontend/src/pages/Admin/Agents/WebSearchSelection/SearchProviderOptions/index.jsx (+37 -0)
frontend/src/pages/Admin/Agents/WebSearchSelection/icons/baidu.png (+0 -0)
📝 frontend/src/pages/Admin/Agents/WebSearchSelection/index.jsx (+10 -0)
📝 server/.env.example (+3 -0)
📝 server/models/systemSettings.js (+2 -0)
📝 server/utils/agents/aibitat/plugins/web-browsing.js (+110 -0)
📝 server/utils/helpers/updateENV.js (+4 -0)

📄 Description

Summary

This PR adds Baidu Search as a native web search provider for the Agent web-browsing skill.

Until now, Baidu was only exposed as an engine option under third-party providers like SerpApi/SearchApi. That still depended on an intermediary service. This change adds a first-class baidu-search provider so AnythingLLM can use Baidu Search directly for web retrieval, which is especially useful for stronger zh-CN search coverage.

resolves #5387

What changed

  • added baidu-search to the Agent web search provider switch
  • implemented a native Baidu Search request path against Qianfan web_search
  • normalized Baidu search references into the existing citation shape used by web browsing
  • added Admin UI support for selecting Baidu Search and entering its API key
  • exposed AGENT_BAIDU_SEARCH_API_KEY in system settings and env syncing
  • documented the new env var in server and docker env examples
  • added unit tests for Baidu search result normalization

Why

AnythingLLM already supports multiple native web-search providers at the top level for the Agent skill. Baidu is a meaningful gap if we want better Chinese-language web retrieval without forcing users to go through a third-party aggregator.

This keeps the feature aligned with the current product model:

  • web search providers are retrieval sources
  • the agent is still responsible for reasoning over returned citations
  • this does not introduce a second answer-generating search workflow

Testing

  • corepack yarn lint:ci
  • corepack yarn test
  • corepack yarn build (frontend)
  • manual smoke test against Baidu Qianfan web_search with a real API key:
    • received HTTP 200
    • received references
    • normalized results successfully into AnythingLLM citation format

Notes

  • this is intentionally scoped to native web search only
  • no Baidu AI answer or smart search generation flow is introduced in this PR
  • the frontend currently reuses an existing icon for the Baidu Search provider entry

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5388 **Author:** [@jimmyzhuu](https://github.com/jimmyzhuu) **Created:** 4/8/2026 **Status:** ✅ Merged **Merged:** 4/22/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `codex/add-baidu-search-provider` --- ### 📝 Commits (4) - [`9df5c7c`](https://github.com/Mintplex-Labs/anything-llm/commit/9df5c7c54a74b6ed9351a26f234c19252f386cce) feat: add native baidu search provider for agent web browsing - [`75c2005`](https://github.com/Mintplex-Labs/anything-llm/commit/75c200535424196317e431826125b025ac908f18) chore: address baidu search review feedback - [`30382c5`](https://github.com/Mintplex-Labs/anything-llm/commit/30382c5d6b9ff87eb379079d212a20562d76a4ff) refactor baiduSearch internal util to be locally scoped - [`e5f8103`](https://github.com/Mintplex-Labs/anything-llm/commit/e5f8103df1ffcd2589366b831a9385f0f7280a71) rebase 1.12.1 ### 📊 Changes **8 files changed** (+170 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docker/.env.example` (+4 -1) 📝 `frontend/src/pages/Admin/Agents/WebSearchSelection/SearchProviderOptions/index.jsx` (+37 -0) ➕ `frontend/src/pages/Admin/Agents/WebSearchSelection/icons/baidu.png` (+0 -0) 📝 `frontend/src/pages/Admin/Agents/WebSearchSelection/index.jsx` (+10 -0) 📝 `server/.env.example` (+3 -0) 📝 `server/models/systemSettings.js` (+2 -0) 📝 `server/utils/agents/aibitat/plugins/web-browsing.js` (+110 -0) 📝 `server/utils/helpers/updateENV.js` (+4 -0) </details> ### 📄 Description ## Summary This PR adds Baidu Search as a native web search provider for the Agent web-browsing skill. Until now, Baidu was only exposed as an engine option under third-party providers like SerpApi/SearchApi. That still depended on an intermediary service. This change adds a first-class `baidu-search` provider so AnythingLLM can use Baidu Search directly for web retrieval, which is especially useful for stronger zh-CN search coverage. resolves #5387 ## What changed - added `baidu-search` to the Agent web search provider switch - implemented a native Baidu Search request path against Qianfan `web_search` - normalized Baidu search references into the existing citation shape used by web browsing - added Admin UI support for selecting Baidu Search and entering its API key - exposed `AGENT_BAIDU_SEARCH_API_KEY` in system settings and env syncing - documented the new env var in server and docker env examples - added unit tests for Baidu search result normalization ## Why AnythingLLM already supports multiple native web-search providers at the top level for the Agent skill. Baidu is a meaningful gap if we want better Chinese-language web retrieval without forcing users to go through a third-party aggregator. This keeps the feature aligned with the current product model: - web search providers are retrieval sources - the agent is still responsible for reasoning over returned citations - this does not introduce a second answer-generating search workflow ## Testing - `corepack yarn lint:ci` - `corepack yarn test` - `corepack yarn build` (frontend) - manual smoke test against Baidu Qianfan `web_search` with a real API key: - received HTTP 200 - received `references` - normalized results successfully into AnythingLLM citation format ## Notes - this is intentionally scoped to native web search only - no Baidu AI answer or smart search generation flow is introduced in this PR - the frontend currently reuses an existing icon for the Baidu Search provider entry --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 15:21:19 -04:00
yindo closed this issue 2026-06-05 15:21:19 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5427