Nixtla Anomaly Detector

by intent-solutions-io

skill

|

Skill Details

Repository Files

2 files in this skill directory


name: nixtla-anomaly-detector description: | Detects anomalies in time series data using TimeGPT. Identifies outliers, level shifts, and trend breaks without model training. Use when identifying anomalies, outliers, or unusual patterns in time series. Trigger with "detect anomalies", "find outliers", "anomaly detection". allowed-tools: "Read,Write,Bash,Glob,Grep" version: "1.0.0"

Nixtla Anomaly Detector

Automatically detect and flag anomalies in time series data using TimeGPT.

Overview

This skill leverages TimeGPT's anomaly detection capabilities to identify outliers, level shifts, and trend breaks in time series data without requiring model training. It accepts CSV data, runs anomaly detection via the Nixtla API, and produces a detailed report with visualizations.

Prerequisites

Required:

  • Python 3.8+
  • nixtla, pandas, matplotlib packages

Environment Variables:

  • NIXTLA_TIMEGPT_API_KEY: Your TimeGPT API key

Installation:

pip install nixtla pandas matplotlib

Instructions

Step 1: Prepare Input Data

Ensure your CSV file has the required Nixtla schema columns:

Column Type Description
unique_id string Series identifier
ds datetime Timestamp
y numeric Value to analyze

Step 2: Set API Key

export NIXTLA_TIMEGPT_API_KEY=your_api_key_here

Step 3: Run Anomaly Detection

Execute the detection script:

python {baseDir}/scripts/detect_anomalies.py --input your_data.csv

Available options:

  • --input, -i: Input CSV file (required)
  • --output-csv, -o: Anomaly output CSV (default: anomalies.csv)
  • --output-plot, -p: Visualization plot (default: anomalies_plot.png)
  • --output-summary, -s: Summary text file (default: anomaly_summary.txt)

Step 4: Review Results

The script generates three output files:

  1. anomalies.csv - Detailed anomaly records
  2. anomalies_plot.png - Visual highlighting of anomalies
  3. anomaly_summary.txt - Summary counts by type

Output

  • anomalies.csv: Contains detected anomalies with timestamps, values, and anomaly types (outlier, level_shift, trend_break)
  • anomalies_plot.png: Time series visualization with anomalies highlighted in red
  • anomaly_summary.txt: Human-readable summary of detection results

Error Handling

  1. Error: NIXTLA_TIMEGPT_API_KEY not set Solution: Run export NIXTLA_TIMEGPT_API_KEY=your_key

  2. Error: CSV file missing required columns Solution: Ensure CSV has unique_id, ds, and y columns

  3. Error: No anomalies detected Solution: This is valid output - data may have no anomalies

  4. Error: Connection error to TimeGPT API Solution: Check network connection and API key validity

Examples

Example 1: Detect outliers in website traffic

Input (traffic.csv):

unique_id,ds,y
website_1,2024-01-01,1000
website_1,2024-01-02,1050
website_1,2024-01-03,300
website_1,2024-01-04,980

Command:

python {baseDir}/scripts/detect_anomalies.py --input traffic.csv

Output (anomalies.csv):

unique_id,ds,y,anomaly_type
website_1,2024-01-03,300,outlier

Example 2: Identify trend break in sales data

Input (sales.csv):

unique_id,ds,y
store_1,2023-12-28,50
store_1,2023-12-29,55
store_1,2023-12-30,60
store_1,2023-12-31,150
store_1,2024-01-01,145

Command:

python {baseDir}/scripts/detect_anomalies.py -i sales.csv -o sales_anomalies.csv

Output: Detects trend break at 2023-12-31

Resources

Related Skills

Attack Tree Construction

Build comprehensive attack trees to visualize threat paths. Use when mapping attack scenarios, identifying defense gaps, or communicating security risks to stakeholders.

skill

Grafana Dashboards

Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces.

skill

Matplotlib

Foundational plotting library. Create line plots, scatter, bar, histograms, heatmaps, 3D, subplots, export PNG/PDF/SVG, for scientific visualization and publication figures.

skill

Scientific Visualization

Create publication figures with matplotlib/seaborn/plotly. Multi-panel layouts, error bars, significance markers, colorblind-safe, export PDF/EPS/TIFF, for journal-ready scientific plots.

skill

Seaborn

Statistical visualization. Scatter, box, violin, heatmaps, pair plots, regression, correlation matrices, KDE, faceted plots, for exploratory analysis and publication figures.

skill

Shap

Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model

skill

Pydeseq2

Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.

skill

Query Writing

For writing and executing SQL queries - from simple single-table queries to complex multi-table JOINs and aggregations

skill

Pydeseq2

Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.

skill

Scientific Visualization

Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.

skill

Skill Information

Category:Skill
Version:1.0.0
Allowed Tools:Read,Write,Bash,Glob,Grep
Last Updated:12/10/2025