Threads (multi-turn conversations)
When one user has a back-and-forth with your agent, each turn is its own trace. Give related turns the same thread id so Lemma groups them into one conversation.- TypeScript
- Python
Users
Attribute a trace to the end user so you can find every trace for a given user and analyze per-user behavior.- TypeScript
- Python
Custom metadata
Attach domain-specific fields for filtering — environment, plan tier, feature flag, tenant, request id, and so on.- TypeScript
- Python
Reference
| Context | Langfuse field |
|---|---|
| Agent name | traceName + metadata["gen_ai.agent.name"] |
| Thread / conversation | sessionId (and/or metadata["lemma.thread_id"]) |
| User | userId |
| Environment, tenant, custom filters | metadata |
Next steps
Trace contract
The exact shape Lemma reads.
Good trace vs bad trace
Conformant vs malformed traces.