Skip to main content
This integration is in beta, so its API may change.
Gemini Live is a speech-to-speech model that streams typed events over a WebSocket. Whether you build with a raw google-genai connection or the Google Agent Development Kit (ADK), the integration captures each conversation as a single LangSmith trace with spans for transcripts, model responses, tool calls, turn boundaries, and interruptions. Trace your Gemini Live voice agents to LangSmith. For high-level conventions, see Voice tracing fundamentals. To trace non-live text agents, tools, and multi-agent workflows built with ADK, see Trace Google ADK applications.

Choose an approach

LangSmith provides a tracing integration for each way to connect to Gemini Live:
  • If you connect directly with client.aio.live.connect(...), use wrap_gemini_live.
  • If you build with Google ADK, use LangSmithGoogleADKLivePlugin.

Install

Use the Gemini Live client

Install the gemini-live extra for a raw google-genai connection:

Use Google ADK

Install the google-adk-live extra for an ADK application:
The ADK Live integration requires langsmith[google-adk-live]>=0.9.7. This extra is separate from the langsmith[google-adk] batch integration.

Set environment variables

.env

Use the Gemini Live client

Use this approach when your application opens the WebSocket with client.aio.live.connect(...) and owns the audio and tool loops.

Set up tracing

Enable input and output transcription in the live configuration. wrap_gemini_live returns a transparent proxy for the connected session, so your existing receive loop, audio handling, and tool dispatch remain unchanged:
Transcription is opt-in. To show transcripts in the trace, set both input_audio_transcription and output_audio_transcription on LiveConnectConfig.

Group a conversation into a thread

Each wrapped session is captured as its own trace with its own thread ID. To supply an ID, for example to group the conversation with related interactions in a LangSmith thread, pass thread_id:
Create one wrapper per connected Gemini Live session. Each wrapper owns isolated tracing and transcript state, so concurrent conversations remain separate.

Record the conversation audio

Feed microphone and playback audio to the wrapped session to attach a single stereo recording, with the user on the left channel and the agent on the right channel:
Record both channels as PCM16 at the wrapper’s sample_rate. Record the agent’s audio from the speaker so the attachment reflects only what the user heard. For the underlying attachment API, see Upload files with traces.

Use Google ADK

Use this approach when ADK owns the Gemini Live session and tool loop.

Set up tracing

Import LangSmithGoogleADKLivePlugin and register it on your Runner. It runs alongside your run_live loop, so your loop only handles audio playback, barge-ins, and UI updates:
Transcription is opt-in. To show transcripts, set both input_audio_transcription and output_audio_transcription on RunConfig.
On a graceful end, when the live request queue closes, ADK sends its after_run callback and the plugin finalizes the trace.On a cancelled run, such as a console app that stops run_live on Ctrl-C, ADK might not send that callback. Call plugin.finalize(session_id=adk_session.id) during teardown so the trace and audio attachment are finalized. The call is idempotent, so it does nothing if ADK’s callback already ran.

Group a conversation into a thread

Each conversation is captured as its own trace with its own thread ID. To supply an ID, for example to group the conversation with related interactions in a LangSmith thread, pass a thread_id_provider to the plugin:
A single plugin instance is shared across every run_live call and resolves the thread ID once at the start of each conversation. The default keeps concurrent conversations separate. If you pass a thread_id_provider on a server handling concurrent conversations, return the ID for the current conversation, for example by reading a ContextVar set at the start of each run.

Record the conversation audio

Feed microphone and playback audio to the plugin to attach a single stereo recording, with the user on the left channel and the agent on the right channel:
Record the user’s microphone capture before resampling it for ADK, and record the agent’s audio from the speaker. Feed both channels at the same sample rate. The plugin’s sample_rate is 24 kHz by default. For the underlying attachment API, see Upload files with traces.

Next steps

Voice fundamentals

Core conventions for tracing voice agents.

Upload files with traces

Attach the conversation audio recording to your trace.