Hello guys.. I have two questions.. 1. For realtim...
# ask-ai
s
Hello guys.. I have two questions.. 1. For realtime model (e.g OpenAI Realtime, Google Live API). Is there a quick and "built-in" option to have observability? (just like LangSmith, to get detailed tracing on what's happening during the session) 2. When we use realtime model (e.g OpenAI Realtime), when the token is growing, the Time to first token is getting slower and slower. I know that natively Gemini Live API has this context compression mechanism (but it doesn't quite work well, and it's quite hard for me to interact with the API because not much we can do to manipulate the conversation messages). But OpenAI Realtime has this more convenient way to manipulate the conversation so we can think doing the context compression ourself. In LangChain there is this https://docs.langchain.com/oss/python/langchain/middleware/built-in#summarization summarizaion middleware. It's pretty convenient. Do Livekit have something like this? A configuraton that we can set to maintain the maximum token to enable longer conversation with faster interaction.
t
Thanks for reaching out, Galih. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’ll answer both questions directly. 1) Observability for realtime models LiveKit provides built-in Agent Observability in the Cloud Dashboard: synchronized session playback (audio + transcript), a trace view with pipeline events and timings (LLM, TTS, end-of-turn, etc.), and transcripts/logs with inline alerts. It works with realtime providers like OpenAI Realtime and Gemini Live when enabled. To use it enable observability in your Project’s Data & privacy settings and record sessions (SDKs: Python v1.3+ or Node v1.0.18+). If you want trace export, LiveKit can integrate with tools like LangFuse or OpenTelemetry for additional tracing. 2) Managing token growth / context compression LiveKit does not provide a zero‑config summarization middleware like LangChain’s built-in summarizer. However, you can implement the same behavior because LiveKit gives you programmatic access to conversation state and events: • You can read and modify the
ChatContext
(message history) in your agent code and trim or replace old turns with summaries before sending context to the realtime model. • Use Realtime events (e.g., conversation item created, response.done) to trigger summarization logic and call the modify API to update server-side conversation state. • Use TaskGroup APIs to structure conversations into discrete tasks and optionally summarize/condense context after each task to prevent unbounded token growth. • Optionally export traces to LangFuse/OpenTelemetry while developing a summarization strategy to measure Time to First Token improvements. If you’d like, I can: • Sketch a small summarization flow tailored to OpenAI Realtime (sample event hooks + when to call summarizer + how to modify
ChatContext
), or • Suggest thresholds (by number of messages or tokens) and where to insert summaries in the pipeline. Which would you prefer — a short code sketch for OpenAI Realtime, or recommended thresholds and flow? Sources: https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal/signup| | Realtime model plugins | LiveKit Docs | examples/voice_agents | livekit/livekit_composite | DeepWiki | Tasks and task groups | LiveKit docs | Observability data hooks | LiveKit docs
s
1. Yeah, I think but it doesn't support detailed tracing like I want to get transcript and everything is that supported? because I don't see it. Correct me if I'm wrong. 2. Yeah, okay.. I'm also thinking abut that. Thanks for the info.
t
Regarding detailed tracing and transcripts — you're correct to double-check. LiveKit’s Agent Observability does include transcripts and detailed trace data (turn-by-turn traces, pipeline events with timestamps/durations, and logs) when enabled in the Cloud Dashboard. It shows synchronized audio playback, transcripts, internal pipeline events (LLM, TTS, end-of-turn detection), and inline alerts for tool calls/handoffs. If you don’t see those details in your project, a few quick checks: • Is Agent Observability enabled in your Project → Data & privacy settings? (it's disabled by default) • Are you recording sessions (
record=True
or default recording) and using an SDK version that supports observability (Python v1.3+ or Node.js v1.0.18+)? • Are you using realtime providers through LiveKit’s agent framework (OpenAI Realtime / Gemini Live) so the traces are captured? If those are set and you still don’t see transcripts or detailed traces, tell me: • Which SDK and version you’re using (Python/Node and versions), • An example session ID or agent name (or where you looked in the dashboard), and I’ll walk you through the exact place in the dashboard to find transcripts and trace views and what to enable or inspect next. Would you like that?
s
Wow! This is new! I don't see this before. And it's still beta I think.
t
You're right — that screenshot shows the Agent Insights (beta) UI and it does include transcripts and trace data. What you can see in that view: • Synchronized playback with waveform and timeline. • Transcript sidebar with timestamps and attributes (user/agent turns, handoffs, metadata). • Tabs for Trace and Logs that show turn-by-turn pipeline events, timestamps/durations (LLM, TTS, end-of-turn detection), and debug/warning/error logs. • Download data and session-level attributes (room_id, job_id, etc.). Quick checks to make those details appear for your sessions: • Enable Agent Observability in Project → Data & privacy. • Ensure sessions are recorded (
record=True
or leave default) and you’re on Python SDK v1.3+ or Node v1.0.18+. • Use LiveKit’s agent framework with realtime providers (OpenAI Realtime / Gemini Live) so traces are captured. If you want, I can: • Point you to the exact spot in the dashboard to inspect the Trace and Logs for a given session ID (share an example session ID), or • Walk through enabling observability and verifying recording in your SDK code (tell me which SDK/version you’re using). Which would you like me to do next?
s
Okay cool! Thanks.