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.
When your app talks to a Voiceflow agent through the Dialog API, your server sends each user message to /v4/interact and receives the agent’s reply as traces. Wrap that call with the Agnost AI SDK to record one event per user message, with the agent’s reply as the output.

Manual setup: Agnost AI SDK

Install

Setup

Set VOICEFLOW_API_KEY to a Voiceflow API key with access to the project, and VOICEFLOW_PROJECT_ID to the project ID from the agent’s settings. Keep the API key on your server.
Call start_conversation() when a customer opens a chat and store the result with that customer’s chat state. Call send_message() for each message they send, and render the returned traces as you do today. main is the environment alias; use the alias of the environment you deploy to. Call agnost.shutdown() once when the application exits, not after each request. Shutting down per request disables telemetry for later messages in the same process.

Data mapping

  • The id you create per Voiceflow session becomes the Agnost AI conversation ID. Do not use the session key; it is a credential.
  • user_id becomes the Agnost AI user ID. Use the same value you send to Voiceflow as userID.
  • The user’s text is the event input. Every text and speak trace’s payload.message in the response, joined with newlines, is the output.
  • An HTTP error, including Voiceflow’s 402 when the account is out of credits, is recorded as a failed event with the error text.
  • The launch greeting is not recorded, because the customer has not said anything yet.

Why there is no OpenTelemetry section

Voiceflow runs your agent on its own servers and does not export OpenTelemetry traces. Voiceflow’s session webhooks report when a conversation starts and ends, but they carry IDs, not the transcript, so record each turn where your code calls the Dialog API. Conversations on Voiceflow’s hosted chat widget and phone numbers do not pass through your code, so this setup does not capture them.

Verify

  1. Start a conversation and send two messages through your integration.
  2. Open Conversations in app.agnost.ai. Both messages appear in one conversation for the user ID you passed.
  3. Open an event and confirm the input is the user’s message and the output is the agent’s reply.

Troubleshooting

  • Outputs are empty: the agent answered with buttons, cards, or carousels only. reply_text reads text and speak traces. Add the trace types your agent uses.
  • Each message is its own conversation: reuse the conversation returned by start_conversation() for later messages instead of starting a new session.
  • 401 from Voiceflow: session creation needs your API key; /v4/interact needs the returned sessionKey.
  • Nothing appears in Agnost AI: confirm agnost.init() runs once at startup with your organization ID, and that a short-lived script calls agnost.shutdown() before it exits.

References

Next steps

  • Conversations: review complete Voiceflow conversations.
  • Events: inspect each user message and the agent’s reply.
  • Patterns: organize production conversations by what users wanted.