Docs
Tracing
Sessions

Sessions

Many interactions with LLM applications span multiple traces. Sessions in Langfuse are a way to group these traces together and see a simple session replay of the entire interaction. Get started by adding a sessionId when creating a trace.

Add a sessionId when creating/updating a trace. This can be any string that you use to identify the session. All traces with the same sessionId will be grouped together.

from langfuse import Langfuse
langfuse = Langfuse()
 
trace = langfuse.trace(
    session_id="your-session-id"
)

Example

Try this feature using the public example project.

Example session spanning multiple traces

Session view

Other features

  • Publish a session to share with others as a public link
  • Bookmark a session to easily find it later
  • Manually evaluate sessions by adding scores from the Langfuse UI

Was this page useful?

Questions? We're here to help

Subscribe to updates