Introduction¶
In DSH agent workflows, models frequently need to handle expression evaluation, unit conversion, matrix determinants, or complete tasks such as differentiation, integration, factorization, and equation solving. Relying on external scripts or switching to other tools every time would interrupt the conversation flow.
Below is an introduction to dsh-math. It is a scientific computing plugin for DeepSeek Harness that registers a math tool, allowing agents to perform numerical calculations and symbolic algebra processing directly within the conversation.
What is this¶
hatter123/dsh-math is a DSH plugin licensed under the MIT license. It integrates numerical calculation, matrices, units, statistics, and symbolic calculus/CAS capabilities into DSH conversations.
The plugin registers a math tool with the following parameters:
operation: The mathematical operation to performexpression: The expression to processvariable: Optional variable for operations like differentiation and integration
Core Features¶
dsh-math provides the following verified operations:
| operation | Description | Engine |
|---|---|---|
eval |
Numerical expressions: units, matrices, statistics, complex numbers, large numbers | mathjs |
simplify |
Simplify expressions | Algebrite |
expand |
Expand expressions | Algebrite |
factor |
Polynomial factorization | Algebrite |
derivative |
Differentiate with respect to a variable | Algebrite |
integral |
Symbolic indefinite integration | Algebrite |
solve |
Find roots of a polynomial | Algebrite |
The numerical calculation part is handled by mathjs, covering units, matrices, statistics, complex numbers, and large numbers. The symbolic algebra part is handled by Algebrite, covering simplification, expansion, factorization, differentiation, integration, and equation solving.
Installation and Usage¶
Install from npm:
dsh plugin --profile web add dsh-math
After execution, the plugin will enable the math tool in the current DSH profile.
Before installation, you should check the source code, dependencies, and license. The plugin runs under the permissions of the current dsh process and can access local resources and configuration that the process can access.
If installing via git, the command provided in the README is a placeholder:
dsh plugin --profile web add github:owner/dsh-math
The README states that git installation requires the repository’s prepare script to build, or a fixed commit.
Typical Usage¶
When an agent needs to perform calculations, it calls the math tool. Below are the examples listed in the README.
Determinant:
det([[1,2],[3,4]]) → -2
Unit conversion:
5 cm to inch → 1.9685039370078743 inch
Large number calculation:
2^100 → 1.2676506002282294e+30
Differentiation:
derivative(x^2, x) → 2*x
Indefinite integration:
integral(x^2, x) → 1/3*x^3
Polynomial root finding:
roots(x^2 - 3x + 2) → [1,2]
Use Cases and Notes¶
dsh-math is suitable for scenarios where mathematical calculations, formula derivation, unit conversion, and equation solving need to be completed directly within DSH conversations.
Usage notes:
- First, confirm that the current DSH environment meets the plugin’s dependency requirements.
- The plugin declares a peer dependency of:
@deepseek-ai/dsh-tools >=0.0.1-rc.1 <0.1.0 || >=0.1.0-rc.1 <0.2.0-0
- The package contains a patch configuration:
./cordis.patch.yml
- Do not treat the installation of the plugin as trusted code automatically executing. It is recommended to read the source code, dependencies, and license before installation.
- The plugin directory is a source for community plugin leads and should not be interpreted as the DeepSeek official app store.
Links¶
- GitHub Repository: https://github.com/hatter123/dsh-math
- Directory page URL in plugin leads: https://www.skillhub.cn/plugins/hatter123/dsh-math (Unverified, please verify yourself before use)