https://retellai.com/?utm_source=discord&utm_medium=seo logo
we have a lot of latency in some steps of our call...
# ❓・ai-evy-support
n
@AI Evy we have a lot of latency in some steps of our calls, how can we fix that
a
Thanks for tagging me @Nico Walter. I'll look through relevant sources and get back to you shortly.
### Answer To troubleshoot high latency in your calls, follow these steps: ## 1. Check Your Actual Latency Metrics Monitor latency for individual calls in the "Call History" section of your dashboard. [(1) ]() Key metrics to review: - **P90 (90th Percentile) **: 90% of calls have latency below this value - **Median (50th Percentile) **: Half of the calls have latency less than this value - **Min**: The fastest response time achieved ## 2. Troubleshooting Steps (if P90 exceeds 3 seconds) **Check Estimated Latency**: Look for features marked with a turtle icon 🐢 in your configuration. If estimated latency is higher than 1.5s, disable some features to reduce latency. [(2) ]() **Monitor LLM Response Time**: Compare your LLM latency against the normal range (500ms - 900ms) . If consistently above 900ms: - Use the fast tier - Switch to an alternative LLM provider - Or wait for your current provider to resolve performance issues **Check the Status Page**: Visit [status.retellai.com]() for any ongoing issues. **Consider Geographic Distance**: International calls may introduce additional latency. Consider getting a local phone number in the same region as your users. ## 3. Additional Optimizations - **Change to a Faster LLM**: Use a more efficient language model to reduce response time [(3) ]() - **Change to a Faster TTS**: Implement a faster text-to-speech system for quicker audio output If issues persist, contact support with your call ID and current latency measurements. [(2) ]()
​ To learn more, see the sources I considered: [[1] Check actual latency](https://docs.retellai.com/reliability/check-actual-latency) [[2] Troubleshoot high latency](https://docs.retellai.com/reliability/troubleshoot-latency) [[3] Troubleshooting AI Voice Agent Issues | Retell AI](https://www.retellai.com/blog/troubleshooting-common-issues-in-voice-agent-development) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
n
if a tool makes a http rqeuest it takes a lot more thant the roundtrip
@AI Evy if a tool makes a http rqeuest it takes a lot more thant the roundtrip
a
Thanks for the follow-up, @Nico Walter. I'll get back to you soon.
### Answer When custom functions make HTTP requests, the request timeout and your endpoint's response time directly impact call latency. Here are some ways to address this: ## Configure Timeout Settings For custom functions, the request will timeout in your specified timeout period, or 2 minutes if not specified. [(1) ]() You can set a shorter timeout to prevent long waits. When a request fails, it will be retried up to 2 times. ## Optimize Your Endpoint - Ensure your server responds quickly—the function result is capped at 15000 characters to prevent overloading the LLM context window - Host your endpoint geographically closer to reduce network latency - Optimize your backend logic to return faster responses ## Consider MCP for Better Performance MCP connections in Retell AI are optimized to maintain sub-second latency. [(2) ]() When configuring MCP, you can set timeout (default is 10,000 ms) to control how long the agent waits. ## Use Async Execution Custom functions support async execution—they can run in the background without blocking the conversation. [(3) ]() If your tool doesn't need to return data immediately to the conversation, consider designing it to execute asynchronously.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Connect any AI Voice Agent to MCP with Retell AI MCP Node (Guide) | Retell AI](https://www.retellai.com/blog/connect-any-ai-voice-agent-to-mcp-with-retell-ai-mcp-node) [[3] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
How do you configure a custom function to run async? In the web UI? or via the API?
Do state transitions take significant time?
@AI Evy
a
Thanks for the follow-up, @Manuel Panichelli. I'll get back to you soon.
### Answer ## Custom Function Async Configuration For custom functions, you configure the speech behavior in the dashboard (web UI) when setting up the function. The key settings are: [(1) ]() - **Speak during execution**: Whether the agent speaks when the function is called. Disable this for background tasks (e.g., attaching notes to call) . - **Speak after execution**: Whether the agent keeps talking or performs other actions after the function completes. You can disable this for tasks where you don't expect the agent to keep talking. These options control agent behavior when the user is not talking during the function call period. ## State Transition Latency I don't have specific documentation on how long state transitions take. However, the sources indicate: - Transition Accuracy is a metric that measures the accuracy of transitions between conversation nodes or states. [(2) ]() - Node Transition Inaccuracy measures incorrect node transitions in conversation flows. If you're experiencing issues with state transitions, one community member reported a similar problem where multi-prompt agent transitions were showing errors. The issue was resolved by the Retell team—it worked in actual calls but not in test chat. [(3) ]() For specific latency concerns with state transitions, I'd recommend: - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge about typical state machine transition performance?
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Terminologies](https://docs.retellai.com/ai-qa/terminologies) [[3] State Transition Error](https://discord.com/channels/1186424376300679209/1412803443172708412) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
I don't understand which config i need to turn on for a custom function to be async and for the agent to not wait for the response to move on
a
Thanks for the follow-up, @Manuel Panichelli. I'll get back to you soon.
m
@AI Evy
a
### Answer For Conversation Flow agents using a Function Node, the setting you need is "Wait for Result". [(1) ]() - **Wait for Result = OFF**: The agent will transition to the next node without waiting for the function to finish executing. - **Wait for Result = ON**: The agent waits for the function to complete before transitioning. So to make the function "async" (agent doesn't wait for the response) : 1. Set "Wait for Result" to OFF 2. Optionally set "Speak During Execution" to OFF if you don't want the agent to say anything during the function call **Important note**: Community members have reported that even with both settings OFF, there can still be delays in some cases. [(2) ]() One user found that using a faster LLM model (like GPT-4.1 Fast) on the function node helped reduce these delays. [(3) ]() For Single/Multi-Prompt agents using custom functions, the equivalent settings are: [(4) ]() - **Speak during execution**: Enable for user-facing actions, disable for background tasks - **Speak after execution**: Whether the agent keeps talking after the function completes These settings control whether the agent waits or moves on, but they're configured in the dashboard when setting up the function.
​ To learn more, see the sources I considered: [[1] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[2] Wait for Result is off and Speak During Execution is off - custom function is delayed.](https://discord.com/channels/1186424376300679209/1460216156777353340) [[3] custom function issue where static text is said after function received the response](https://discord.com/channels/1186424376300679209/1460607322358546567) [[4] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.