# Detect Intent

> Detecta la intención del usuario en un texto de entrada y extrae los parámetros relevantes para el enrutamiento posterior.

Source: https://docs.sommatic.ai/es/nodes/ai.intent/

- Slug: `ai.intent`
- Familia: IA
- Versión: 1.0.0
- Estado: Disponible
- Ejecución: async

Detecta la intención del usuario en un texto de entrada y extrae los parámetros relevantes para el enrutamiento posterior.

Este operador clasifica el texto de entrada frente a un catálogo de intenciones configurable y produce una intención principal, una puntuación de confianza, los parámetros extraídos e indicaciones de enrutamiento para la orquestación del workflow.

**Operaciones**
- **Detección de intención:** Compara el texto con un catálogo de intenciones con nombre, descripción y ejemplos.
- **Extracción de parámetros:** Extrae los parámetros clave-valor (slots) relevantes para la intención detectada.
- **Enrutamiento:** Ofrece indicaciones de enrutamiento para orientar las bifurcaciones posteriores del workflow.

**Casos de uso**
- Enrutar mensajes de un chatbot según la intención del usuario (p. ej., "book_appointment", "check_status", "complaint").
- Triaje de correos y categorización automática según su propósito.
- Clasificación de las entradas del Command Center para la ejecución explícita frente a la asistida por inferencia.
- Enrutamiento de recepción multicanal con escalamiento a revisión humana según la confianza.

## Configuración

