This integration is in beta, so its API may change.
The Pipecat integration requires
langsmith[pipecat]>=0.9.7.OpenAIRealtimeLLMService) need one extra call to capture the user’s transcript. See When using Pipecat with a realtime model.
Install
Install the integration along with the Pipecat service extras your pipeline uses:Set environment variables
The integration reads your LangSmith credentials from the environment and exports to LangSmith for you via OpenTelemetry:.env
Set up tracing
Importconfigure_pipecat and call it once before building your pipeline. Enable tracing on the PipelineTask:
Set
enable_tracing=True, enable_turn_tracking=True, and enable_metrics=True. Turn tracking is required for tracing, and metrics drive the latency and token data on each span.Use a LangGraph or LangChain agent as the LLM
If your LLM stage is an in-process LangGraph or LangChain agent, its model and tool runs should nest inside Pipecat’sllm span rather than forming a separate trace. To achieve this:
- Pass
configure_pipecat(llm_span_kind="chain"). This avoids nestedllmspans that don’t actually represent inference requests. - Set
LANGSMITH_TRACING_MODE=otelin the environment. Without it, those runs post to LangSmith directly and form a separate trace instead of nesting.
Use your own tracer provider
configure_pipecat() builds a TracerProvider, registers the LangSmith span processor, and wires it into Pipecat. To send spans through a TracerProvider you already manage (for example, one that also exports to another OpenTelemetry backend), skip configure_pipecat and add the processor to your provider directly:
Group a conversation into a thread
To group a conversation’s runs into a LangSmith thread for thread-level views and token and cost aggregation, callset_thread_id once per conversation before its spans are emitted:
When using Pipecat with a realtime model
With a speech-to-speech (realtime) model there is no separate speech-to-text stage, so the user’s transcript is never emitted as an OTel span. Instead it arrives through the user context aggregator’son_user_turn_message_added callback, which Pipecat fires once it has the finalized user text. Without wiring it up, the trace shows only the assistant side.
Call instrument_user_aggregator once, right after building the context aggregator, so the SDK subscribes to that callback for you and pairs each transcript with its turn. It correlates by the id you pass to set_thread_id, so set that first and pass the same id:
instrument_user_aggregator requires langsmith[pipecat]>=0.10.6.InputAudioTranscription) on the session; otherwise the model receives raw audio and produces no user-side text, so the aggregator never fires. Other realtime services that surface the user’s text through the aggregator themselves (for example, Gemini Live) need only the instrument_user_aggregator call, with no extra session configuration.
Only call instrument_user_aggregator for realtime models. In the STT/LLM/TTS cascade the transcript is already captured (from the speech-to-text stage), so calling it there would record the user’s turns a second time.
Record the conversation audio
Attach the conversation audio to the trace using Pipecat’sAudioBufferProcessor. Place it after transport.output() so it captures what was actually played (after any barge-in truncation), hand it to the integration, and start it once the session is running:
Next steps
Voice fundamentals
Core conventions for tracing voice agents.
Upload files with traces
Attach the conversation audio recording to your trace.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

