Skip to main content

Graphsignal Context Client

CLI for Graphsignal: login (store API key), query signal summary and signal context, and fetch signal guide content from Graphsignal API. You can also install a skill so your AI coding agent (Cursor, Claude Code, Codex, etc.) can run the CLI and use the returned context to help optimize inference, profiles, or errors.

Install

pip install graphsignal-context

Or install as an isolated CLI tool with uv:

uv tool install graphsignal-context

Usage

Login

Store your Graphsignal API key in ~/.graphsignal/config.yml:

graphsignal-context login

You will be prompted for your API key.

You can also set credentials via environment variable:

export GRAPHSIGNAL_API_KEY=<your_api_key>

Optionally override API endpoint (for local/self-hosted testing):

export GRAPHSIGNAL_API_BASE=http://signal-api:8080

Summary

Query the pre-computed signal summary (performance analysis) for a time range: engine info and all engine metrics reduced to scalars with trend hints, host info and metrics, traffic and latency stats, GPU time by kernel class, GPU memory and NVML metrics, prefill/decode phases, bottleneck findings, anomalies, and grouped errors. Requires being logged in.

The summary describes a single engine run: --tags must include the run.uid tag (set automatically by the profiler per engine process launch), otherwise the API returns an error. Find values in meta.available_tags of a signals response.

graphsignal-context summary --start 2026-03-10T00:00:00Z --end 2026-03-12T00:00:00Z --tags "run.uid:1a2b3c4d5e6f"

Additional tag filters (after run.uid) work the same as for signals. The command calls GET /api/v1/context/summary/ and prints the response summary as JSON. The summary is small and scalar-only — start with it, and fetch full signals context to drill down.

Signals

Query signal context for a time range. Requires being logged in.

graphsignal-context signals --start 2026-03-10T00:00:00Z --end 2026-03-12T00:00:00Z

Optional --tags filter (semicolon-separated key:value pairs). Tags must match exactly the tags sent to Graphsignal when the app was instrumented:

graphsignal-context signals --start 2026-03-10T00:00:00Z --end 2026-03-12T00:00:00Z --tags "env:prod"

The command calls GET /api/v1/context/signals/ on GRAPHSIGNAL_API_BASE (or https://api.graphsignal.com by default) with start_time_ns, end_time_ns, and optional tags, and prints the response context.

Guide

Fetch guide content about signals.

graphsignal-context guide

The command calls GET /api/v1/context/guide/ on GRAPHSIGNAL_API_BASE (or https://api.graphsignal.com by default) and prints the returned text.


AI agent integration

Install the Graphsignal skill so your AI coding agent can run graphsignal-context summary and graphsignal-context signals for a time range and use the returned findings and context (profiles, errors, traces) to help you optimize.

Claude Code — Clone the repo into Claude's personal skills directory:

git clone https://github.com/graphsignal/graphsignal-context ~/.claude/skills/graphsignal-context

Other agents (Cursor, Codex, Gemini) — Use the skills.sh registry:

npx skills add graphsignal/graphsignal-context

Install the CLI first (pip install graphsignal-context or uv tool install graphsignal-context), then run graphsignal-context login with your API key.

Supported agents

  • Cursor — Use the skill when working in Cursor with agent/composer.
  • Claude Code — Use with Claude Code (e.g. via Claude CLI or supported IDEs).
  • Codex — Use with Codex agent workflows.
  • Gemini CLI — Use with Gemini from the command line.

Example prompts

Once the skill is installed, you can ask the agent to:

  • Find the root cause of a latency spike — e.g. "Fetch Graphsignal data for the last 2 hours and find the root cause of the latency spike" or "What's causing the slowdown? Use Graphsignal signal context from 10am to noon today."
  • Explain errors or failures — e.g. "Get signal context for the last 24 hours and summarize any errors or failures" or "Why did inference fail around 3pm? Pull Graphsignal data for that window."
  • Inspect profiles and bottlenecks — e.g. "Get Graphsignal context for yesterday and identify the main performance bottlenecks" or "Which operations are taking the most time? Use Graphsignal data from the last 6 hours."

The agent will call graphsignal-context signals to discover run.uid values in meta.available_tags, then graphsignal-context summary --start <ISO> --end <ISO> --tags "run.uid:<uid>" to get findings and stats, drilling into full-resolution signals context when needed.

Metadata

Release files for graphsignal-context 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphsignal-context 0.1.6
File Size Uploaded
graphsignal_context-0.1.6.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphsignal-context 0.1.6
File Interpreter ABI Platform
graphsignal_context-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / graphsignal_context-0.1.6.tar.gz

Download URL graphsignal_context-0.1.6.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6dcec4ef57c9ae4e96005367234a7b53aa5646925b3b23a676b888f954630404
BLAKE2b-256 checksum
How to use checksums
0aceb710c2b8fe0759a0b5dc3dc5816fc8fb98cc4083ba9c75034098005a6e7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1020-azure

Release files / graphsignal_context-0.1.6-py3-none-any.whl

Download URL graphsignal_context-0.1.6-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5820482b7242166af518cee90c752316991d0dbc5becd61c3812ffbb79d5f883
BLAKE2b-256 checksum
How to use checksums
4c73818bf32d3544b0a73d51af73bbd2df4d14cacb3d95f36929ed966cd75fa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.10.20 Linux/6.17.0-1020-azure

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page