Summary
Add a session export capability to the Voice Agent client that captures and structures conversation data — per-turn transcripts, latency metrics (STT/LLM/TTS breakdown), function calls, and audio segment references — as a serializable JSON session object for post-session analytics, quality scoring, and debugging.
Problem it solves
Developers building production voice agents need to analyze conversation quality, debug issues, and track metrics after sessions end. Currently, developers must manually instrument every event callback to collect this data, leading to boilerplate code and inconsistent coverage. A built-in session export would provide structured, complete conversation data without custom instrumentation — enabling post-session analytics dashboards, quality scoring pipelines, compliance review, and debugging workflows out of the box.
Proposed API
from deepgram import DeepgramClient
client = DeepgramClient()
agent = client.agent.websocket.v1()
# ... run voice agent conversation ...
# Export structured session data
session = agent.export_session()
# Access per-turn data
for turn in session.turns:
print(f"Speaker: {turn.speaker}")
print(f"Transcript: {turn.transcript}")
print(f"STT latency: {turn.stt_latency_ms}ms")
print(f"LLM latency: {turn.llm_latency_ms}ms")
print(f"TTS latency: {turn.tts_latency_ms}ms")
print(f"Tools called: {turn.function_calls}")
# Export as JSON for storage
session.to_json("session_export.json")
# Session-level aggregate metrics
print(f"Total turns: {session.total_turns}")
print(f"Avg TTFB: {session.avg_time_to_first_byte_ms}ms")
print(f"Duration: {session.duration_seconds}s")
Acceptance criteria
Raised by the DX intelligence system.
Summary
Add a session export capability to the Voice Agent client that captures and structures conversation data — per-turn transcripts, latency metrics (STT/LLM/TTS breakdown), function calls, and audio segment references — as a serializable JSON session object for post-session analytics, quality scoring, and debugging.
Problem it solves
Developers building production voice agents need to analyze conversation quality, debug issues, and track metrics after sessions end. Currently, developers must manually instrument every event callback to collect this data, leading to boilerplate code and inconsistent coverage. A built-in session export would provide structured, complete conversation data without custom instrumentation — enabling post-session analytics dashboards, quality scoring pipelines, compliance review, and debugging workflows out of the box.
Proposed API
Acceptance criteria
Raised by the DX intelligence system.