lemma.trace(). Pass the callback
handler through the graph invoke config.
TypeScript
Install LangGraph and the Lemma SDK:langGraph() in the graph invoke config:
Python
Install the optional extra:langgraph() in the graph invoke config:
What Lemma records
| LangGraph callback | Lemma record |
|---|---|
| Root graph run | One Lemma trace named from agentName or the graph run name |
| Graph node | Child span with node input, output, timing, and parent ID |
| LLM or chat model | Generation with messages, output text, model, timing, and parent ID |
| Tool call | Tool span with input, output or error, timing, and parent ID |
| Retriever | Span with query input, output, timing, and parent ID |
langGraph({ recordInputs: false, recordOutputs: false }) in TypeScript or
langgraph(record_inputs=False, record_outputs=False) in Python to avoid
sending prompts, tool inputs, tool outputs, or model output text.