LiveKit Agents is an open-source framework for Python and Node.js that handles production-grade voice and multimodal AI applications. The framework provides abstractions for routing realtime media through AI pipelines, supporting STT-LLM-TTS voice workflows and speech-to-speech models across providers.
This guide covers routing telemetry from LiveKit Agents to InteractiveAI for monitoring, debugging, and evaluating realtime voice AI applications.
Prerequisites
InteractiveAI account with API credentials
LiveKit account and API credentials
LLM provider credentials (OpenAI, Ollama, or other supported provider)
Configuration
Set your InteractiveAI credentials as environment variables:
LiveKit Agents includes native OpenTelemetry support. Configure a tracer provider using set_tracer_provider in your entrypoint function to route spans to InteractiveAI.
import base64import osfrom livekit.agents.telemetry import set_tracer_providerdefsetup_interactiveai(host:str|None=None,public_key:str|None=None,secret_key:str|None=None):from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporterfrom opentelemetry.sdk.trace import TracerProviderfrom opentelemetry.sdk.trace.export import BatchSpanProcessor public_key = public_key or os.getenv("INTERACTIVEAI_PUBLIC_KEY") secret_key = secret_key or os.getenv("INTERACTIVEAI_SECRET_KEY") host = host or os.getenv("INTERACTIVEAI_HOST")ifnot public_key ornot secret_key ornot host:raiseValueError("INTERACTIVEAI_PUBLIC_KEY, INTERACTIVEAI_SECRET_KEY, and INTERACTIVEAI_HOST must be set") auth_string = base64.b64encode(f"{public_key}:{secret_key}".encode()).decode() os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"]=f"{host.rstrip('/')}/api/public/otel" os.environ["OTEL_EXPORTER_OTLP_HEADERS"]=f"Authorization=Basic {auth_string}" trace_provider =TracerProvider() trace_provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))set_tracer_provider(trace_provider)asyncdefentrypoint(ctx: JobContext):setup_interactiveai()# Agent session setup continues here# ...
Complete Example
A full implementation with agent, tool usage, and session metadata:
Trace Visibility
The InteractiveAI platform displays:
Complete conversation flows with turn-by-turn breakdown
LLM requests with prompts, completions, and latency
Speech-to-text and text-to-speech conversion times