Skip to main content

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. 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.
Install the skill once in your coding-agent environment:
Run the framework-specific prompt below from the application root. Review the resulting diff before deploying it.
The Deepgram Voice Agent API runs the whole conversation over one WebSocket that your own code opens. Deepgram has no post-call webhook, so Agnost AI captures the conversation where your code already receives it: the WebSocket messages. Each user turn and the agent’s reply become one Agnost AI interaction, grouped into one conversation per session.

Manual setup: Agnost AI SDK

Install

Add the turn tracker

The tracker reads the messages Deepgram already sends to your client:
  • ConversationText with role user starts an interaction with the user’s words as input.
  • ConversationText with role assistant is added to the reply. Think Live backchannels such as “mhmm” are skipped.
  • FunctionCallRequest, FunctionCallResponse, and FunctionCallCancelled record the agent’s function calls and their results.
  • UserStartedSpeaking or the next user turn ends the previous interaction. AgentAudioDone sets its latency to the end of the agent’s speech.
  • Error ends the open interaction as failed.

Connect it to the WebSocket

Register the tracker’s on_message next to your own message handler. Use your own call or session ID as conversation_id and your user ID as user_id.
When your code runs a client-side function (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 from user_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_calls property on the turn that made them, with each call’s name, arguments, and result. Cancelled speculative calls are dropped.
  • Deepgram’s request_id from Welcome as deepgram_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.
The greeting the agent speaks before the user’s first turn is not recorded, because no user turn is open yet.

Verify

Run one session, then open app.agnost.ai. Confirm:
  1. Users shows the value you passed as user_id.
  2. The conversation has one event per user turn, with the user’s words as input and the agent’s reply as output.
  3. A turn that called a function shows tool_calls in its event metadata.

Troubleshooting

  • No events: register tracker.on_message before start_listening(), and call agnost.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: call tracker.record_function_result() where you send FunctionCallResponse for client-side functions.
  • Each turn is a separate conversation: pass the same conversation_id for the whole session.

References

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.