dsh-search-first
学习研究 活跃维护

dsh-search-first

v587d/dsh-search-first

它是一套强约束的对话回复流程工具,默认要求模型先检索相关信息核验事实,再生成回复内容,从流程上规避大模型幻觉风险,输出结果更可靠,部署轻量可直接集成到现有对话系统。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
TypeScript
主要语言
MIT
开源协议
824 KB
仓库大小
18 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:v587d/dsh-search-first
git clone https://github.com/v587d/dsh-search-first.git
git clone git@github.com:v587d/dsh-search-first.git
README.md main

Search First

中文

Search first, verify facts, reply last — enforced by DSH.

Search First — demo walkthrough

▶ Demo walkthrough: https://youtu.be/rGc5OCydHyY

A DeepSeek Harness (dsh) Cordis plugin that forces multi-source web search before the model answers.
On agent/pre-step, when Search First is enabled,
it runs Query Extraction → Unified Search Engine (AnySearch / TinyFish / Tavily) → fetch → organize → cache + runs/ persistence → inject the organized live leeds guiding verification next, then returns control to the agent loop. Final answers stay with the LLM.

Features

  1. The sub-model used for query extraction is configurable.
  2. Guides the host model to use standardized citations, as shown below.
    Custom HTML citation tags
  3. Models and ranks multi-source search results, and selectively fetches pages back to the host model.

Installation

Prerequisites: a mounted dsh web profile (dsh ≥ 0.1.1-rc.2), Node ≥ 22.

# install from the GitHub repo:
dsh plugin --profile web add https://github.com/v587d/dsh-search-first.git

Uninstall: dsh plugin --profile web remove dsh-search-first (then restart).

Build from source

pnpm install
pnpm check      # vitest + typecheck (host + client)
pnpm build      # lib/ (host ESM + d.ts) + lib/client.js (browser bundle)
pnpm test

Quick start

[!IMPORTANT]
Export at least one API key (AnySearch / Tinyfish / Tavily) before running.
Free tier is ENOUGH.

  1. Restart dsh web after installing.
  2. Open Settings → Search firstSearch APIsTest all connections
    (configure keys first via step 3, or the probe reports a key-missing result).
  3. Provide at least one provider key — add it to $DSH_HOME/.credentials.yaml
    or export TAVILY_API_KEY / ANYSEARCH_API_KEY / TINYFISH_API_KEY in the
    environment. AnySearch also works anonymously (Bearer header omitted).
  4. Back in a session, the Search First toggle under the input box decides
    per session (right-click the toggle to return to the global default).

Configuration (Settings → Search first)

Section Fields
General default enabled, failure policy (continue / block), injection mode, overall timeout
Query Extraction explicit provider/model (empty = follow session model), timeout, max tokens
Cache dir (empty = $DSH_HOME/search-first; root applies after restart), search/fetch TTL, clear button
Limits max search results, max fetch pages, max inject chars
Search APIs mode (sequential failover / parallel fan-out + merge), big-three enable/credential-ref/priority, per-provider timeout, ctx.web fallback, local HTTP fallback, Test all connections

License

MIT — see LICENSE.