dshbase

插件目录 / Developer / dsh-data-mode

dsh-data-mode

未验证 tieveto666-code

✓ 持续维护 基于 4 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

0Stars
0Forks
0未关闭 issue
语言
2026-08-23最近推送
跨平台平台

功能简介

DSH 数据模式插件:在原版 DeepSeek Harness 上增加只读问数。连接数据库或上传 CSV/Excel,用自然语言查数,并支持按数据源管理业务知识。

我们的评价
未验证 — 尚未实测

DSH 数据模式插件:在原版 DeepSeek Harness 上增加只读问数。连接数据库或上传 CSV/Excel,用自然语言查数,并支持按数据源管理业务知识。 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-data-mode

A DeepSeek Harness (DSH) plugin that adds a Data Mode session type for read-only analytics in chat.

Connect PostgreSQL, MySQL, or SQLite, or upload CSV / Excel files. Ask questions in natural language. The agent inspects schema, previews rows, and runs read-only SQL. You can also attach business definitions (metrics, aliases, formulas) to each source so answers follow your vocabulary.

The plugin is meant for stock DSH (web UI). It does not change the built-in Standard, PTC, Minimal, or Creative presets, and those sessions never see the SQL tools. New chats still default to Standard Mode. The Data source panel is localized in Chinese and English.

Preview

Data Mode answering with a knowledge-defined metric:

Data Mode answer using business knowledge

Register and select a data source, then preview tables:

Data source registry and table preview

Maintain per-source knowledge (names, descriptions, BM25 recall):

Knowledge management for a data source

Why this exists

DSH is strong at coding agents. Data Mode is for a different job: ask your own tables questions without leaving the conversation, and without giving the model write access to the database.

Typical uses:

  • “What were last month’s orders by category?”
  • “Which SKUs are low on stock?”
  • “Use our definition of GMV, not a guess.”

Capabilities

Data source registry

From the composer Data source control (visible only in Data Mode):

  • Connect PostgreSQL, MySQL, or SQLite
  • Upload CSV or XLSX tables into the workspace (the query engine can also read CSV / Parquet / XLSX when DuckDB is available)
  • Preview tables and sample rows before asking
  • Select exactly one source for the current session (unselected sources are invisible to the agent)
  • Remove a registered source (its knowledge file is removed with it)

Passwords are stored in $DSH_HOME/data-mode/secrets.yaml, not in the catalog.

Built-in demos demo-sqlite and demo-xlsx appear when the catalog is empty, so you can try the flow immediately.

Knowledge management

Each source has its own knowledge list (key → one or more values). Use it for metric definitions, business terms, and calculation rules.

  • Create, edit, search, paginate, bulk-delete, and export to XLSX in the panel
  • The same key may have multiple values
  • Limits: key ≤ 100 characters, value ≤ 1000 characters, 200 entries per source
  • On each question, matching keys are recalled (exact key in the question always hits; otherwise BM25 on keys) and injected into the system prompt as 口径
  • Knowledge never replaces real table or column names; the agent must still describe schema before SQL

Ask-data agent

Only after you pick a source. Tools:

Tool Role
list_data_sources Returns the selected source only (empty until you select one)
describe_schema Required before querying those tables
preview_rows Small sample (default 20 rows)
run_sql Read-only SELECT / WITH / EXPLAIN / SHOW / DESCRIBE / PRAGMA

SQL is refused if it is not read-only, if LIMIT exceeds 5000 (default 200), or if referenced tables were not described first.

Routing:

  • Off-topic / coding → answer without SQL tools; suggest Standard Mode
  • Metrics, rank, share, trend, extrema → data-qa skill
  • Attribution, forecasts, long reports → data-attribution skill and plan mode when there is more than one analysis step

Numerical answers should state the formula, time range, grain, and filters used in that turn. There is no separate certified metrics catalog.

How it works

