Skip to Content
Rius

How can I see one whole conversation for my AI agent?

Rius shows one whole conversation as a session, which groups the trace of every turn by the session.id you set on your spans. You open it from the Session link in a trace header, which lists every span in that conversation on the Spans tab. Each turn is its own trace, so the waterfall shows one turn and the session ties the turns together.

How it works

A trace is one run of your agent, so in a chat each turn is a separate trace. A session is the id your application assigns to tie those turns together. The SDK stamps it as the session.id attribute on every span in scope, so you can reuse an id you already have, such as a conversation id or a job id. The grouping rides on traces, so a conversation that outlives a deploy or moves between replicas stays one session.

What has to be on the spans:

  • session.id on every span, root included. Set it on the root span too, or the root will not carry the session.
  • The same value on every turn of the conversation.
  • Prompts and replies, if you want to read the messages themselves. These are the content attributes gen_ai.input.messages and gen_ai.output.messages. They are sent by default. If RIUS_CAPTURE_CONTENT is false or your instrumentation never records them, you still get the session grouping, timings, tokens and cost, but no message text.

A trace with no session.id is its own single-trace session. If an agent’s session count equals its trace count, nothing is setting session.id, and those sessions are not real conversations. For background on how sessions fit the rest of the data model, see Concepts.

Set it up

  1. Choose the id. Use something that stays the same for the whole conversation, such as your chat or ticket id.
  2. Set it on your spans. In Python, use rius.session. In TypeScript, use withSession. Either one stamps the id on every span inside its scope. To set one id for a whole process, set RIUS_SESSION_ID instead. That fits a single job, not a server handling many chats at once.
export RIUS_SESSION_ID=chat-881
  1. Send a few turns, then open Traces. Open any turn and look at the header. It shows the session, and the session is a link.
  2. Click the Session link. It opens the Spans tab filtered to that session, so you see every span from every turn of the conversation in one list. You can also paste the session id into the search box on Spans, which matches session ids across the whole time range.
  3. To stay on the trace list, click Add filter, pick the session.id field, choose is, and enter your id. Filters live in the URL, so you can copy the link to the same filtered list.
  4. Select a span and open its Input / Output tab to read the prompt and reply. Use the previous and next buttons, or j and k, to step through the spans while the tab stays open.

For the full tour of these views, see Exploring traces.

What you get

  • A conversation in one list. The Spans tab filtered to a session shows every span from every turn, and you can sort it by time, tokens, cost or duration.
  • The session in the waterfall header. Each trace header shows the session next to the duration, span and error counts, tokens and cost, and also the end user and agent version when the trace carries them. The waterfall itself shows only the turn you opened.
  • The messages in span details. The Input / Output tab renders the prompt and completion of each call.
  • What changed between calls. On an LLM span with captured messages, Since previous llm call marks each message as added, removed or changed, so you can see what each step added to the conversation.
  • Context growth. For a trace with several LLM calls, a strip above the tree plots input tokens per call in order.

A shared view of the trace list never includes session ids or span content, so use it to hand over a failure, not a conversation. The broader picture of watching agents in production is in Monitor AI agents in production.

When something else fits

  • If you want to follow one person across several conversations, set user.id as well and use the Users page, since a session covers a single conversation or job.
  • If you only need to inspect one turn in depth, the waterfall and the Map tab of a single trace are enough, and no session id is needed.

Still stuck? Get help

Last updated on