https://retellai.com/?utm_source=discord&utm_medium=seo logo
Agent keeps calling the same custom function over ...
# ❓・bug-report
g
I run an AI voice assistant for medical practices, and I have built a prompt with different custom functions. In some calls, very strangely, the agent starts calling the same function over and over for as far as 3 minutes, without interacting with the caller whatsoever. It looks like the agent is unable to resume the conversation and keeps calling the same custom function , without any reason. We saw it happening already three times, and we are messing up this calls because of this issue. Please address this ASAP
s
hi @giovannino1708 Add Error Handling in Your Prompt Update your agent's prompt to include explicit instructions about when NOT to call the function:
g
hi @User thanks. What do you mean by Error Handling? Because this seems a repetition of calls over and over all the times, not a scenario where the agent calls a function that it should not call, or there is an error response
to give you an idea this is an extract from a reall call: at some point the agent starts calling search_patient_by_dob for many times, without engaging in the conversation with the human https://cdn.discordapp.com/attachments/1410698405176545464/1410706831776678036/Screenshot_2025-08-28_at_3.23.54_PM.png?ex=68b1fe9e&is=68b0ad1e&hm=72d2e75f2e81b48669ffd30afdf7b0104878a2eecfba95247d3f39c46a455f49&
Please read this document, because prompting is very important in the agent. It might help clear your issue.