Introduction¶
Developers of DeepSeek Harness (DSH) agents frequently need to complete data processing, statistical analysis, and result visualization within a single session. Manually invoking external tools (such as R, Python, or PSPP) disrupts the conversational flow and increases context-switching costs; calling commands directly within the conversation, on the other hand, makes it difficult to obtain structured output and visualizations. The DSH plugin ecosystem advocates the principle of “everything is a plugin,” extending the host’s capabilities to fill functional gaps. qzhengpyuan/dsh-analytics is a statistical analysis workbench plugin for DSH, equipped with a built-in GNU PSPP engine. It provides an SPSS-style interface and conversational tools, integrating data editing, syntax, output viewing, and charting into DSH’s native sidebar—enabling agents and users to collaborate on statistical tasks within the same workspace.
Plugin Overview¶
- Name: dsh-analytics
- Maintainer: qzhengpyuan
- Category: Client
- Core Value: Provides SPSS-style data editing, statistical analysis, syntax editing, and output viewing within DSH. Includes a portable PSPP engine—no separate PSPP installation required. Supports seamless integration with agent conversations, enabling smooth transitions between data modifications and result refreshes.
Core Features¶
The plugin consists of three components:
- Host (server-side): Handles process management, session workspaces, data I/O, and output parsing. Exposes an
/analyticsHTTP API and registers the workspace as ananalyticsservice. - Preset Tools: Provides 27
pspp_*tools, mounted exclusively to the “Statistical Analysis” Agent preset for agent invocation. - Client (UI): Uses
dsh-better-sidebar’sregisterTabto register a “Statistical Analysis” tab in DSH’s native right sidebar, offering SPSS-style menus, a toolbar, data view / variable view / syntax / output viewers, and analysis dialogs.
The Host and UI share the same set of Workspace methods, ensuring that user operations in dialogs and agent invocations of pspp_* tools during conversation follow the same code path—preventing state divergence.
Data Import & Editing¶
- Supports
.sav,.por(copies to~/.dsh/analytics/<sessionId>/work.sav; original file remains untouched) - Supports
.csv,.txt,.tsv(auto-detects data types) - Variable dictionary sourced from
DISPLAY DICTIONARY(name, label, measure, format, missing values, value labels) - Data view supports double-click cell editing, keyboard navigation (↑↓←→, Tab, Enter/F2, Delete, Esc)
- Variable view supports in-place editing of type/width/decimals/label/measure/alignment, variable deletion; value labels and missing value definitions take effect immediately
- Supports file merging (add cases and merge by key variables; results written back to the working file)
Statistical Analysis Procedures¶
Provides SPSS-style dialogs where checkbox options map directly to PSPP subcommands. Supported common procedures include:
- Frequencies, Descriptives, Crosstabs, Explore, Means
- Independent-Samples T-Test, One-Sample T-Test, One-Way ANOVA
- Correlations, Regression (R COEFF ANOVA CI)
- Factor Analysis, Reliability, Nonparametric Tests (Chi-Square, Binomial, K-S, Runs, Wilcoxon, Sign, Mann-Whitney, Kruskal-Wallis, Friedman)
- Graphs: Bar chart / Histogram / Scatter plot / Box plot / Line chart (SVG rendered by the plugin itself), Pie chart (with right-side legend and percentages)
Output & Export¶
- Output viewer displays tables and charts, supports CSV copy / CSV download
- File menu supports exporting tables as CSV, exporting output as HTML (tables and charts bundled), exporting output as PDF / ODT (replays the most recent run)
- Supports exporting reports, Office documents, etc. via API
Conversation Integration¶
The panel and the in-conversation agent share the same session workspace. After an agent modifies data or generates new tables via pspp_* tools, the panel refreshes within 3 seconds and displays a “PSPP has new output” notification.
Installation & Activation¶
Before installing, ensure the following environment requirements are met:
- DeepSeek Harness >= 0.2.0
- Node.js >= 20
- A profile with dsh-better-sidebar (optional in peerDependencies)
The plugin ships with a pre-compiled PSPP engine (engine/<platform>-<arch>/); no system-level PSPP installation is required.
Installation Steps (from README)¶
git clone https://github.com/qzhengpyuan/dsh-analytics.git && cd dsh-analytics
node scripts/install.mjs web # Downloads the latest Release .tgz, verifies via SHA256SUMS, prints the two steps to execute
node scripts/install.mjs web --apply # Executes installation: installs into profile + adds dsh-analytics-pspp to dsh.profile.bundles
# Then: Settings → Plugins → dsh-analytics → toggle off and on
Manual Installation (Alternative)¶
dsh plugin --profile <profile> add file:<tgz>
# Then add "dsh-analytics" to dsh.profile.bundles in ~/.dsh/profiles/<profile>/package.json
The package name on npm is dsh-analytics-pspp (since 0.122.2). You can generate a tarball via npm pack dsh-analytics-pspp@<version> as an alternative to downloading from Releases.
Typical Usage¶
- Open the “Statistical Analysis” tab in DSH’s right sidebar.
- Click the “Data” menu to open a
.csvor.savfile, or create a new dataset. - Edit variable properties and value labels in the data view or variable view.
- Select a statistical procedure from the “Analyze” menu (e.g., Descriptives, Crosstabs), set variables and options, then click OK to generate output.
- View tables and charts in the output viewer; export as CSV/HTML/PDF/ODT.
- Invoke
pspp_*tools in the conversation to modify data or run syntax—the panel will automatically refresh and notify you of new output.
Use Cases & Notes¶
- Suitable for agent scenarios that require frequent data cleaning, descriptive statistics, inferential statistics, and result visualization within a conversation.
- The plugin runs with the current DSH process permissions; verify the source code and license before installation.
- The engine resides in
engine/<platform>-<arch>/; theengine/directory is excluded from Git and rebuilt on demand.linux-x64andwin32-x64are the verified platforms; engines for other platforms are available in CI artifacts but have not been verified on actual hardware. - Data processing occurs in
~/.dsh/analytics/<sessionId>/work.sav; the original file path is only written back when you click “Save.” - Charts (bar chart, histogram, scatter plot, box plot, line chart, pie chart) are SVG-rendered by the plugin itself. If users hand-write
GRAPHorFREQUENCIES /BARCHARTin the syntax view, PSPP outputs PNG instead.
Summary¶
dsh-analytics integrates GNU PSPP and an SPSS-style interface into DeepSeek Harness, enabling agent developers to perform data and statistical analysis within a single workspace while maintaining state synchronization through the API and conversational tools. Installation requires just two commands to unlock data editing, multi-procedure statistical analysis, output viewing, and export capabilities. For more details, visit the plugin directory page and the GitHub repository.