> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.poly.ai/feedback

```json
{
  "path": "/analytics/conversations/diagnosis",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Diagnosis

> Inspect function calls, flows, latency, and topic citations.

Use Conversation Diagnosis when you need to understand *why* the agent behaved a certain way on a specific turn – which functions ran, which topics were cited, and where latency occurred. Toggle data layers in the diagnosis panel to inspect each turn in detail.

## Available diagnosis layers

You can toggle the following diagnostic views on and off to inspect conversation execution at different levels:

### Conversation variables

Displays live variable values captured during the call (e.g., booking IDs, customer names, flags).

### Flows and steps

Tracks the agent's navigation through [flows](/flows/introduction) and steps, showing the execution path and decisions made.

### Tool calls

View the [tools](/tools/introduction) the agent triggered during the call, including call parameters and outcomes.

<img src="https://mintcdn.com/polyai/5v8wq3rxZpAOwLmu/images/analytics/conversations-tool-call.png?fit=max&auto=format&n=5v8wq3rxZpAOwLmu&q=85&s=378fa34b4cf62f10290f4c34850aa0cf" alt="conversations-tool" width="2536" height="1496" data-path="images/analytics/conversations-tool-call.png" />

### Topic citations

Highlights the [Knowledge](/managed-topics/introduction) topics the agent matched for each response.

<img src="https://mintcdn.com/polyai/Qu880HppNqT19Eyr/images/analytics/conversations-matched-topics.png?fit=max&auto=format&n=Qu880HppNqT19Eyr&q=85&s=ee26c0e82828b662b1dd96181c3c1b22" alt="conversations-topics" width="1987" height="1980" data-path="images/analytics/conversations-matched-topics.png" />

### Sources

Shows which [Connected Knowledge](/connected-knowledge/introduction) source files the agent retrieved for each turn. Click a source name to open an inline preview panel showing the retrieved content. Use **Open in Knowledge** in the panel to navigate directly to the source.

<img src="https://mintcdn.com/polyai/oJYezcMyRUCRUcF2/images/release-notes/2603/sources-conversation-review.png?fit=max&auto=format&n=oJYezcMyRUCRUcF2&q=85&s=30136d02337a40f96ad576f18627ad3f" alt="sources-conversation-review" width="1658" height="722" data-path="images/release-notes/2603/sources-conversation-review.png" />

### Transcript corrections

Displays where the automatic transcript was edited for clarity or accuracy. Use it to distinguish ASR errors from agent logic problems.

### Turn latency

Measures how long the agent took to respond at each turn.

<Info>
  Latency visualization includes component-level timing breakdowns.
</Info>

#### Latency breakdown

When viewing turn latency, you can inspect timing for:

| Component               | Description                                                             |
| ----------------------- | ----------------------------------------------------------------------- |
| **LLM requests**        | Time spent waiting for the language model to generate a response        |
| **Function calls**      | Time spent executing functions, including API calls and data processing |
| **Total response time** | Combined time from user speech end to agent response start              |

Use these breakdowns to:

* Identify slow function calls that need optimization
* Understand LLM response times for different query types
* Find bottlenecks causing user-perceived delays
* Compare latency across different conversation types

<Tip>
  High LLM latency may indicate complex prompts that could be simplified. High function call latency often points to slow external API dependencies.
</Tip>

### Interruptions

Shows when the caller interrupted the agent or when barge-in was detected. Use this to understand if caller behavior affected conversation flow.

### Variants

Identifies which [variant](/variant-management/introduction) handled each part of the call.

### Logs

Displays [function logs](/tools/classes/conv-log) and any structured `conv.log` entries emitted during runtime. This includes entries from [`conv.log.info()`, `conv.log.warning()`, and `conv.log.error()`](/tools/classes/conv-log), as well as API response logs from [`conv.log_api_response()`](/tools/classes/conv-object#log_api_response). Use this layer to debug function behavior and track API responses.

### Entities

Lists **extracted entities** captured from the user, like booking numbers, account IDs, or city names. This is especially useful in transactional scenarios where the agent needs to capture structured data from free text.

## Using diagnosis for optimization

Combine multiple diagnosis views to understand agent behavior:

1. Enable **Turn latency** to identify slow responses.
2. Check **Tool calls** for those turns to see if external calls are causing delays.
3. Use **Sources** to verify the content the agent retrieved from Connected Knowledge.
4. Use **Flows and steps** to verify the agent followed the expected path.

## Related pages

* [Conversation review](/analytics/conversations/review) – Full conversation analysis
* [Performance monitoring](/learn/maintain/performance-monitoring) – Ongoing performance management
* [Tools](/tools/introduction) – Build and optimize functions
