Use case guide

Ticket routing

Route support tickets using calibrated probability + uncertainty, not raw model confidence. Automate high‑confidence routes and fall back to a stronger model or human triage when risk is high.

Overview

Problem

Raw confidence scores are often miscalibrated: you over‑automate risky tickets and under‑automate safe ones.

Reality Signal

Convert a score into prob_est + uncertainty and a boolean decision.

Outcome

Stable routing policies: automate more when it's safe, and escalate only when uncertainty is high.

Architecture

  1. Base model produces a routing score (e.g., probability ticket is “Billing”).
  2. Send the score to /decide.
  3. Use prob_est + uncertainty to route.
  4. When ground truth is known, call /feedback to improve calibration.
Typical routing actions: automate, reroute to a stronger model, reprompt, or human triage.

1) Decide + route

Call /decide with the base model score. Use the response to route automatically or fall back when uncertainty is high.

Request
bash
curl -X POST https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io/decide   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "features": { "score": 0.82 }
  }'
Response
json
{
  "decision_id": 123,
  "prob_est": 0.62,
  "uncertainty": 0.08,
  "decision": false
}
If decision=false or uncertainty is above your guardrail, reroute or triage.

2) Feedback loop

Once the final routing label is known, send feedback using the decision_id. This continuously improves calibration.

Feedback (cURL)
bash
curl -X POST https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io/feedback   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{
    "decision_id": 123,
    "feedback": 1,
    "force_retrain": false
  }'

Reference implementation

Python
python
import requests

API_URL = "https://onprem-api-sowl.jollysand-1b9ed42e.swedencentral.azurecontainerapps.io"
HEADERS = {"x-api-key": "YOUR_API_KEY"}

def rc_decide(score: float):
    payload = {"features": {"score": score}}
    r = requests.post(f"{API_URL}/decide", json=payload, headers=HEADERS)
    r.raise_for_status()
    return r.json()

def rc_feedback(decision_id: int, feedback: int):
    payload = {"decision_id": decision_id, "feedback": feedback, "force_retrain": False}
    r = requests.post(f"{API_URL}/feedback", json=payload, headers=HEADERS)
    r.raise_for_status()
    return r.json()

# --- Ticket routing workflow ---
# Your base model outputs a confidence score for the route (e.g., Billing vs Tech)
score = 0.82
rc = rc_decide(score)

# Example policy:
# - automate if decision==true AND uncertainty is low
# - otherwise reroute to stronger model or human triage
if rc["decision"] and rc["uncertainty"] <= 0.15:
    route = "Billing (auto)"
else:
    route = "Stronger model / Human triage"

print("route:", route, "prob_est:", rc["prob_est"], "uncertainty:", rc["uncertainty"])

# Later, when ground truth is known:
rc_feedback(rc["decision_id"], feedback=1)  # 1 correct, 0 incorrect
Next guides: agent action gating, KYC/compliance triage, model rerouting, and fraud review.