In industrial IoT, fintech, and intelligent operations, time-series databases have become core infrastructure. As data volumes grow, organizations want more than storage and fast queries. They want deeper insight: forecasts, anomaly patterns, and automatic gap filling, all without stitching together a separate data pipeline.
TDengine addresses this with TDgpt, an AI analysis agent built into the database kernel. Users run time-series forecasting, anomaly detection, and data imputation with a single SQL statement. No data export, no separate training pipeline, no Python scripts.
Where TDgpt fits
TDgpt is an AI analysis engine embedded inside the time-series database, not a standalone tool that sits outside it. The traditional analytics workflow forces teams to export data, clean it, engineer features, and train models across multiple systems. That process is slow, fragile, and introduces problems with data consistency, security, and latency.
TDgpt runs AI tasks directly inside the database. Data never leaves the database between storage and analysis. No machine learning expertise is required. The interface is SQL.
Core capabilities
Forecasting
TDgpt uses deep learning to learn temporal dependencies from historical data and predict future trends. Typical targets include sensor readings, server resource usage, and business metrics. Its automatic feature engineering identifies periodicity, trends, and seasonality without manual configuration. Users do not need to choose window sizes, normalize inputs, or tune model hyperparameters.
Anomaly detection
Rather than relying on static thresholds, TDgpt learns the normal distribution of data and flags deviations from it. This adaptive approach tracks shifting baselines as operating conditions change, producing fewer false positives and fewer missed anomalies than fixed-threshold alerting.
Data imputation
Sensor networks have gaps. Devices disconnect, networks drop packets, and storage buffers overflow. TDgpt fills missing values by inferring them from surrounding context, preserving the continuity of downstream dashboards and reports.
One SQL statement for AI analysis
The interface is the headline feature: one SQL statement replaces what traditionally took hours or days of pipeline work.
Forecasting:
SELECT _irowts, FORECAST(i, 'algo=tdtsf,period=100')
FROM meter
WHERE ts >= '2024-01-01' AND ts < '2024-06-01';
The FORECAST function specifies the tdtsf algorithm and projects 100 time steps forward. The query reads historical data from the first half of 2024 and returns predicted values for the subsequent periods.
Anomaly detection:
SELECT _irowts, ANOMALY(i, 'algo=tdtsad,sensitivity=0.95')
FROM server_metrics
WHERE ts >= '2024-01-01' AND ts < '2024-02-01';
The ANOMALY function applies the tdtsad algorithm with a sensitivity of 0.95. Higher sensitivity catches subtler anomalies; lower values reduce false positives. The query returns timestamps and anomaly scores for the specified time range.
This SQL-driven approach removes the barrier between data engineering and data science. Anyone who can write a SELECT statement can run AI analysis on time-series data.
Technical architecture
TDgpt integrates Transformer architectures and time-series decomposition networks. Models come pre-trained on large-scale datasets, providing strong generalization out of the box.
The auto feature engineering pipeline can decompose each series into trend, seasonal, and residual components. It selects suitable features and handles normalization and windowing internally. In traditional ML projects, data preparation consumes much of the project effort. TDgpt handles much of this workflow internally.
TDgpt follows a Model-as-a-Service architecture. Pre-trained models reside on the database server and inference runs inside the process, avoiding data transmission latency. The system supports incremental training and fine-tuning when higher precision is needed for a specific deployment.
Application scenarios
Equipment failure prediction. In manufacturing and industrial IoT, unplanned downtime is expensive. TDgpt predicts the remaining useful life of components from historical sensor trends, letting maintenance teams intervene before failure rather than after it.
Energy consumption forecasting. In energy management and smart buildings, TDgpt analyzes historical consumption alongside time of day, weather data, and production schedules to project future demand. Operators can adjust procurement and equipment scheduling against these forecasts.
Business metrics monitoring. In internet services and finance, TDgpt monitors traffic, transactions, and user activity in real time. Instead of fixed thresholds that trigger on every daily peak, the adaptive anomaly detection learns what normal looks like for each metric and flags only real deviations.
Advantages over traditional approaches
No data export. Analysis runs inside the database. Data never leaves the controlled environment, which is both more secure and more efficient than extracting it to an external pipeline.
No separate model training. Pre-trained models work out of the box. What traditionally took weeks of data preparation and model development can be operational in minutes.
Zero-code AI. The SQL interface means anyone who knows SQL can use it. There is no Python notebook, no feature engineering script, and no model serving infrastructure to maintain.
Where this helps
TDgpt changes what time-series databases do. They are no longer just storage and query engines. They are becoming intelligent data platforms where analysis runs alongside the data. For organizations that already store sensor data or business metrics in TDengine, one SQL statement is all it takes to start using AI-powered analysis.


