Preface¶
The philosophy of DeepSeek Harness (DSH) is “Everything is a plugin”: the web_search tool, result limits, and citation display on the model side are handled by its own web capability, but specifically which search service to fetch results from depends on the mounted searchProvider. If you select Bocha as your search service, by convention, you must implement a WebSearchProvider yourself, register it in the Profile, and then handle credential parsing and error mapping.
@bocha-ai/dsh-web-search-bocha turns this into an installable bundle: one command to install it into the Profile, and ctx.web’s search will route to Bocha’s Web Search API. Below is an introduction to its positioning, installation steps, and configuration.
What is it¶
One-sentence positioning: Provides a Bocha (Bocha) Web Search driven WebSearchProvider for DeepSeek Harness, accompanied by an installable Profile bundle.
- Maintainer: bocha-ai
- Package Name:
@bocha-ai/dsh-web-search-bocha, Current Version: 0.1.0 - License: MIT
- Repository: https://github.com/bocha-ai/dsh-web-search-bocha
It is only responsible for the search segment. The model-side web_search tool contract, result boundaries, and citation/error display are still controlled by Harness; the plugin does not take over these.
Core Features¶
-
Register a WebSearchProvider with provider id
bocha, invoking Bocha’sPOST /v1/web-searchinterface. -
Carry the
dsh.bundlepatch (cordis.patch.yml). After installation, set thesearchProviderof thewebline tobocha, and insert theweb-search-bochaline to load this package. -
Parse
BOCHA_API_KEYvia the Harness credentials service on every search; key rotation takes effect immediately for the next request without a restart. -
Result mapping: Map Bocha’s returned
url/name/summary/datePublishedto Harness’surl/title/snippet/publishedAt; entries without a valid URL are discarded. -
The request’s
maxResultsoverrides the defaultcount, and is truncated to the Bocha limit of 50 before sending. -
Error handling has clear mappings:
- HTTP errors, network failures, non-200 responses, unparseable response body →
WEB_PROVIDER_ERROR(keepslog_idif present) - Aborted →
WEB_ABORTED - Credentials missing →
WEB_PROVIDER_CREDENTIAL_MISSING - Redirects are rejected before accessing the target
- HTTP errors, network failures, non-200 responses, unparseable response body →
Installation & Enablement¶
First, install the bundle into the web Profile:
dsh plugin --profile web add @bocha-ai/dsh-web-search-bocha
After installation, you can print the merged configuration to confirm the patch has taken effect (exits after printing, does not start the service):
dsh --profile web --dump-config
Then start the Web application:
dsh --profile web
The plugin requires Bocha’s (open.bocha.cn) API key to perform actual searches. There are two choices for credential configuration.
Method 1: Write to the DSH credentials file $DSH_HOME/.credentials.yaml (usually ~/.dsh/.credentials.yaml):
BOCHA_API_KEY: your-api-key
On POSIX systems, tighten file permissions to owner read/write only:
chmod 600 ~/.dsh/.credentials.yaml
Method 2: Export environment variables before starting:
export BOCHA_API_KEY='your-api-key'
When both are configured, the environment variable takes precedence. Uninstalling is also a single command, which removes the corresponding provider line and bundle layer:
dsh plugin --profile web remove @bocha-ai/dsh-web-search-bocha
Configuration¶
The inserted web-search-bocha line supports the following configurations:
| Configuration Item | Default Value | Description |
|---|---|---|
apiKey |
— | Optional plaintext API key; credential method is recommended to avoid plaintext keys entering the Profile patch |
apiKeyEnv |
BOCHA_API_KEY |
Reference to credentials parsed by the Harness credentials service, parsed on every search |
baseURL |
https://api.bocha.cn |
API base address |
freshness |
noLimit |
Time filter condition attached to the search |
summary |
true |
Whether to request the summary for each page from Bocha |
count |
10 |
Default number of items when the request does not carry maxResults, value range 1–50 |
These configurations do not require changing the package itself; they can be configured directly on that line via subsequent Profile patches:
- id: web-search-bocha
config:
freshness: 2025-01-01..2025-04-06
summary: true
count: 10
After the above steps, restarting will ensure that ctx.web search requests carry these parameters and use Bocha.
Applicable Scenarios & Notes¶
Suitable readers: Deployers already running the DSH Web application who want web_search to use Bocha; teams needing fixed time filtering (freshness) based on deployment; developers who don’t want to write WebSearchProvider manually in the main project.
Pay attention to the following points before use:
- You must apply for an API key from Bocha (open.bocha.cn) first, otherwise the plugin will not work even if installed.
- Node engine requires
^22.19.0 || >=24.0.0. - The current upstream DSH built-in Plugins UI does not expose third-party search settings; they must be configured via Profile lines, and
BOCHA_API_KEYmust be stored in the credentials file or startup environment. freshnessis a deployment-level configuration, not a parameter that the model can pass: Harness’s neutral request only carriesqueryandmaxResults; each request under the same provider mount uses the samefreshnessvalue.- A single API call returns at most 50 sources; this endpoint does not return generative answers, so
WebSearchResult.contentis omitted; Bocha-specificsiteNameand media fields like images and videos are also omitted. - Security tip: The plugin runs with the permissions of the current dsh process. It is recommended to read the source code and confirm the license (this project is MIT) before installation to ensure it meets your deployment requirements.
If you wish to participate in development, you can run keyless tests and builds in the repository:
npm install
npm test
npm run build
npm pack --dry-run
With a Bocha key, you can run end-to-end smoke tests:
BOCHA_API_KEY='your-api-key' npm run test:e2e
Summary¶
This plugin solves a very specific problem: enabling DSH’s ctx.web to use Bocha search, with installation, configuration, and uninstallation all converging within the Profile and bundle mechanisms, and key rotation requiring no restart. If your search service selection happens to be Bocha, this is the most direct integration method.
- Community directory page: https://www.skillhub.cn/plugins/bocha-ai/dsh-web-search-bocha (The directory is maintained independently by the community and has no official affiliation with DeepSeek / Fanza)
- GitHub repository: https://github.com/bocha-ai/dsh-web-search-bocha