LiyaEngine Docs

Traces

Every call produces a full execution trace automatically. Retrieved context, agentic steps, guardrail flags, cost and latency, in one queryable place.

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.

A trace is one row per direct request, agent run or workflow run, each with a kind and a traceId. Calls an agent or workflow makes inside a run can be listed too. A trace records whether guardrails flagged it and why, whether personal data was detected, and a quality score with its breakdown, and you can comment on it or bookmark it.

Where to look

In the dashboard, Observe holds four pages: Traces (requests and execution evidence), Insights (patterns that need your attention), Request Logs (API request activity) and Costs (spend and plan allowances, by model and capability). Over the API, see Traces; over MCP, search_traces and get_trace do the same.

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 stay queryable for the retention period your plan includes — reproduce a bad output weeks later without needing to have been watching in real time. Read them from the dashboard, from your backend with an API key (Traces API), or with the Dashboard API (Traces).

On this page