dsh-web-search-engine: A Multi-Engine Hybrid Search Plugin for DeepSeek Harness

Introduction

The default web search capability of DeepSeek Harness (DSH) sometimes fails to meet complex queries or specific requirements. This plugin registers a new search provider (ID: web-search-multi) to ctx.web, replacing the default search behavior with results hybridized from multiple engines.

By default, the plugin uses a hybrid mode, querying all enabled engines in parallel and merging results via rank rotation. It supports various engines such as Bing, DuckDuckGo, Mojeek, Google, and Brave, and provides a visual settings page to configure proxies, credentials, and engine priority.

Installation

Execute the following command in the DSH plugin directory:

plugin_manager action=install_bundle target=<absolute path to this directory>

Or clone directly via Git:

git clone https://github.com/Gaozx1/dsh-web-search-engine.git

After installation, the plugin will automatically point the web line configuration in the profile to the new provider. Note that you may need to refresh the page (F5) for the search options in the settings page to take effect.

Core Features

Hybrid and Fallback Modes

The plugin supports two result combination modes:
1. Hybrid Mode (default mode: merge): Queries all enabled engines in parallel, merges results via rank rotation, and deduplicates by URL. Even if a specific engine fails or is blocked, it will not compromise the overall search.
2. Sequential Mode (mode: fallback): The first engine to return results wins.

Headless Browser Data Retrieval

For Brave, DuckDuckGo, and Google, the plugin uses Node’s built-in WebSocket to drive local Chrome or Edge for rendering and data retrieval, eliminating the need to install puppeteer or playwright.
* Cold Start: ~1s.
* Single Search: 0.7~3.5s.
* Idle Reclaim: When enabled, the browser instance will automatically close after a period of inactivity.

Relevance Guard

Addressing the noise issue often found in Bing’s Chinese queries, the plugin includes a built-in relevance guard. If a query contains ASCII words (e.g., dsh, rust) but the results completely lack these terms, that engine is marked as failed, allowing other engines to compensate.

Engines and Retrieval Methods

Engine ID Retrieval Method Description
bing Scrape Result Page / RSS Fast direct connection (0.4s) with correct results; does not use global proxy and ignores proxy config.
duckduckgo HTML Parsing / Browser Works via proxy; direct connection is usually blocked.
mojeek Scrape Result Page Independent index, but some exit IPs may trigger human verification (CAPTCHA).
google Official API / Browser Official API is closed to new customers; browser retrieval requires “headed mode” and is highly susceptible to rate limiting.
brave Official API / Browser Requires API Key configuration; untested.
brave-web Headless Browser No Key required; stable in testing, but prone to rate limiting during continuous queries.
ddg-web Headless Browser More stable than the HTML version.
google-web Headless Browser Only works with headed mode (headlessForGoogle: true), and is subject to rate limiting.

Bing Proxy Configuration

Bing redirects requests to cn.bing.com (direct) or www.bing.com (proxy) based on the connection type. Direct connections for Chinese results are usually faster and more accurate, so the plugin does not follow the global proxy configuration by default. To force proxy usage, configure bing.proxy separately.

Real-world Constraints with Google

Google uniformly returns a “JavaScript required” placeholder page for non-browser clients, and the official Programmable Search JSON API has been disabled. To get Google results, you must use google-web with headed mode enabled, but this will quickly trigger rate limits.

Headless Browser Configuration

Detailed configuration is available in the “Browser Retrieval” section of the settings page:

  • Master Switch: browser.enabled
  • Executable Path: browser.exe (Leave empty to auto-detect Chrome or Edge)
  • Headless Mode: browser.headless
  • Headed Mode for Google: browser.headlessForGoogle
  • Browser Proxy: browser.proxy (Leave empty to use global proxy)
  • Idle Reclaim Time: browser.idleMs (Milliseconds, 0 means no auto-close)
  • Single Engine Wait: browser.waitMs (Abandon engine if timeout)

Usage Examples

  1. Enable Engines: Go to Settings → Search, check the desired engines (e.g., bing, brave-web), and adjust the priority.
  2. Configure Proxy: Fill in the global proxy in “Default Proxy” or specify it individually in the advanced settings for each engine.
  3. Configure Credentials: Fill in google.apiKey / google.cx or brave.apiKey in the advanced settings.
  4. Modify Config File: Directly edit the profile’s cordis.patch.yml, change the searchProvider in the web line to web-search-multi, or revert it to deepseek-official.

Notes

  • Mojeek: The parser could not be tested locally by the author (403/Captcha); only fallback handling has been implemented.
  • Google/Brave API: Untested; relies on user self-configuration.
  • Rate Limiting: brave-web and google-web are prone to rate limiting during continuous queries. It is recommended to select multiple engines for backup and configure browser.profileDir to reuse cookies.
  • Relevance Guard: Only intercepts cases where “ASCII words are completely missed.” Noise in purely Chinese queries is a known limitation.

Summary

This plugin significantly enhances DSH’s web information retrieval capabilities by hybridizing multi-engine searches. Combined with headless browser support and a relevance guard, it effectively addresses the limitations and noise of single search engines. Once installed, it allows for quick adjustments via the settings page, making it suitable for developers requiring broader coverage or specific search capabilities.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye