
Timescaledb hyperfunctions
Lets your agent write analytical SQL with TimescaleDB Toolkit hyperfunctions
Timescaledb hyperfunctions is an open-source agent skill for analytics and data. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 1.9K
- Last commit
- License
- Apache-2.0
- Listing updated
Similar skills
About Timescaledb hyperfunctions
This skill gives the agent a working reference for the timescaledb_toolkit extension, covering re-aggregatable percentile sketches, statistical summaries, time-weighted averages, counter and gauge rates, heartbeat uptime, state durations, candlesticks, approximate distinct counts, top-N and downsampling. It explains the two-step pattern of building a summary with an aggregate and reading results with an accessor, so summaries can be stored in continuous aggregates and rolled up later.
The guidance includes concrete SQL examples and a list of common mistakes, such as averaging precomputed percentiles, applying counter logic to gauges, rolling up time-series summaries across entities, and building views on experimental schema objects that get dropped on extension updates. It also notes which results are approximate and which accessors exist only in function form.
Using the skill requires PostgreSQL 15 or later with TimescaleDB and the timescaledb_toolkit extension, version 1.16 or newer, with gauge_agg needing 1.25 or newer. Queries are written in SQL against the user's own tables.
When your agent uses it
Use this skill when writing analytical SQL over time-series data with the TimescaleDB Toolkit (timescaledb_toolkit extension) hyperfunctions: approximate percentiles, statistical summaries, time-weighted averages, counter/gauge rates, uptime/heartbeat tracking, state durations, OHLC candlesticks, approximate distinct counts, top-N, and downsampling. **Trigger when user asks to:** - Compute percentiles/medians/p95/p99 over large or rolled-up time-series data - Compute rates or deltas from monotonic counters (Prometheus-style) or gauges - Compute time-weighted averages or integrals over irregularly sampled data - Track uptime/downtime from heartbeats, or time spent in each state - Build OHLC/candlestick or VWAP data for financial ticks - Store re-aggregatable summaries in continuous aggregates (two-step aggregation, rollup) - Approximate COUNT DISTINCT, find top-N / most frequent values, or downsample for charts **Keywords:** timescaledb_toolkit, hyperfunctions, percentile_agg, uddsketch, tdigest, approx_perc
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (21 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the pg plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add timescale/pg-aiguide
/plugin install pg@aiguideOr copy only this skill to ~/.claude/skills/timescaledb-hyperfunctions:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/timescaledb-hyperfunctions &&
cp -R "$tmp/skills/timescaledb-hyperfunctions" ~/.claude/skills/timescaledb-hyperfunctions &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/timescaledb-hyperfunctions inside it instead.
Copy the skill folder to ~/.agents/skills/timescaledb-hyperfunctions to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/timescaledb-hyperfunctions &&
cp -R "$tmp/skills/timescaledb-hyperfunctions" ~/.agents/skills/timescaledb-hyperfunctions &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/timescaledb-hyperfunctions inside it instead.
Copy the skill folder to ~/.cursor/skills/timescaledb-hyperfunctions to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/timescaledb-hyperfunctions &&
cp -R "$tmp/skills/timescaledb-hyperfunctions" ~/.cursor/skills/timescaledb-hyperfunctions &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/timescaledb-hyperfunctions inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/timescale/pg-aiguide.git --path skills/timescaledb-hyperfunctionsOr copy the folder to ~/.gemini/skills/timescaledb-hyperfunctions yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/timescaledb-hyperfunctions:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/timescaledb-hyperfunctions &&
cp -R "$tmp/skills/timescaledb-hyperfunctions" ~/.copilot/skills/timescaledb-hyperfunctions &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/timescaledb-hyperfunctions inside it instead.
Get the folder:
git clone --depth 1 https://github.com/timescale/pg-aiguide.gitThen copy pg-aiguide/skills/timescaledb-hyperfunctions into your agent's skills folder as timescaledb-hyperfunctions. Agents that support SKILL.md read one folder per skill.
What it does
- Re-aggregatable percentiles
- Covers percentile sketches that can be stored and combined later to get p50, p95 or p99 across rolled-up data.
- Counter and gauge rates
- Explains computing deltas and rates from resetting counters and from gauges that move both ways.
- Time-weighted averages
- Shows how to weight values by how long they applied, for irregularly sampled readings.
- Uptime and state tracking
- Covers heartbeat-based uptime, outage ranges and time spent in each state.
- Continuous aggregate patterns
- Shows storing summaries in continuous aggregates and rolling them up hierarchically from hourly to daily.
- Candlesticks and top-N
- Provides OHLC and VWAP calculations for ticks, plus approximate distinct counts and top-N queries.
Good for
- Compute p95 and p99 latency per service in five-minute buckets
- Calculate per-second request rates from a Prometheus-style byte counter
- Find how long each machine spent in the running or error state each day
- Build hourly OHLC candles and VWAP from raw trade ticks
- Store daily summaries and roll them up into a fleet-wide percentile
Timescaledb hyperfunctions FAQ
What does the skill require to be installed?
PostgreSQL 15 or later with TimescaleDB and the timescaledb_toolkit extension, version 1.16 or newer; gauge_agg needs version 1.25 or newer.
Which functions should be used in persistent objects?
Only functions from the default schema. Anything in toolkit_experimental can change between releases, and extension updates drop views and continuous aggregates that depend on it.
Are the results exact?
Percentiles, tdigest, hyperloglog and mcv_agg results are approximate; the skill says to report this when precision matters.
When should gauge_agg be used instead of counter_agg?
Use counter_agg for values that only fall on restarts, and gauge_agg when drops are real changes such as memory being freed.
How do I install Timescaledb hyperfunctions in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/timescaledb-hyperfunctions to use it in all your projects, or to .claude/skills/timescaledb-hyperfunctions in one project. Or install the pg plugin, which includes it: /plugin marketplace add timescale/pg-aiguide, then /plugin install pg@aiguide.
Does Timescaledb hyperfunctions run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Timescaledb hyperfunctions?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Timescaledb hyperfunctions?
The closest alternatives to Timescaledb hyperfunctions are Data analysis, Data analysis, Duo proprietary data reports, Kql and Famou data analysis.
Where this comes from
- Description: from the skill's own SKILL.md.
More from timescale/pg-aiguide

Guides an agent in designing PostGIS spatial tables, types, SRIDs and indexes
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through PostgreSQL table design, types, constraints and indexing
- Open source
- 1.9K GitHub stars
- Databases

Scores existing PostgreSQL tables to find which should become TimescaleDB hypertables
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through converting PostgreSQL tables into TimescaleDB hypertables safely
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through pgvector setup, HNSW indexing and tuning for semantic search
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through PostgreSQL schema design, indexing, search, TimescaleDB
- Open source
- 1.9K GitHub stars
- Databases





