> ## Documentation Index
> Fetch the complete documentation index at: https://learn.kubit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Concepts

> Definitions of users, sessions, traces, spans, execution paths and Polaris annotations (Action, Exception, Misstep, Warning, Behavior) in Kubit.

Kubit organizes agent data into four fixed subjects: User, Session, Trace and Span. Polaris adds annotations to every span, and Flows groups traces by execution path. This page defines each term as Kubit uses it.

## Subjects

Agent Analytics has exactly four subjects. They're the same in every workspace and don't depend on your schema.

<table>
  <colgroup>
    <col width="100" />

    <col width="417" />

    <col width="177" />
  </colgroup>

  <thead>
    <tr>
      <th>**Subject**</th>
      <th>**What it is**</th>
      <th>**Identified by**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**User**</td>
      <td>The end user who started the trace</td>
      <td>User ID</td>
    </tr>

    <tr>
      <td>**Session**</td>
      <td>A group of related traces, such as one conversation</td>
      <td>Session ID</td>
    </tr>

    <tr>
      <td>**Trace**</td>
      <td>One end-to-end agent run or request</td>
      <td>Trace ID</td>
    </tr>

    <tr>
      <td>**Span**</td>
      <td>One operation inside a trace: an LLM call, a tool call, a retrieval</td>
      <td>Span ID</td>
    </tr>
  </tbody>
</table>

The hierarchy is User → Session → Trace → Span. A user has sessions, a session has traces and a trace has spans. You can start at any level and drill down.

For **Agent** workspace that ingest OTel traces, the workspace's extraction mapping decides which span attributes fill in the User ID and Session ID. [Check the extraction mapping](https://learn.kubit.ai/agent-analytics/get-started/quickstart.md#check-the-extraction-mapping) shows the defaults and how to change them.

## Trace and Span

A trace is one run of your agent, from the incoming request to the final response. A span is one timed operation inside that trace, with a start time, an end time, a parent and a set of attributes.

Kubit uses standard OpenTelemetry traces and spans. A span your existing OpenTelemetry setup produces is a span in Kubit, with no conversion, and is used as the base level event for analytics (the same as a clickstream event).

**Availability:** In Agent Analytics, "time" is span's "start time" unless a page says otherwise.

## Execution Path

An execution path is the ordered sequence of spans (steps) in one trace: which tools and model calls ran, in what order. Two traces that called `search_orders`, then `get_refund_policy`, then the LLM, share one execution path, even if their inputs differ.

Flows draws every execution path in one Sankey. Each path shows how many traces took it, so a failure that repeats a thousand times shows up as one path with a count of 1,000.

Each span in a trace is one step, in order of span start time. Flows names a step by the action Polaris annotates the span with:

<table>
  <colgroup>
    <col width="149" />

    <col width="534" />
  </colgroup>

  <thead>
    <tr>
      <th>**Span**</th>
      <th>**Step name**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>LLM call</td>
      <td>The task named from its system prompt, such as `generate_title`, or else its decision, such as `reply` or `call_<tool>`</td>
    </tr>

    <tr>
      <td>Tool call</td>
      <td>The tool name</td>
    </tr>

    <tr>
      <td>Anything else</td>
      <td>The span name</td>
    </tr>
  </tbody>
</table>

Repeated consecutive calls stay separate steps, so a trace that calls `search_orders` three times in a row has three `search_orders` steps. The **Fold Label** adjustment in Flows turns consecutive spans with one label into one step.

When two runs call the same tools with different arguments, Polaris labels or custom eval scores may split them into separate paths.

## Polaris Annotations

Annotations are the labels and scores Polaris adds to every span. Polaris is Kubit's in-house small language model. It annotates each span in under a second, on every span, with no additional LLM cost or sampling.

Polaris has three parts.

<table>
  <colgroup>
    <col width="163" />

    <col width="512" />
  </colgroup>

  <thead>
    <tr>
      <th>**Part**</th>
      <th>**What it produces**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Classifier**</td>
      <td>Labels on every span automatically, using taxonomy trained over 30+ domains</td>
    </tr>

    <tr>
      <td>**Eval**</td>
      <td>Scores from your own eval prompts. A score can be a number, a true/false or a value from a list you define.</td>
    </tr>

    <tr>
      <td>**Fine-tuning**</td>
      <td>Custom adapters retrained on the corrections your team makes in the workspace for classifier or eval</td>
    </tr>
  </tbody>
</table>

"Label" always means classifier output. Eval output is a "score". Evals run on Polaris and are included in Agent Analytics at no extra cost.

### Annotation Types

Every span gets one of five annotation types.

<table>
  <colgroup>
    <col width="100" />

    <col width="334" />

    <col width="325" />
  </colgroup>

  <thead>
    <tr>
      <th>**Type**</th>
      <th>**Meaning**</th>
      <th>**Examples**</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>**Action**</td>
      <td>The span did its job: an LLM call, a retrieval or a tool call</td>
      <td>`get_order_status, check_out`</td>
    </tr>

    <tr>
      <td>**Exception**</td>
      <td>The call failed: an exception, a 4xx or 5xx response, a timeout or no network</td>
      <td>`timeout, unauthorized`</td>
    </tr>

    <tr>
      <td>**Misstep**</td>
      <td>The call ran, often with an OK status, but did the wrong thing</td>
      <td>`wrong_tool, malformed_args`</td>
    </tr>

    <tr>
      <td>**Warning**</td>
      <td>The span is a risk even if it worked: a loop, high cost, high latency, high frequency, detected PII or a spike</td>
      <td>`loop_detected, pii_detected`</td>
    </tr>

    <tr>
      <td>**Behavior**</td>
      <td>What the agent and the user did and said: intent, sentiment, hallucination and similar annotations</td>
      <td>`aggression, cursing, repeated_prompts`</td>
    </tr>
  </tbody>
</table>

Exception and Misstep are different. An Exception shows in your error logs. A Misstep usually doesn't, because the call returned OK even though the agent made a mistake. Polaris labels Missteps on every span, so a trace whose calls all return OK can still show a `wrong_tool` or `wrong_parameter` label.

## Workspace

A workspace holds one set of traces, their Polaris annotations and its reports. An organization can have several workspaces, for example one per environment or per agent/app.

## Example Prompts

> "Show me the sessions for user 8812 in the last 7 days"

> "Which execution paths for the support agent had a Misstep on a tool call yesterday?"

> "Compare the Exception rate by model version for traces in the last 30 days"

## Related

* [Agent Analytics overview](https://learn.kubit.ai/agent-analytics/overview.md): the features built on these concepts.
* [Quickstart](https://learn.kubit.ai/agent-analytics/get-started/quickstart.md#check-the-extraction-mapping): how your spans map to users and sessions.
* [Quickstart](https://learn.kubit.ai/agent-analytics/get-started/quickstart.md): send your first traces.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.