- `llm_provider_id` (string, opcional): El `id` de un registro `LlmProviderModel` (p. ej. `wf-llm-provider-*`). El orquestador delega en el backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` en modo sync, o `POST /chat/conversation/execute/stream-ephemeral` (SSE) en modo stream. El backend resuelve endpoint + api-key + deployment a partir del registro y enruta al adaptador correspondiente.
- `invocation_mode` (string, opcional): Transporte de la llamada al LLM. `sync` se bloquea hasta recibir la respuesta completa. `stream` consume los tokens mediante SSE (necesario para generaciones largas). Predeterminado: `sync`. Por defecto: `sync`. Valores permitidos: `sync`, `stream`.
- `timeout_ms` (integer, opcional): Tiempo máximo de espera para que termine la invocación (o tiempo máximo de inactividad entre fragmentos en modo stream). Predeterminado: 30000 en sync, 600000 en stream.
- `intents` (array<object>, opcional): Define las intenciones que se detectan. Cada una necesita un nombre y una descripción. Por defecto: `[]`.
- `allow_multiple` (boolean, opcional): Permite detectar varias intenciones en una misma entrada. Por defecto: `false`.
- `confidence_threshold` (number, opcional): Marca la salida como needs_review cuando la confianza queda por debajo de este umbral. Por defecto: `0.7`.
- `knowledge_resource_id` (string, opcional): Carga el catálogo de intenciones desde un Knowledge Resource en lugar de la configuración en línea.
- `language` (string, opcional): Código del idioma de salida (p. ej., "en", "es"). Por defecto: `en`.

Su configuración muestra los ajustes de ejecución compartidos, pero este nodo aún no aplica reintentos (`retryOnFail`, `maxTries`). Ningún nodo aplica `continueOnFail`.

## Puertos de salida

- `detected` (por defecto): Detected
- `unknown`: Unknown
- `error`: Error

## Contrato de entrada

- `text` (string, obligatorio): El texto de entrada cuya intención se analiza.
- `context` (string, opcional): Contexto opcional de la conversación o la sesión.
- `channel` (string, opcional): Identificador opcional del canal (chat, email, api, etc.).

## Contrato de salida

- `primary_intent` (string, opcional): El nombre de la intención principal detectada o "unknown".
- `confidence` (number, opcional): Puntuación de confianza (0-1) de la intención principal.
- `all_intents` (array<object>, opcional): Distribución de probabilidad entre todas las intenciones del catálogo.
- `parameters` (object, opcional): Parámetros clave-valor extraídos que son relevantes para la intención.
- `routing_hint` (string, opcional): Siguiente acción o destino de enrutamiento sugerido.
- `needs_review` (boolean, opcional): True cuando la confianza está por debajo del umbral.

## En expresiones

Lo que un nodo posterior puede leer de la salida de este nodo con `$("Detect Intent").item.json.<ruta>` (escribe la etiqueta de tu nodo en lugar de `Detect Intent`). **Editor** marca las rutas que sugiere el editor de workflows en Previous Nodes (el contrato de salida); **Worker** marca las rutas que el worker devuelve de verdad por `detected`, según la salida que muestra Puertos.

- `$("Detect Intent").item.json.primary_intent` (string) = `"track_order"`: El nombre de la intención principal detectada o "unknown".
- `$("Detect Intent").item.json.confidence` (number) = `0.92`: Puntuación de confianza (0-1) de la intención principal.
- `$("Detect Intent").item.json.all_intents` (array) = `[…] (3)`: Distribución de probabilidad entre todas las intenciones del catálogo.
- `$("Detect Intent").item.json.parameters` (object) = `{…}`: Parámetros clave-valor extraídos que son relevantes para la intención.
- `$("Detect Intent").item.json.routing_hint` (string) = `"order-status-flow"`: Siguiente acción o destino de enrutamiento sugerido.
- `$("Detect Intent").item.json.needs_review` (boolean) = `false`: True cuando la confianza está por debajo del umbral.
- `$("Detect Intent").item.json.parameters.order_id` (string) = `"4521"` (El editor no la sugiere)
- `$("Detect Intent").item.json.raw` (null) = `null` (El editor no la sugiere)
- `$("Detect Intent").item.json.port` (string) = `"detected"` (El editor no la sugiere)


## Cómo funciona

Detecta la intención del usuario en `text` frente a un catálogo de intenciones (en línea y/o de un recurso de conocimiento) y enruta a `detected` o `unknown`, con los parámetros extraídos.

1. Combina el payload anterior con la configuración del nodo (gana la configuración) y lee `text`, `context` y `channel`; lanza `Missing 'text'` si `text` está vacío.
2. Reúne intenciones de `intents` (cada elemento necesita `name`) y añade las de `content.structured_data.intents` del `knowledge_resource_id` cuyo nombre no esté ya (sin distinguir mayúsculas). Falla si no queda ninguna.
3. Envía un prompt de sistema de clasificador con el catálogo, el umbral y un formato JSON estricto; el mensaje de usuario une `Channel:`, `Context:` y `text`; `temperature: 0`.
4. Interpreta la respuesta como JSON. `primary_intent` se empareja sin distinguir mayúsculas con el catálogo; cualquier otro valor pasa a `unknown`. Cada intención del catálogo ausente en `all_intents` se añade con confianza 0.
5. `needs_review` es el valor del modelo o, si falta, `confidence < confidence_threshold`. Sale por `detected` salvo que la intención sea `unknown`.

## En un workflow

### Nodo

```json
{
  "node_id": "node-detect-intent",
  "label": "Detect intent",
  "operator_slug": "ai.intent",
  "operator_version": "1.0.0",
  "config": {
    "text": "{{ $json.message }}",
    "channel": "chat",
    "intents": [
      {
        "name": "track_order",
        "description": "The user wants to know where an order is",
        "examples": "where is my order, tracking number"
      },
      {
        "name": "cancel_order",
        "description": "The user wants to cancel an order"
      },
      {
        "name": "refund",
        "description": "The user asks for money back"
      }
    ],
    "allow_multiple": false,
    "confidence_threshold": 0.7,
    "language": "en",
    "llm_provider_id": "wf-llm-provider-xxxx",
    "invocation_mode": "sync"
  }
}
```

### Envelope

```json
{
  "ok": true,
  "data": {
    "primary_intent": "track_order",
    "confidence": 0.92,
    "all_intents": [
      {
        "intent": "track_order",
        "confidence": 0.92
      },
      {
        "intent": "cancel_order",
        "confidence": 0.05
      },
      {
        "intent": "refund",
        "confidence": 0.03
      }
    ],
    "parameters": {
      "order_id": "4521"
    },
    "routing_hint": "order-status-flow",
    "needs_review": false,
    "raw": null,
    "port": "detected"
  },
  "port": "detected"
}
```

## Puertos de salida (comportamiento en el código)

### `detected`

La intención principal pertenece al catálogo, sea cual sea su confianza. Revisa `needs_review` para la baja confianza.

```json
{
  "primary_intent": "track_order",
  "confidence": 0.92,
  "all_intents": [
    {
      "intent": "track_order",
      "confidence": 0.92
    },
    {
      "intent": "cancel_order",
      "confidence": 0.05
    },
    {
      "intent": "refund",
      "confidence": 0.03
    }
  ],
  "parameters": {
    "order_id": "4521"
  },
  "routing_hint": "order-status-flow",
  "needs_review": false,
  "raw": null,
  "port": "detected"
}
```

### `unknown`

El modelo respondió `unknown`, ninguna intención o un nombre fuera del catálogo.

```json
{
  "primary_intent": "unknown",
  "confidence": 0.2,
  "all_intents": [
    {
      "intent": "track_order",
      "confidence": 0.1
    },
    {
      "intent": "cancel_order",
      "confidence": 0.05
    },
    {
      "intent": "refund",
      "confidence": 0.05
    }
  ],
  "parameters": {},
  "routing_hint": null,
  "needs_review": true,
  "raw": null,
  "port": "unknown"
}
```

### `error`

Falta `text` o el catálogo, falló la llamada al modelo o la respuesta no era JSON.

```json
{
  "error": "Model did not return valid JSON output"
}
```

## Comportamiento en el código

- `confidence_threshold`: No cambia el puerto: una intención del catálogo con baja confianza sigue saliendo por `detected`. Solo fija `needs_review` cuando el modelo no lo envía.
- `text, context, channel`: No está en el esquema de configuración (está en el contrato de entrada), pero se lee primero de la configuración y luego del payload anterior.
- `timeout_ms`: Solo en modo stream: timeout de inactividad entre fragmentos, por defecto 600000. En modo sync no se aplica a la petición.
- `execution`: Declarado pero ignorado: ni el worker ni el motor leen `retryOnFail`, `maxTries`, `waitBetweenTries`, `continueOnFail`, `alwaysOutputData` ni `timeout_ms` de este bloque.

## Errores

| Mensaje | Puerto | Causa y solución |
| --- | --- | --- |
| `Missing 'text'` | `error` | No hay `text` en la configuración ni en el payload anterior. |
| `No intents found. Provide intents in the config or link a Knowledge Resource with an intent catalog.` | `error` | Ni `intents` ni el recurso aportan una intención con `name`. Si no hay intenciones en línea y la carga del recurso falla, se devuelve ese error de carga. |
| `Model did not return valid JSON output` | `error` | La respuesta no se pudo interpretar como objeto JSON. |
| `[AiIntent] Missing 'llm_provider_id' in node config (LlmProviderModel.id, e.g. 'wf-llm-provider-*'). The legacy 'model_id' alias is no longer supported — update the node config to use 'llm_provider_id'.` | `error` | `llm_provider_id` está vacío o no es un texto. Elige un registro de proveedor LLM con capacidad de chat. |
| `LLM Invocation Error: <backend message>` | `error` | El backend rechazó la llamada: registro de proveedor inexistente o inactivo, error del proveedor, cuota o filtro de contenido. Revisa el registro de proveedor y los logs del backend. |
| `LLM Invocation Error: empty response from backend (<transport error>)` | `error` | Modo sync: falló la llamada HTTP al backend (error de red, estado distinto de 2xx o timeout). Los prompts largos suelen agotar el timeout de la petición; cambia a `invocation_mode: "stream"`. |
| `RemoteApiService.stream: idle timeout after <timeout_ms>ms` | `error` | Modo stream: no llegó ningún fragmento dentro de `timeout_ms`. Si la petición de stream falla, el mensaje es `RemoteApiService.stream: HTTP <status> — <body>`. |

## Notas y límites

- Se pide `reasoning` al modelo, pero no se devuelve. `parameters` se pasa tal cual desde el modelo como objeto.
- El worker devuelve sus campos en el primer nivel en lugar de dentro de `data`, así que el motor guarda todo el valor devuelto como salida del nodo: `port` y `raw` aparecen en `$json` junto a los campos del resultado.
- `raw` es la respuesta cruda del proveedor en modo sync y `null` en modo stream.
- La llamada al modelo pasa por el backend de Sommatic AI, que resuelve el registro de proveedor indicado en `llm_provider_id` (endpoint, credenciales, despliegue); el orquestador nunca guarda llaves del proveedor. `invocation_mode: "sync"` (por defecto) espera la respuesta completa; `"stream"` la lee como eventos SSE y une los fragmentos.
- `timeout_ms` solo tiene efecto en modo stream, como tiempo máximo de inactividad entre fragmentos (por defecto 600000). En modo sync el valor se registra en el log, pero no se aplica a la petición HTTP, así que rige el timeout por defecto de la plataforma.
- En modo stream el endpoint del backend no aplica los parámetros de muestreo, así que la `temperature: 0` fija solo tiene efecto en modo sync.
- El recurso de conocimiento se lee del backend en cada ejecución (timeout de 10 s). Un recurso cuyo estado no es `active` se usa igual, con una advertencia en el log.
- Sin reintentos automáticos: el motor no aplica `execution.retryOnFail`, `maxTries` ni `waitBetweenTries` en este nodo; una llamada fallida sale directamente por `error`.


## Contratos (JSON Schema)

### All (`*.definition.js`)

```json
{
  "slug": "ai.intent",
  "name": "Detect Intent",
  "category": "ai",
  "version": "1.0.0",
  "description": "Detects user intent from text input and extracts relevant parameters for downstream routing.\n\nThis operator classifies input text against a configurable intent catalog, producing a primary intent, confidence score, extracted parameters, and routing hints for workflow orchestration.\n\n**Operations**\n- **Intent Detection:** Matches text against a catalog of named intents with descriptions and examples.\n- **Parameter Extraction:** Extracts key-value slot parameters relevant to the detected intent.\n- **Routing:** Provides routing hints to guide downstream workflow branching.\n\n**Use Cases**\n- Chatbot message routing based on user intent (e.g., \"book_appointment\", \"check_status\", \"complaint\").\n- Email triage and automatic categorization by purpose.\n- Command Center input classification for explicit vs. inference-assisted execution.\n- Multi-channel intake routing with confidence-based human review escalation.",
  "capabilities": [
    "ai",
    "nlp",
    "intent",
    "classification",
    "routing"
  ],
  "knowledge_binding": {
    "enabled": true,
    "resource_types": [
      "intent_catalog"
    ],
    "field": "knowledge_resource_id",
    "label": "Intent Catalog"
  },
  "config_schema": {
    "type": "object",
    "properties": {
      "llm_provider_id": {
        "type": "string",
        "title": "LLM Provider",
        "description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
        "x-ui-widget": "llm-provider-picker",
        "x-llm-provider-capabilities": [
          "chat"
        ]
      },
      "invocation_mode": {
        "type": "string",
        "title": "Invocation Mode",
        "description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
        "enum": [
          "sync",
          "stream"
        ],
        "default": "sync"
      },
      "timeout_ms": {
        "type": "integer",
        "title": "Timeout (ms)",
        "description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
        "minimum": 1000
      },
      "intents": {
        "type": "array",
        "title": "Intent Catalog",
        "description": "Define the intents to detect. Each needs a name and description.",
        "items": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "title": "Intent Name"
            },
            "description": {
              "type": "string",
              "title": "Description"
            },
            "examples": {
              "type": "string",
              "title": "Example Phrases"
            }
          },
          "required": [
            "name",
            "description"
          ]
        },
        "default": []
      },
      "allow_multiple": {
        "type": "boolean",
        "title": "Allow Multiple Intents",
        "description": "Allow detecting multiple intents in a single input.",
        "default": false
      },
      "confidence_threshold": {
        "type": "number",
        "title": "Confidence Threshold",
        "description": "Flag as needs_review when confidence falls below this threshold.",
        "default": 0.7,
        "minimum": 0,
        "maximum": 1
      },
      "knowledge_resource_id": {
        "type": "string",
        "title": "Intent Catalog (Knowledge Resource)",
        "description": "Load intent catalog from a Knowledge Resource instead of inline config.",
        "ui_widget": "knowledge_resource_picker"
      },
      "language": {
        "type": "string",
        "title": "Language",
        "description": "Output language code (e.g., \"en\", \"es\").",
        "default": "en"
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    }
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string",
        "description": "The text input to analyze for intent."
      },
      "context": {
        "type": "string",
        "description": "Optional conversation or session context."
      },
      "channel": {
        "type": "string",
        "description": "Optional channel identifier (chat, email, api, etc.)."
      }
    },
    "required": [
      "text"
    ]
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "primary_intent": {
        "type": "string",
        "description": "The detected primary intent name or \"unknown\"."
      },
      "confidence": {
        "type": "number",
        "description": "Confidence score (0-1) for the primary intent."
      },
      "all_intents": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "intent": {
              "type": "string"
            },
            "confidence": {
              "type": "number"
            }
          }
        },
        "description": "Probability distribution across all catalog intents."
      },
      "parameters": {
        "type": "object",
        "description": "Extracted key-value parameters relevant to the intent."
      },
      "routing_hint": {
        "type": "string",
        "description": "Suggested next action or routing target."
      },
      "needs_review": {
        "type": "boolean",
        "description": "True when confidence is below the threshold."
      }
    }
  },
  "ports": [
    {
      "port_id": "detected",
      "label": "Detected",
      "is_default": true
    },
    {
      "port_id": "unknown",
      "label": "Unknown"
    },
    {
      "port_id": "error",
      "label": "Error"
    }
  ],
  "execution_mode": "async",
  "tags": [
    "ai",
    "nlp",
    "intent",
    "routing",
    "classification"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://me.veripass.com/sommatic",
      "logo_url": null
    }
  }
}
```

### config_schema

```json
{
  "type": "object",
  "properties": {
    "llm_provider_id": {
      "type": "string",
      "title": "LLM Provider",
      "description": "The `id` of a `LlmProviderModel` record (e.g. `wf-llm-provider-*`). The orchestrator delegates to the backend: `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` for sync mode, or `POST /chat/conversation/execute/stream-ephemeral` (SSE) for stream mode. The backend resolves endpoint + api-key + deployment from the record and routes to the correct adapter.",
      "x-ui-widget": "llm-provider-picker",
      "x-llm-provider-capabilities": [
        "chat"
      ]
    },
    "invocation_mode": {
      "type": "string",
      "title": "Invocation Mode",
      "description": "Transport for the LLM call. `sync` blocks until the full response arrives. `stream` consumes tokens via SSE (required for long generations). Default `sync`.",
      "enum": [
        "sync",
        "stream"
      ],
      "default": "sync"
    },
    "timeout_ms": {
      "type": "integer",
      "title": "Timeout (ms)",
      "description": "Maximum time to wait for the invocation to complete (or idle timeout between chunks in stream mode). Default 30000 for sync, 600000 for stream.",
      "minimum": 1000
    },
    "intents": {
      "type": "array",
      "title": "Intent Catalog",
      "description": "Define the intents to detect. Each needs a name and description.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "title": "Intent Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "examples": {
            "type": "string",
            "title": "Example Phrases"
          }
        },
        "required": [
          "name",
          "description"
        ]
      },
      "default": []
    },
    "allow_multiple": {
      "type": "boolean",
      "title": "Allow Multiple Intents",
      "description": "Allow detecting multiple intents in a single input.",
      "default": false
    },
    "confidence_threshold": {
      "type": "number",
      "title": "Confidence Threshold",
      "description": "Flag as needs_review when confidence falls below this threshold.",
      "default": 0.7,
      "minimum": 0,
      "maximum": 1
    },
    "knowledge_resource_id": {
      "type": "string",
      "title": "Intent Catalog (Knowledge Resource)",
      "description": "Load intent catalog from a Knowledge Resource instead of inline config.",
      "ui_widget": "knowledge_resource_picker"
    },
    "language": {
      "type": "string",
      "title": "Language",
      "description": "Output language code (e.g., \"en\", \"es\").",
      "default": "en"
    },
    "execution": {
      "type": "object",
      "title": "Execution Settings",
      "properties": {
        "alwaysOutputData": {
          "type": "boolean",
          "title": "Always Output Data",
          "description": "Always output data, even on error (if configured).",
          "default": false
        },
        "retryOnFail": {
          "type": "boolean",
          "title": "Retry On Fail",
          "description": "Retry the execution if it fails.",
          "default": false
        },
        "maxTries": {
          "type": "integer",
          "title": "Max Retries",
          "description": "Number of retries.",
          "default": 3,
          "displayOptions": {
            "show": {
              "retryOnFail": [
                true
              ]
            }
          }
        },
        "waitBetweenTries": {
          "type": "integer",
          "title": "Wait Between Retries (ms)",
          "default": 1000,
          "displayOptions": {
            "show": {
              "retryOnFail": [
                true
              ]
            }
          }
        },
        "continueOnFail": {
          "type": "boolean",
          "title": "Continue On Fail",
          "description": "Do not crash workflow on error.",
          "default": false
        },
        "timeout_ms": {
          "type": "integer",
          "title": "Timeout (ms)",
          "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
          "default": 300000
        }
      }
    }
  }
}
```

### input_contract_schema

```json
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "The text input to analyze for intent."
    },
    "context": {
      "type": "string",
      "description": "Optional conversation or session context."
    },
    "channel": {
      "type": "string",
      "description": "Optional channel identifier (chat, email, api, etc.)."
    }
  },
  "required": [
    "text"
  ]
}
```

### output_contract_schema

```json
{
  "type": "object",
  "properties": {
    "primary_intent": {
      "type": "string",
      "description": "The detected primary intent name or \"unknown\"."
    },
    "confidence": {
      "type": "number",
      "description": "Confidence score (0-1) for the primary intent."
    },
    "all_intents": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "intent": {
            "type": "string"
          },
          "confidence": {
            "type": "number"
          }
        }
      },
      "description": "Probability distribution across all catalog intents."
    },
    "parameters": {
      "type": "object",
      "description": "Extracted key-value parameters relevant to the intent."
    },
    "routing_hint": {
      "type": "string",
      "description": "Suggested next action or routing target."
    },
    "needs_review": {
      "type": "boolean",
      "description": "True when confidence is below the threshold."
    }
  }
}
```

### ports

```json
[
  {
    "port_id": "detected",
    "label": "Detected",
    "is_default": true
  },
  {
    "port_id": "unknown",
    "label": "Unknown"
  },
  {
    "port_id": "error",
    "label": "Error"
  }
]
```
