Skip to main content

Overview

An Artifact is a self-contained HTML page that your coding agent builds from your Latitude data: a one-off report that answers a specific question, or a KPI dashboard you reopen every morning with fresh numbers. Latitude doesn’t ship a dashboard builder. Instead, everything you see in the Latitude web app is exposed as operations over the MCP, the CLI, the API and the SDKs: traces, sessions, spans, tools, users, memory, signals, incidents, experiments, saved searches, and a composable analytics query on top of all of it. You ask your agent a question, the agent makes the calls, renders the page and writes the findings. Latitude provides the data; the agent provides the page. You may never need to open the Latitude web app.
Install the latitude-artifacts skill so your agent asks the right questions, pulls the right data and renders every artifact in the same Latitude design language, with light and dark themes:

Three ways to build one

The page is the same in all three. It embeds the data as a JSON blob, so a refresh never touches the layout, and it never calls the Latitude API from the browser. Refreshable artifacts need an API key in the environment.

Example prompts

Paste any of these into an agent connected to the Latitude MCP (or with the CLI authenticated). Each one gives the agent a question, a window and a target; the latitude-artifacts skill fills in the rest, and asks a couple of short questions when something is unclear.

One-off reports

Refreshable dashboards

What the agent can query

Every read below is one operation with the same name on the MCP, the CLI, the API and the SDKs: the MCP tool listTools is latitude tools list on the CLI, GET /v1/projects/{projectSlug}/tools on the API and client.tools.list(...) in the SDKs. The agent reads each operation’s schema before calling it; the live catalog is the API reference. All of these are read-only. The write operations (creating signals, monitors, datasets, annotations) are available to the same agent, so an artifact can end with an action: “create a monitor on this” or “save this search”.

The aggregate query: queryAnalytics

Most tiles and charts in an artifact are one queryAnalytics call: a metric over a filtered stream, optionally split by a breakdown and bucketed over time.
  • Metric: the number each row reduces to (count, errorRate, percentile(duration), sum(cost), …).
  • Breakdown: the dimension to split across, one row per value (model, tool, signalId, …).
  • Time bucket: optional granularity (hour, day, week) that turns a number into a trend.
“Error rate by model, weekly” is metric errorRate × breakdown model × bucket week. Swap any axis for the next chart; there is no new endpoint to learn. Values come back in human units: duration in seconds, cost in dollars, rates (errorRate, cacheHitRate, passRate) as a 0–1 fraction. Opaque breakdown keys such as signalId and cluster carry a human label. filters accepts the same DSL as listTraces (see Filters).
Each returns a tidy series, [{ key?, label?, bucketStart?, value }], small enough to embed inline no matter how many traces it spans. For a “versus the previous period” delta, the agent runs the same query with the range shifted back and computes the difference.

Row-level widgets

For a “top 10 slowest tool calls” table, the agent needs rows rather than an aggregate. querySpans lists individual spans across traces; listTraces and listSessions do the same at trace and session grain.
Row-level responses use wire units: traces carry durationNs and costTotalMicrocents, while spans carry costTotalMicrocents plus startTime and endTime, so a span’s duration is the difference between the two timestamps. The skill normalizes all of it to seconds and dollars before rendering. Row-level data can also carry conversation content, so the skill embeds ids and summaries by default and links to the trace in Latitude rather than copying the messages.

A worked example: memory

“How are users interacting with my agent’s memory?” becomes five questions, each mapped to an operation: The agent renders those five widgets, then writes the findings: which store is growing fastest, whether reads keep up with writes, which records nobody retrieves, and what to do about it.

The same data over the API

Everything the agent calls over the MCP is a plain HTTP endpoint, which is what makes refreshable artifacts possible. The refresh script the agent writes uses the API key from the environment and rewrites the page’s data blob:
Run the script by hand, from cron, from a GitHub Actions schedule that publishes the page, or from a scheduled agent run that also rewrites the findings. The latitude-artifacts skill ships working recipes for all of them.

Rendering and design

The skill renders every artifact from one template: the Latitude design tokens (Inter, the #0080FF primary, neutral surfaces, the same series palette the Latitude charts use), a light and a dark theme that follow your OS setting, KPI tiles with deltas, ECharts charts, tables with inline bars, and a findings section. Nothing is rendered by Latitude, which keeps the page portable: commit it to your repo, drop it in a shared folder, or publish it wherever you like. A good prompt without the skill is simply: “Build a self-contained HTML artifact of this project’s LLM reliability and cost over the last 30 days.” The agent discovers the right queryAnalytics calls on its own. The skill adds the intake questions, the data-source map, the shared theme and the refresh recipes.
  • Agent dispatch: the investigation counterpart, where an agent uses the same tools to root-cause a signal.
  • MCP, CLI, API and the SDKs it documents: the surfaces an artifact can be built from.
  • Skills: the full list of Latitude agent skills.