---
title: "DeepSeek Harness"
description: "在 DeepSeek Harness 中配置并调用博查搜索。"
slug: "/integrations/deepseek-harness"
sidebarTitle: "DeepSeek Harness"
updated: "2026-09-28"
---

# DeepSeek Harness

DeepSeek Harness（dsh）是由 DeepSeek 开源的 agent harness（智能体运行框架），用于将模型、工具、会话、权限控制和应用界面等能力组合成可运行的智能体系统。它的核心设计理念是“一切皆插件（Everything is a Plugin）”，各项能力均以插件形式提供，并可通过 Profile 和 Bundle 按需安装、组合、替换与扩展，让开发者无需修改 Harness 核心代码，就能接入新的模型、工具与外部服务。

DeepSeek Harness [官方仓库](https://github.com/deepseek-ai/deepseek-harness)。

博查搜索现已提供 DeepSeek Harness 官方插件，安装 @bocha-ai/dsh-web-search-bocha 后，即可将博查 Web Search 接入 Harness 的统一 web_search工具，为智能体提供实时联网搜索能力。

## 安装插件

把博查搜索插件安装到 Profile：

```
dsh plugin --profile web add @bocha-ai/dsh-web-search-bocha
```

如需检查最终组合配置，可以执行下面的可选命令，它打印配置后就会退出：

```
dsh --profile web --dump-config
```

启动 Web 应用只需要执行：

```
dsh --profile web
```

## 获取并配置 API 密钥

前往[博查AI开放平台](https://open.bocha.cn)注册并获取 API 密钥，使用下面任一方式配置即可，不需要同时配置。

### 方式一：环境变量

对于 CI、容器或按次覆盖，在启动 Harness 前导出密钥：

```
export BOCHA_API_KEY='your-api-key'
```

### 方式二：DSH credentials 文档

把密钥存入 `$DSH_HOME/.credentials.yaml`（通常是 `~/.dsh/.credentials.yaml`）：

```
BOCHA_API_KEY: your-api-key
```

在 POSIX 上，该文件必须仅属主可访问：

```
chmod 600 ~/.dsh/.credentials.yaml
```

插件会在每次搜索时经由 `Harness credentials`服务解析这个引用，因此轮换已存密钥后，下一次请求就会使用新值，无需重启。

如果两种方式都配置了 `BOCHA_API_KEY`，继承的环境变量优先级高于受管凭据文档。

## 使用插件

配置成功并启动`DeepSeek Harness`后，在`Settings->Plugins->Plugin list`中会看到`web-search-bocha`处于已启用状态。

![DeepSeek Harness 中已启用 web-search-bocha 插件](/images/integrations/deepSeekHarness/img.png)

接下来提问任意问题，`DeepSeek Harness` 会自动调用 `web-search-bocha`插件

![DeepSeek Harness 自动调用博查搜索](/images/integrations/deepSeekHarness/img_1.png)

## 卸载插件

移除这个包会同时移除其提供方行和组合包层：

```
dsh plugin --profile web remove @bocha-ai/dsh-web-search-bocha
```

## 免费领取搜索调用次数

登录博查AI开放平台，使用口令`dsh-web-search-bocha`即可免费兑换1000次 Web Search 调用次数。

![博查AI开放平台兑换 DeepSeek Harness 调用次数](/images/integrations/deepSeekHarness/img_2.png)
