Sessions group related traces (multiple requests / turns) under a shared identifier, useful for conversational AI and multi-step workflows.Documentation Index
Fetch the complete documentation index at: https://laminar.sh/docs/llms.txt
Use this file to discover all available pages before exploring further.
- Set a session ID at the trace level so all spans in a trace share it.
- Use the Sessions view in the Laminar UI to review all traces in the same session.
You must set the session ID inside a span context so it can attach to the current trace (for example, inside an
@observed function / observe() call, or by passing sessionId / session_id via observe options).What is a Session?
A trace usually represents one request / one conversational turn. A session groups multiple traces that belong to the same higher-level flow (for example, an entire chat conversation or checkout process).Example
- TypeScript
- Python
observe(..., { sessionId }) and Laminar.setTraceSessionIdViewing Sessions in Laminar
- Navigate to the Traces page and select the Sessions tab. The table lists every session in the selected time range, with columns for duration, total cost, total tokens, trace count, and user ID.

- Click a row to open the full-page session view. The breadcrumb confirms which session you are looking at, and the header shows the session’s duration, token count, and cost. Toggle Timeline to see when each trace ran, or use the search box to filter by text, span name, ID, or tags.
- Each trace appears as a numbered card (
1/5,2/5, …) with an auto-extracted Input block and the final LLM output, so you can scan the conversation end to end without opening individual traces.

Common Patterns
- Chatbots: session =
conversation_id, trace = one user turn. - Workflows: session =
checkout-{userId}, trace = each step (validateCart,processPayment,createOrder).
