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.
Ultravox sends a call.ended webhook when a call finishes, but the payload holds only the call object. The transcript lives behind the List Call Messages API, which needs your Ultravox API key. To keep that key on your own server, Agnost AI does not receive Ultravox webhooks directly. Instead, your webhook handler fetches the messages and records each exchange with the Agnost AI SDK. Hosted Ultravox calls do not export OpenTelemetry traces, so this guide has no OpenTelemetry section. If you run the Ultravox model inside Pipecat or LiveKit Agents, use the OpenTelemetry route for those frameworks instead. See Ultravox in Pipecat or LiveKit Agents.

Manual setup: Agnost AI SDK

Install

Add the webhook handler

Save this as ultravox_webhook.py. It verifies the Ultravox signature, answers 204 right away, then fetches the call’s messages and sends one Agnost AI event per caller and agent exchange.
Set three environment variables and run it:
Each call becomes one Agnost AI conversation keyed by the Ultravox callId. The agent name comes from the Ultravox agent’s name. The user ID comes from a user_id key in the call’s metadata, so set it when you create the call. Without it, the call ID is used. Tool calls the agent made while answering are attached to that exchange as the tool_calls property. The call is over when the webhook arrives, so the handler uses agnost.track() with the exchange’s input, output, and latency rather than begin() and end().

Subscribe to call.ended

Expose the handler at a public HTTPS URL, then create the webhook with the Ultravox API:
Without an agentId, the webhook covers every call in your account. Add "agentId": "<agent-id>" to cover one agent.

Verify

  1. Place a short call with the agent and say at least one sentence as the caller.
  2. Check your server log for a 204 response to POST /ultravox/webhook.
  3. In app.agnost.ai, open Conversations and find the Ultravox call ID. Each exchange shows the caller’s words as input and the agent’s reply as output, with an exchange_index property that gives its order in the call.

Troubleshooting

  • The handler returns 401: check that ULTRAVOX_WEBHOOK_SECRET matches a secret on the Ultravox webhook, and that your server clock is correct. The handler rejects deliveries more than one minute old.
  • The handler returns 204 but no conversation appears: the call was never joined, or the caller never spoke. Check the server log for an error from the messages request, such as a 401 from a wrong ULTRAVOX_API_KEY.
  • Exchanges show the time they were sent instead of their time in the call: agnost 0.2.1 on PyPI does not forward the timestamp argument yet. Use exchange_index to read the order.
  • A call appears twice: Ultravox can deliver the same webhook more than once and retries failed deliveries. Store the call IDs you have processed and skip repeats.
  • Users show as call IDs: set a user_id key in the call’s metadata when you create the call.

Ultravox in Pipecat or LiveKit Agents

Pipecat and LiveKit Agents both ship an Ultravox integration. When Ultravox runs inside one of those frameworks, the framework’s own telemetry covers the call, so follow the Agnost AI Pipecat or LiveKit guide and skip the webhook handler above.

References

Next steps

  • Conversations: review complete Ultravox calls.
  • Events: inspect each caller and agent exchange.
  • Patterns: understand why callers contacted the agent.