Composer (Data Mode only)
  └─ Data source button
        ├─ catalog HTTP API  (/api/dsh-data-mode)
        ├─ catalog.yaml      (registered sources)
        ├─ selections.yaml   (session → sourceId)
        └─ knowledge/*.json  (per-source terms)

Agent session (preset id: dsh-data)
  ├─ system prompt: selected source + recalled knowledge
  ├─ tools: list / describe / preview / run_sql  (isolated to this preset)
  └─ query engine: DuckDB (one in-memory DB per source)
                    fallbacks: node:sqlite, in-memory SQLite for XLSX
  1. Installing the plugin registers a host registrar on the web profile (no model tools on the host) and copies the user preset dsh-data into $DSH_HOME/.agent-presets/ if it is missing.
  2. Choosing Data Mode for a new session mounts the SQL tools, DuckDB provider, SQL guard, and prompt context only in that session.
  3. The web client mounts the Data source control on the composer. If the host provides a dedicated datasource seat, the button sits there; otherwise it uses the stock composer tool row so stock DSH still gets a working control.
  4. Selecting a source writes selections.yaml. The agent and the four tools can see that source only.
  5. Questions assemble context before the user message is stored: selected source plus BM25-recalled knowledge.
  6. Queries run against an isolated in-memory DuckDB per source (so table names do not collide). SQLite attaches when a local sqlite scanner extension is already present (the plugin does not auto-download extensions). Pure XLSX is loaded as in-memory tables. PostgreSQL SSL adds sslmode=require; MySQL does not use sslmode.

Install

Requires DSH web (dsh web), Node ^22.19.0 || >=24, and a new chat after install.

dsh plugin --profile web add github:tieveto666-code/dsh-data-mode

Or install a release tarball (includes compiled lib/):

dsh plugin --profile web add ./dsh-data-mode-0.1.0.tgz

Local checkout:

dsh plugin --profile web add link:/path/to/dsh-data-mode

Restart dsh web. Open a new session and choose Data Mode. Existing Standard sessions will not show the button or SQL tools.

DuckDB native addon

duckdb is optional. With the native addon, SQLite, XLSX, CSV, Parquet, PostgreSQL, and MySQL all go through DuckDB. Without it, SQLite and pure XLSX still work via Node fallbacks.

pnpm 10+ may ask whether to compile duckdb. Answer before dsh plugin add or the command will sit idle:

pnpm config set allowBuilds.duckdb true   # CSV / Parquet / Postgres / MySQL
pnpm config set allowBuilds.duckdb false  # SQLite / XLSX demos only

Or in that web profile’s pnpm-workspace.yaml:

allowBuilds:
  duckdb: true

Usage

  1. New session → Data Mode.
  2. Open Data source, register or pick a database/file. Until one source is selected, list_data_sources is empty and the agent must not invent catalog ids.
  3. Ask the question. Optional: add knowledge keys for that source so metric names match your business language.

Files on disk

Path Purpose
$DSH_HOME/data-mode/catalog.yaml Process-level source registry
<workspace>/.dsh/data-mode/catalog.yaml Workspace overlay (same id wins)
$DSH_HOME/data-mode/selections.yaml Session → selected sourceId
$DSH_HOME/data-mode/secrets.yaml Database passwords
$DSH_HOME/data-mode/knowledge/<sourceId>.json Knowledge for that source
$DSH_HOME/.agent-presets/dsh-data/ Copied user preset (created if missing, never overwritten)

Catalog field notes: examples/catalog.yaml. Uploaded files land under the workspace .dsh/data-mode/uploads/ directory.

Isolation

Install does not:

  • Change agent-presets.default
  • Patch the host agent-presets roster row
  • Register run_sql / list_data_sources on Standard, PTC, Minimal, or Creative
  • Overwrite an existing dsh-data preset directory that this package did not install

Install does:

  • Mount the registrar and catalog HTTP API on the web profile
  • Copy the Data Mode preset when absent
  • Expose SQL tools and the Data source control only in dsh-data sessions

Uninstall

dsh plugin --profile web remove dsh-data-mode

Optional: delete $DSH_HOME/.agent-presets/dsh-data. Native presets are unchanged.

Issues: github.com/tieveto666-code/dsh-data-mode/issues

Limits

  • Read-only SQL only; no INSERT / UPDATE / DELETE / DDL through the agent
  • No certified semantic layer (metrics.yaml / compiled 口径)
  • No MongoDB, Oracle, SQL Server, Snowflake, dashboards, row-level security, or streaming OLAP
  • Knowledge is lexical retrieval on keys, not a full document search engine

License

MIT © Changsheng Tie (tieveto666-code)

See LICENSE.

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-data-mode」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:tieveto666-code/dsh-data-mode

Headless(CLI)profile:

dsh plugin --profile headless add github:tieveto666-code/dsh-data-mode

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-27
备注:验证: install-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7795 个插件 →