Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
Manual setup: Agnost AI SDK
Install
Add the turn tracker
The tracker reads the messages Deepgram already sends to your client:ConversationTextwithroleuserstarts an interaction with the user’s words as input.ConversationTextwithroleassistantis added to the reply. Think Live backchannels such as “mhmm” are skipped.FunctionCallRequest,FunctionCallResponse, andFunctionCallCancelledrecord the agent’s function calls and their results.UserStartedSpeakingor the next user turn ends the previous interaction.AgentAudioDonesets its latency to the end of the agent’s speech.Errorends the open interaction as failed.
Connect it to the WebSocket
Register the tracker’son_message next to your own message handler. Use your own call or session ID as conversation_id and your user ID as user_id.
client_side: true), pass its result to the tracker where you send the FunctionCallResponse:
AgentV1SendFunctionCallResponse comes from deepgram.agent.v1.types.
Call agnost.flush() after each session so short-lived workers send the last turn. Call agnost.shutdown() once when the process exits, not after each session.
What appears in Agnost AI
- One conversation per
conversation_id, under the user fromuser_id. - One event per user turn, with the user’s words as input and everything the agent said in reply as output.
- Function calls as a
tool_callsproperty on the turn that made them, with each call’sname,arguments, andresult. Cancelled speculative calls are dropped. - Deepgram’s
request_idfromWelcomeasdeepgram_request_id, so you can match a turn to Deepgram’s usage logs. - Latency from the end of the user’s turn to the end of the agent’s speech.
Verify
Run one session, then open app.agnost.ai. Confirm:- Users shows the value you passed as
user_id. - The conversation has one event per user turn, with the user’s words as input and the agent’s reply as output.
- A turn that called a function shows
tool_callsin its event metadata.
Troubleshooting
- No events: register
tracker.on_messagebeforestart_listening(), and callagnost.flush()before the process exits. - The last turn is missing: call
tracker.finish()when the connection closes. - A turn has an empty output: the user hung up or barged in before the agent replied.
- A function call has no
result: calltracker.record_function_result()where you sendFunctionCallResponsefor client-side functions. - Each turn is a separate conversation: pass the same
conversation_idfor the whole session.
References
- Deepgram: Voice Agent API overview
- Deepgram: Build a Voice Agent with Python
- Deepgram: Conversation Text
- Deepgram: Function Call Request
- Deepgram: Speculative replies and turn confirmation
- Deepgram: Session observability
Why there is no OpenTelemetry section
The Voice Agent API is a hosted service. It does not emit OpenTelemetry spans to your application, and it has no tracing setting to export them. The WebSocket messages are the only record of the conversation, which is why Deepgram’s own session observability guide recommends logging them from your client. If you build the agent with Pipecat or LiveKit Agents and use Deepgram only for speech-to-text and text-to-speech, use the Pipecat or LiveKit Agents OpenTelemetry guides instead.Next steps
- Conversations: review complete Deepgram voice sessions.
- Events: inspect each user turn and agent reply.
- Patterns: understand why users talked to the agent.