gaugeMetric Store

Define custom metrics, evaluate conversations with AI, and query metric values across all channels.

The metric store computes, stores, and serves metrics across all channels from a single config-driven pipeline. 42 built-in metrics ship with every workspace. Custom metrics can be added through the settings API without code changes.

Metric Settings

Metric definitions are stored in workspace settings. The settings API lets you view all definitions (built-in and custom) and add or modify custom ones.

Get Metric Definitions

GET /v1/{workspace_id}/settings/metrics

Returns all metric definitions for the workspace, including 42 built-in metrics and any custom definitions.

curl -H "Authorization: Bearer $API_KEY" \
  "https://api.amigo.ai/v1/$WORKSPACE_ID/settings/metrics"

Response:

{
  "definitions": [
    {
      "key": "voice_quality_score",
      "name": "Voice Quality Score",
      "metric_type": "numerical",
      "source": "call_intelligence",
      "extraction_mode": "static",
      "extract_path": "$.quality_score",
      "aggregation": "avg",
      "unit": "score",
      "active": true,
      "builtin": true
    }
  ]
}

Create or Update Custom Metrics

Replaces the custom metric definitions for the workspace. Built-in metrics are preserved automatically - you only need to include your custom definitions.

Permissions: Admin or Owner role required.

Metric Definition Fields

Field
Required
Description

key

Yes

Unique identifier. Lowercase alphanumeric and underscores (^[a-z][a-z0-9_]*$). Max 64 characters.

name

Yes

Display name. Max 256 characters.

description

No

Human-readable description. Max 2000 characters.

metric_type

Yes

numerical, categorical, or boolean

source

Yes

Data source. See Sources below.

event_types

Yes

Event types to scan. For call_intelligence source, use ["call_intelligence.row"].

extraction_mode

Yes

How to extract the value. See Extraction Modes.

model_tier

No

AI model tier: free, fast, balanced, max. Default: free. Required for ai_query.

ai_query_prompt

Conditional

Prompt template for ai_query mode. Required when extraction_mode is ai_query. Max 8000 characters.

extract_path

Conditional

JSON path for static mode (e.g., $.quality_score).

aggregation

No

Aggregation function: count, sum, avg, min, max, count_distinct, ratio, rate. Default: count.

unit

No

Display unit (e.g., score, %, seconds). Max 32 characters.

period_granularity

No

hourly or daily. Default: daily.

channel_scope

No

all, voice, text, surface, inbound, outbound. Default: all.

valid_range_min

No

Minimum valid value for numerical metrics. Values below are dropped.

valid_range_max

No

Maximum valid value for numerical metrics. Values above are dropped.

active

No

Set to false to disable without deleting. Default: true.

Sources

Source
What It Reads

call_intelligence

Call and text conversation summaries. Use for evaluating conversation quality, outcomes, and agent behavior.

world_events

All events across all domains. Use for event-level metrics.

surface_events

Form submission lifecycle events.

emotion_events

Audio emotion analysis events.

connector_events

Data connector sync events.

voice_judge_results

Audio-native voice quality scores.

Extraction Modes

Mode
Cost
Description

static

Free

Extract a value from a known JSON path in the event data.

ai_classify

Free

Classify content into predefined categories. Requires ai_labels.

ai_extract

Free

Extract structured fields from text. Requires ai_labels.

ai_sentiment

Free

Analyze emotional tone.

ai_query

Varies

Run a custom prompt against conversation data. Requires model_tier and ai_query_prompt.

sql_expr

Free

Raw SQL expression. Not available for custom metrics (security).

circle-exclamation

Evaluate a Metric On-Demand

Test a metric definition against a specific conversation without waiting for the batch pipeline. The result is not persisted to the metric store.

Request body:

Field
Type
Description

subject_id

string

CallSid, call UUID, or simulation session ID.

Response:

circle-info

On-demand evaluation currently supports ai_query metrics on call_intelligence source only. The call must have a conversation summary available (calls that ended before the summary was generated return 404).

Error responses:

Status
Meaning

404

Metric definition not found, or call intelligence snapshot not found for the given subject.

422

Metric cannot be evaluated on demand (unsupported extraction mode or source).

502

The analytics query failed. Retry after a few seconds.

503

Analytics warehouse not configured for this workspace.

Query Metric Values

Computed metric values are available through five query endpoints. Values are computed by the batch pipeline (hourly for AI metrics, continuously for static metrics) and synced to the operational database.

List Latest Values

Returns the most recent value for each metric.

Parameter
Type
Default
Description

source

string

production

production, simulation, or all

scope

string

aggregate

aggregate (workspace-level), entity (per-call), or all

entity_type

string

-

Filter by entity type (e.g., call)

entity_id

string

-

Filter by specific entity

service_id

string

-

Filter by service

session_id

string

-

Filter by session (CallSid)

Get Metric Values

Returns values for a specific metric with optional time range.

Parameter
Type
Default
Description

date_from

datetime

-

Start of range (ISO-8601)

date_to

datetime

-

End of range (ISO-8601)

limit

integer

90

Max values to return (1-365)

Get Metric Trend

Returns time-series data for dashboard visualizations.

Parameter
Type
Default
Description

days

integer

30

Lookback window (1-365)

Metric Catalog

Lists all available metrics (built-in and custom) with their configuration.

Custom Metric Examples

Conversation Empathy Score

A numerical metric that rates how empathetic the agent was during each conversation.

Protocol Adherence Check

A boolean metric that checks whether the agent followed the required clinical protocol.

Call Topic Classification

A categorical metric that classifies the primary reason for each call.

Lifecycle

Custom metrics follow this lifecycle:

  1. Define - Create the metric definition via PUT /settings/metrics.

  2. Test - Use POST /metrics/{key}/evaluate to test against individual conversations. Iterate on the prompt until the scores match your expectations.

  3. Deploy - Once the definition is saved, the batch pipeline picks it up automatically on the next hourly run. No deployment or code change needed.

  4. Query - After the first pipeline run, values appear in GET /metrics/{key} and the metric catalog. Dashboard panels can visualize the new metric immediately.

  5. Iterate - Update the prompt or extraction settings via PUT /settings/metrics. Changes take effect on the next pipeline run.

circle-info

The batch pipeline runs hourly. After defining a new metric, the first computed values appear within one hour. Use the on-demand evaluate endpoint for immediate testing.

Limits

Limit
Value

Custom metrics per workspace

50

ai_query_prompt length

8,000 characters

Conversations evaluated per metric per run

500 (most recent)

Evaluation lookback window

24 hours

Forge CLI

The Forge CLIarrow-up-right provides three commands for working with metrics:

Last updated

Was this helpful?