How to Test and Debug AI Conversations in Agent Studio

Testing and Debugging AI Conversations

Agent Studio includes powerful built-in tools for testing and refining your AI agents before you deploy them. The Message Execution Timeline and Chat Emulator give you complete visibility into every step of a conversation, allowing you to identify issues, optimize performance, and ensure your agent works as intended.

Understanding the Testing Tools

The Message Execution Timeline and Chat Emulator are integrated into the Agent Studio testing environment. The Timeline records a detailed log of every action your agent takes, including node transitions, tool calls, and model interactions. The Chat Emulator provides a simulated chat interface where you can interact with your agent just like an end-user would. Together, these tools help you trace the logic of a conversation and make targeted improvements.

Key Features for Debugging

Using these tools offers several advantages:

  • Complete Transparency: See the exact sequence of events and decisions your agent makes.
  • Performance Insights: Identify slow steps, such as lengthy API calls or prompts, directly within the log.
  • Model and Cost Details: View the AI model used, token counts, and estimated costs for each message.
  • Direct Node Access: Click on any logged step to jump directly to the corresponding node in your workflow for immediate editing.
  • Realistic Testing: Validate your agent's behavior in a chat interface that mimics the live user experience.

Using the Message Execution Timeline

The Timeline panel appears next to the Chat Emulator during a test session and updates in real time. It displays a series of event cards, each representing a step in the conversation.

Each card shows the name of the node that was executed, the AI model used, the number of input and output tokens, and the execution time. Steps that take longer to process are highlighted with a color-coded badge to quickly flag potential bottlenecks. You can hover over an event to see the raw input and output data for detailed inspection.

For agents that perform multi-step tasks, the Timeline also tracks progress using a task manager. Tasks are shown with descriptive labels and status updates, making it easy to follow the agent's progress through a complex plan.

Within the Timeline, each step includes a clickable label that indicates which node the conversation transitioned to. Clicking this label will immediately highlight and focus on that specific node within your agent's workflow canvas. This feature allows you to quickly review and edit the logic responsible for a particular response without manually searching through your flow.

Reviewing Performance Metrics

Beneath each message log in the Timeline, a metrics panel displays key information about the AI model's execution. This includes the model name and version, the number of input and output tokens consumed, settings like temperature, and an estimated cost if billing is enabled for your account. This data helps you assess the efficiency and cost-effectiveness of your agent's responses.

Using the Chat Emulator

The Chat Emulator provides a clean, mobile-friendly chat window for testing. It includes features like an agent avatar and a reset button to clear the conversation history and start a new session. The emulator is displayed side-by-side with the Timeline, so you can see the immediate impact of your messages on the agent's execution flow.

Step-by-Step Testing Process

Follow these steps to test and debug your AI agent.

  1. Access the Test Environment: From your CRM dashboard, go to AI Agents and select Agent Studio. Open the agent you wish to test and click the Test tab in the top-right corner of the screen. The system will check your agent for any missing required fields and display an orange warning if any are found. It is recommended to complete these fields to prevent errors, but testing can proceed.
  2. Start a Session: Click the Start button to launch the Chat Emulator. The Message Execution Timeline will appear automatically. Send a test message to your agent or trigger it via an API call.
  3. Review the Logs: As the agent responds, watch the Timeline fill with event logs. Examine each step to understand the flow of the conversation, paying attention to node names, tool activity, token usage, and execution times.
  4. Inspect Performance: Click on individual log entries to view detailed performance metrics for that step. Use this information to identify areas for optimization, such as slow API calls or high token usage.
  5. Debug and Iterate: If you find an issue, use the Transition Node button to jump directly to the relevant node in your workflow. Make your adjustments, reset the chat session, and test again to confirm the fix.

By using these tools together, you can confidently refine your AI agent's performance and logic before making it available to users.