Skip to main content
Five nouns describe everything the SDK records. They’re the same words used in the dashboard and across these docs.
One agent execution = one trace. The root is the trace record; LLM calls, tool calls, and app logic are child spans inside it.

How a trace is structured

A single agent execution produces a tree. The root is the trace record; everything inside the execution nests under it as child spans.
support-agent
trace root
input · output · timing
draft-reply
generation · model · content
search_docs
tool call · args · result

Trace

A trace is a single end-to-end execution of your agent, from the user’s input to the final response. It carries the input, the output (or error), timing, and the tree of spans inside it. Each trace has a unique trace ID. If every model or tool call shows up as its own trace, the child work ran without the root trace handle or trace IDs. Create the root trace first, then record child spans through that trace or an explicit parent span handle. See Agent traces.

Span

A span is one unit of work inside a trace: retrieval, ranking, parsing, a database query, or any app operation. Spans nest, so a parent span can contain child spans, forming the execution tree. See Spans.

Generation

A generation is a span that represents a single LLM call. Typing a span as a generation lets Lemma read its model, prompt, completion, and timing. See Generations.

Tool call

A tool call is a span that represents a single tool invocation: its name, arguments, and result. Tool execution usually happens in your code, so it must be recorded explicitly to be visible. See Tool calls.

Thread

A thread groups the traces of a multi-turn conversation. Each turn is its own trace; giving related turns the same thread ID (threadId / thread_id) groups them into one conversation. See Threads & context. Every trace also belongs to a project, the container that holds your API key and project ID. See Platform concepts for how projects, agents, and issues fit together on the dashboard side.

Next steps

Platform concepts

Issues, occurrences, artifacts, and agents once traces arrive.

Trace contract

The exact shape Lemma reads.

Quickstart

Install the SDK and send your first complete agent trace.

Traces in the dashboard

Search and inspect ready executions.