TDgpt is a time-series analysis agent that works with TDengine’s core taosd process. It brings statistical analysis, machine learning, foundation models, and LLM adapters into SQL-driven analysis workflows without embedding those workloads directly into the database core.
Architecture overview
TDgpt uses a stateless platform design consisting of multiple stateless analysis nodes (Anodes). Key advantages: horizontal scaling on demand, and the ability to deploy algorithms on appropriate hardware: GPU nodes for deep learning workloads, CPU nodes for statistical analysis. As an external agent, it communicates with the database core process through standardized interfaces without intruding on core logic, preserving system stability and maintainability. If one analysis node fails, other nodes can continue serving analysis workloads, depending on deployment capacity and routing.
Four functional modules
1. Built-in analysis libraries
- statsmodels: ARIMA, seasonal decomposition, hypothesis testing
- pyculiarity: Anomaly detection based on Twitter’s open-source algorithm
- pmdarima: Automated ARIMA parameter selection and fitting
These cover most common time-series data analysis scenarios with no additional dependency installation required.
2. Built-in machine learning libraries
- PyTorch: Custom neural network models
- Keras: Rapid prototype development
- scikit-learn: Traditional machine learning algorithms (regression, classification, clustering)
For predictive maintenance, PyTorch can be used to build LSTM models for trend prediction on equipment vibration data.
3. General LLM request adapter
Supports sending requests to MaaS platforms such as DeepSeek and LLaMa, letting users call large language model capabilities directly through SQL. This can be used for generating natural language descriptions of analysis reports or explaining the business meaning of anomaly detection results.
4. Time-series data model adapter
Supported models include:
- Time-MoE: A time-series prediction model based on a mixture-of-experts architecture
- TDtsfm: TDengine’s in-house time-series foundation model
- TimeGPT: The first general-purpose pre-trained model for time series
Users can access different model capabilities through a unified SQL interface.
Time-series data analysis services
Anomaly detection: Implemented through the ANOMALY_WINDOW function. It can detect patterns that fixed-threshold alerting may miss, including gradual anomaly trends.
Predictive analysis: Provided through the FORECAST function, supporting specified time ranges and confidence intervals.
Data imputation: Detects missing data points and fills them using interpolation or prediction methods. Data completeness directly affects the accuracy of downstream analysis.
Data classification: Currently in development and testing. Future releases will support identifying equipment operating modes, working states, and other patterns.
Custom algorithm extensions
Users can add custom analysis algorithms written in Python and invoke them directly through SQL.
Model evaluation tools
The enterprise edition provides a comprehensive model evaluation tool covering accuracy, recall, F1 score, and other evaluation dimensions.
Summary
TDgpt extends TDengine TSDB with SQL-accessible analysis capabilities, from classical statistics to deep learning and time-series foundation models. Its stateless architecture supports scalable deployments, while custom Python extensions give teams a path for domain-specific algorithms.


