Introduction¶
In DeepSeek Harness (DSH), a “everything is a plugin” agent runtime environment, developers often need to let agents use local professional tools. Math calculation is a common scenario: the agent needs to hand a Mathematica expression to a local Wolfram environment for execution and retrieve the standard output, without having to maintain a set of process calls and result parsing within the task itself.
Below is an introduction to the dsh-wolfram plugin. It wraps the local wolframscript command into a tool callable by DSH, suitable for scenarios requiring the invocation of Wolfram Mathematica or Wolfram Engine. The plugin directory mentioned here is an independent community site and is not equivalent to the official app store.
What is this¶
dsh-wolfram is a DSH plugin with the repository path hatter123/dsh-wolfram.
It is used to call Wolfram Mathematica or the free Wolfram Engine from DeepSeek Harness, registering a tool named wolfram to run Mathematica code and return the results.
Core Capabilities¶
Verified capabilities of dsh-wolfram include:
- Registering a
wolframtool. - Running Mathematica code via
wolframscriptand returning the results. - Supporting Wolfram Mathematica or Wolfram Engine.
- Using Node’s built-in
child_processmodule. - Having no npm dependencies.
- Executing expressions in the form
wolframscript -code <expression>and capturing standard output.
Installation and Usage¶
First, confirm that Wolfram Mathematica or Wolfram Engine is installed on your local machine and that the wolframscript command is usable. You can verify this by running the following command:
wolframscript -code "Integrate[Cos[x], x]"
If the command returns Sin[x], it indicates that the local wolframscript is available.
Then install dsh-wolfram:
dsh plugin --profile web add dsh-wolfram
The plugin declares a peer dependency on @deepseek-ai/dsh-tools:
>=0.0.1-rc.1 <0.1.0 || >=0.1.0-rc.1 <0.2.0-0
The plugin also bundles a patch file:
./cordis.patch.yml
Typical Usage¶
When an agent calls the wolfram tool, it only needs to pass an expression parameter, where the parameter value is a string of Mathematica code.
Common examples are as follows:
- integral:
Integrate[Cos[x], x]→Sin[x] - solve:
Solve[x^2 - 1 == 0, x]→{{x -> -1}, {x -> 1}} - limit:
Limit[Sin[x]/x, x -> 0]→1 - series:
Series[Exp[x], {x, 0, 3}]→1 + x + x^2/2 + x^3/6 + O[x]^4
With the steps above, the agent can execute Mathematica expressions as part of the tool call and use the captured standard output as the result.
Use Cases and Notes¶
Suitable scenarios for using dsh-wolfram:
- Wolfram Mathematica or Wolfram Engine is installed locally.
- The local machine can use the
wolframscriptcommand. - Need to call Mathematica expressions in DSH agent tasks.
- Want the plugin to remain lightweight without introducing extra npm dependencies.
Usage notes:
- The plugin invokes the local command via Node’s
child_processmodule, so the execution permissions are consistent with the current DSH process. - It is recommended to check the source code, license, and patch file before installation.
- The plugin license is MIT.
- The plugin depends on the local command; if the target environment cannot run
wolframscript, it cannot be used directly.
Links¶
- Plugin Directory:
https://www.skillhub.cn/plugins/hatter123/dsh-wolfram - GitHub:
https://github.com/hatter123/dsh-wolfram