LiyaEngine Docs
Platform

Prompt Trace + Diff

Every intent call produces a full execution trace automatically — retrieved context, retrieval diagnostics, agentic steps, and flag status.

Dashboard

Every intent call produces a full execution trace — automatically, with no instrumentation required. See every retrieved chunk with its similarity score, the retrieval diagnostics behind it, and whether guardrails flagged the call, all in one queryable place.

What's captured

Retrieval Diagnostics

Every retrieved chunk — source, similarity score, and a text snippet — plus the applied top-k, similarity threshold, and whether a boost or fallback fired.

Agentic Step Trace

For agent-mode calls, each reasoning and tool-call step — which tool ran, its input/output, tokens, cost, and latency.

Guardrail Flag & Reason

Whether the call was flagged and why — a joined reason string covering every guardrail issue found on that call.

Cost & Token Accounting

Model used, input/output tokens, total cost, and total latency for every call.

Reading a trace

Every /v1/run response includes a metadata block with the trace summary; the full trace (retrieved chunks, retrieval diagnostics, agentic steps, flag status) is queryable via the dashboard or the traces API:

GET /dashboard/traces/:messageId
Authorization: Bearer <jwt>
{
  "success": true,
  "data": {
    "trace": {
      "traceId": "msg_xyz",
      "sessionId": "ses_abc",
      "intent": "custom_support_resolve_ticket",
      "domain": "custom:support",
      "modelUsed": "claude-sonnet-5",
      "inputTokens": 820,
      "outputTokens": 420,
      "totalTokens": 1240,
      "costUsd": "0.002100",
      "latencyMs": 340,
      "flagged": false,
      "flagReason": null,
      "piiDetected": false,
      "qaScore": 0.91,
      "retrievedContext": [
        { "sourceId": "src_01", "sourceType": "policy", "score": 0.94, "snippet": "Refunds are processed within..." }
      ],
      "retrievalMeta": {
        "chunksRetrieved": 4,
        "topSimilarity": 0.94,
        "retrievalMethod": "hybrid",
        "appliedTopK": 5,
        "fallbackFired": false
      },
      "agenticSteps": []
    }
  }
}

Traces are queryable indefinitely after the fact — reproduce a bad output weeks later without needing to have been watching in real time.

On this page