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.
/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
SetVOICEFLOW_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.
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
idyou create per Voiceflow session becomes the Agnost AI conversation ID. Do not use the session key; it is a credential. user_idbecomes the Agnost AI user ID. Use the same value you send to Voiceflow asuserID.- The user’s text is the event input. Every
textandspeaktrace’spayload.messagein the response, joined with newlines, is the output. - An HTTP error, including Voiceflow’s
402when the account is out of credits, is recorded as a failed event with the error text. - The
launchgreeting 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
- Start a conversation and send two messages through your integration.
- Open Conversations in app.agnost.ai. Both messages appear in one conversation for the user ID you passed.
- 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_textreadstextandspeaktraces. Add the trace types your agent uses. - Each message is its own conversation: reuse the
conversationreturned bystart_conversation()for later messages instead of starting a new session. 401from Voiceflow: session creation needs your API key;/v4/interactneeds the returnedsessionKey.- Nothing appears in Agnost AI: confirm
agnost.init()runs once at startup with your organization ID, and that a short-lived script callsagnost.shutdown()before it exits.
References
- Voiceflow: start a session
- Voiceflow: send actions
- Voiceflow: handling responses
- Voiceflow: session lifecycle webhook
- Agnost AI Python SDK
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.