lemma.trace(). Pass the callback
handler through LangChain’s callbacks option.
TypeScript
Install LangChain and the Lemma SDK:langChain() as a callback handler:
Python
Install the optional extra:langchain() as a callback handler:
What Lemma records
| LangChain callback | Lemma record |
|---|---|
| Root chain start/end | One Lemma trace named from agentName or the LangChain run name |
| LLM or chat model start/end | Generation with input messages, output text, model, timing, and parent ID |
| Tool start/end | Tool call with name, input, output or error, timing, and parent ID |
| Retriever start/end | Span with query input, output, timing, and parent ID |
| Nested chain start/end | Child span preserving LangChain parent run IDs |
langChain({ recordInputs: false, recordOutputs: false }) in TypeScript or
langchain(record_inputs=False, record_outputs=False) in Python to avoid
sending prompts, tool inputs, tool outputs, or model output text.