openinference.span.kind, which Lemma reads directly. Point Langfuse at Lemma, enable the instrumentation, and wrap each graph invocation in one root span to get a single nested trace.
One agent execution = one trace. Wrap the graph invocation in a single root span so every node, model, and tool call nests under it. See the trace contract.
openinference.span.kind), which are a fully supported shape for Lemma’s automated issue detection (silent failures, bad tool calls, loops) today.
Recipe
Register the Langfuse → Lemma exporter
Register the exporter once at startup, before any graph runs. This matches Setup.Set the environment variables. Lemma-only export needs no
LANGFUSE_* credentials.Enable OpenInference instrumentation
LangGraph runs on LangChain, so the LangChain instrumentor captures graph nodes, model calls, and tool calls — emitting the
openinference.span.kind spans Lemma reads. See the Langfuse LangGraph guide for more detail.Wrap the whole run in one root span
Wrap Every span emitted inside the
graph.invoke in a single Langfuse root span so every node and call nests under one trace. Record the input and final output on the root, and set a stable agent name.with block becomes a child of the root, producing one nested trace:Verify in Lemma
Open the Lemma dashboard → Traces and confirm:- One trace per run — a full graph invocation is one trace, not one per node.
- Root has input and output — the root span shows the user message and the final output.
- Generations are nested — each model call appears as a child generation with model and token usage.
- Tools are nested — each tool invocation appears as a child tool span with arguments and result.
Next steps
Trace contract
The exact shape Lemma reads.
Setup
Wire the Langfuse → Lemma exporter.
Threads and sessions
Group multi-turn conversations with a thread id.
Good vs bad traces
What issue detection looks for, per shape.