Skip to main content
Every agent execution becomes a trace: a complete record of what happened, how long it took, and where it failed. The Lemma SDK emits the trace shape Lemma reads.
One agent execution = one trace. The trace has a single root span; LLM calls, tool calls, and app logic are child spans. See the trace contract.

The model

A trace is a tree of spans:
support-agent              <- trace root (input, output)
|- draft-reply             <- generation (model, content)
|- search_docs             <- tool call (args, result)
`- final-answer            <- generation

Pick your path

Instrument with the SDK

Install the Lemma SDK, then add traces, generations, tool calls, and spans.

How Lemma reads your traces

Lemma is an opinionated sink: it reads a specific trace shape to power input/output display, model visibility, timing, tool visibility, threads, and automated issue detection. The trace contract documents exactly what it reads and how each SDK helper maps to it.

Next steps