DeepSeek Harness (DSH) adopts a modular plugin architecture. When building agents, implementing complex mathematical logic directly in code is often inefficient and unstable. The xby-math plugin provides a dedicated mathematical calculation protocol server, aiming to decouple complex mathematical operation logic from the agent’s reasoning workflow and offer standardized calculation interfaces.

What This Is

xby-math is a DSH plugin maintained by xby-skill. It is a high-performance mathematical calculation protocol server that supports comprehensive functionality from basic arithmetic to advanced calculus, linear algebra, statistics, and financial calculations. The plugin relies on SymPy for symbolic computation and Polars for data processing.

Core Features

The plugin provides the following core capabilities:

  1. Basic Arithmetic and Functions
    Use SymPy to evaluate mathematical expressions. Supports arithmetic operations, trigonometric functions, logarithms, exponentials, constants (pi, e), and functions such as absolute value and square root. Supports variable substitution.

  2. Percentages and Numeric Processing
    Supports percentage calculations, including finding percentages (of), increasing, decreasing, and rate of change.
    Supports advanced rounding operations, including round (rounding), floor (rounding down), ceil (rounding up), and trunc (truncation).

  3. Unit Conversion
    Supports conversions between angular units, primarily degrees and radians.

  4. Array Operations and Transformations
    Based on Polars, provides element-wise operations between arrays or scalars, including addition, subtraction, multiplication, division, and exponentiation. Supports data preprocessing transformations such as normalization, standardization, and logarithmic transformation.

  5. Array Statistics and Aggregation
    Provides statistical calculations for columns/rows/overall data (mean, standard deviation, etc.). Supports aggregation operations such as weighted average, dot product, and Sumproduct.

  6. Data Analysis
    Provides comprehensive statistical analysis, including descriptive statistics, quartiles, and outlier detection (IQR method).
    Supports creating pivot tables.
    Supports computing correlation coefficient matrices between variables (Pearson, Spearman).

  7. Financial Calculations
    Supports time value of money (TVM) calculations, capable of solving for present value (PV), future value (FV), annuity payment (PMT), interest rate, or internal rate of return (IRR).

Installation and Enablement

Official installation commands are not currently provided. Users can manually integrate it via source code or directory links.

Typical Usage

The following are some verified usage examples:

// 基础算术
2 + 2
sin(pi/2)

// 变量代入
x^2 + 2*x + 1, variables={"x": 3}

// 百分比计算
15% of 200
// 结果: 30

// 高级四舍五入
round(3.14159, 2)
// 结果: 3.14

// 单位转换
convert_units(value=180, from_unit="degrees", to_unit="radians")
// 结果: 3.14159... (π)

// 数组元素操作
array_operations(operation="multiply", array1=[[1,2],[3,4]], array2=2)

// 数据透视表
pivot_table(index="region", columns="product", values="sales", aggfunc="sum")

Use Cases and Notes

The plugin is suitable for agent scenarios that require handling mathematical logic, data analysis, or financial calculations. The plugin runs with the permissions of the current DSH process. Because the license is MIT, it can be used freely subject to agreement terms. It is recommended to check the source code before use to confirm compatibility.

Summary

xby-math encapsulates the capabilities of SymPy and Polars to provide DSH agents with a standardized entry point from basic arithmetic to complex data analysis. Its auto-persisted API key configuration mechanism also reduces setup costs. For more details, see the GitHub repository or the skill directory.