Introduction

DeepSeek Harness advocates a “everything-is-a-plugin” extension approach. When complex local computation is required, calling a remote API directly is often insufficient. SymPy-Calculate provides a local tool based on the minimal preset, enabling the Agent to run SymPy code directly on the host machine.

Plugin Introduction

  • Name: SymPy-Calculate
  • Maintainer: 11350613
  • Category: Workflow
  • License: MIT

This plugin adds a stateless tool sympy_calculate. It launches a new process in the local SymPy development checkout directory to perform calculations on a complete Python script.

Core Capabilities

  • Adds the stateless tool sympy_calculate.
  • Runs complete Python scripts in the local SymPy checkout.
  • Each invocation has a 120-second timeout.
  • stdout and stderr output are each limited to 2,000,000 characters.

Environment Requirements

  • DeepSeek Harness: 0.2.0-rc.2
  • Node.js: ^22.19.0 or >=24.0.0
  • SymPy: Local checkout (default path is ~/sympy-dev/sympy)
  • Python: 3.x, with venv and pip support required
  • Platform: Tested on Ubuntu 24.04.4 LTS.

Installation and Configuration

Before installation, configure the local SymPy environment first. The setup steps are as follows:

  1. Install the venv tools (if missing):
    sudo apt install -y python3-venv python3-pip
  1. Create the SymPy checkout directory and clone the repository:
    mkdir -p ~/sympy-dev
    git clone https://github.com/sympy/sympy.git ~/sympy-dev/sympy
  1. Create a virtual environment and install SymPy:
    python3 -m venv ~/sympy-dev/sympy/venv
    ~/sympy-dev/sympy/venv/bin/python -m pip install -e ~/sympy-dev/sympy
    echo 'venv/' >> ~/sympy-dev/sympy/.git/info/exclude
  1. (Optional) Configure environment variables. By default, ~/sympy-dev/sympy is used as the root directory, and the interpreter is resolved in priority order to venv/bin/python or python3. To customize, set SYMPY_ROOT and SYMPY_PYTHON in the environment variables used when starting Harness.

After configuration is complete, install the DSH plugin. The plugin must be installed in the web profile:

npx --yes @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add https://codeload.github.com/11350613/SymPy-Calculate/tar.gz/v1.0.4

Usage Example

sympy_calculate accepts a JSON object containing a complete Python script. Each invocation starts a new interpreter process, so it is recommended to combine related batch calculations into a single script.

Input:

{
  "code": "from sympy import *\n\nx = symbols('x')\nprint(integrate(x**2 / (1 + x**4), (x, -oo, oo)))"
}

Output:

sqrt(2)*pi/2

Caveats

  • Security: sympy_calculate executes arbitrary Python code with the current user’s privileges and inherits environment variables. It is not sandboxed. Use it only in sessions with trusted models and permission policies.
  • Platform: The plugin has been tested on Ubuntu 24.04.4 LTS; compatibility issues may exist on other platforms.
  • Output handling: stdout and stderr are merged into the output. If the script exits with a non-zero exit code, the tool treats it as an error.
  • Performance: Because each invocation starts a new process, importing SymPy incurs overhead.