https://retellai.com/?utm_source=discord&utm_medium=seo logo
AI Agent doesn't speak the Dynamic Variables
# ❓・bug-report
d
Hi @Omar Ashraf | Community Lead, have created an AI Agent with Agent ID: agent_7beea5a5f19d3ba109dce296cf. It is a conversational flow agent and have used Dynamic Variables in the flow. The values for the same are provided in the via the Inbound Webhook. Now when initiating an incoming call to the number assigned with the AI Agent, the agent doesn't speak the values for Dynamic Variables for Question 2 node only. For the Question 1 and Question 4 nodes, the agent speaks the values for the Dynamic Variables correctly. Sample CallSids 1. call_597807efef7b9e0f7098a8ffcf2 2. call_ffee0c1d713b7eeed773c29d947 3. call_acde7dbc3d93ab9bcb83edb2a4b 4. call_a584e694d20ed6d8890ae9b7578 Can you please once check the given CallSids Thanks, Dhruvil
Hi @Omar Ashraf | Community Lead, following up for updates
o
Hello @dhruvil_49667 , can you share the detail logs for these calls and if you can tell me which Dynamic Variable is not working
d
Hi @Omar Ashraf | Community Lead, AI Agent doesn't speak up the values of dynamic variables first_name and last_name mentioned in Question Node 2. Please checkout the recording of these mentioned CallSids where the same dynamic variables are used in Question node 1 and the AI Agent correctly speaks up the values. Attaching the detailed logs for your reference Agent ID: agent_7beea5a5f19d3ba109dce296cf Sample CallSids: 1. call_597807efef7b9e0f7098a8ffcf2 2. call_ffee0c1d713b7eeed773c29d947 3. call_acde7dbc3d93ab9bcb83edb2a4b 4. call_a584e694d20ed6d8890ae9b7578 https://cdn.discordapp.com/attachments/1433805588571357235/1435154063812595754/call_a584e694d20ed6d8890ae9b7578.log?ex=690aeee0&is=69099d60&hm=a4de234e25509985088279fa6b7ed68432bdc64696447652aabc4f82be31c809& https://cdn.discordapp.com/attachments/1433805588571357235/1435154064378822697/call_acde7dbc3d93ab9bcb83edb2a4b.log?ex=690aeee0&is=69099d60&hm=f7fb916786194406bb3b56b63ca8fe21664e41398f9c9a1d9d799f2b5ca5b777& https://cdn.discordapp.com/attachments/1433805588571357235/1435154064802320434/call_ffee0c1d713b7eeed773c29d947.log?ex=690aeee0&is=69099d60&hm=bcc3b08a31836841390279f4a2d416543bf5d5f2688409764478a806b2a2e8f8& https://cdn.discordapp.com/attachments/1433805588571357235/1435154065129738302/call_597807efef7b9e0f7098a8ffcf2.log?ex=690aeee1&is=69099d61&hm=a0899e84f766700c53bdc0070c17544714c4db58187af42b2701dc966c5fe3eb& https://cdn.discordapp.com/attachments/1433805588571357235/1435154065532129350/call_a584e694d20ed6d8890ae9b7578.wav?ex=690aeee1&is=69099d61&hm=e971d63442cc2e7a9531d216b915b637a02146a9f51fba3142f79e386ecec637& https://cdn.discordapp.com/attachments/1433805588571357235/1435154065842503700/call_acde7dbc3d93ab9bcb83edb2a4b.wav?ex=690aeee1&is=69099d61&hm=503b2e27106434c39c6701fc2de27957b434a63f8fe0b2406cb6f85043df98a2& https://cdn.discordapp.com/attachments/1433805588571357235/1435154066186571806/call_ffee0c1d713b7eeed773c29d947.wav?ex=690aeee1&is=69099d61&hm=3def8735c37f12135e8ec03e9cbd4246075d9f790fa0e1fd65dce79dcb762fd0& https://cdn.discordapp.com/attachments/1433805588571357235/1435154066547408896/call_597807efef7b9e0f7098a8ffcf2.wav?ex=690aeee1&is=69099d61&hm=510279556781cc7c35228407f94f745f89d484b4b83d2fb38baeed8de8e3cc49&
d
try to use dynamic variable in prompt within {{}} like example i am using variable user_name passing in make call api which I am using in prompt for agent to speak is {{user_name}} in prompt Hope this can help.
o
Hello @dhruvil_49667 , from the call I hear the agent using the variables saying hello and the name , where is the problem? You only sent the first and the last name and the agent already did use them.
d
Hi @Omar Ashraf | Community Lead please check once the conversation flow agent created with the given Agent ID. AI Agent speaks the values of the dynamic variables for the Question node 1 and those same variables are used in Question node 2 but for that node the AI Agent doesn't speak up the values of dynamic variables.
o
Can you share a screenshot of it
AI Agent doesn't speak the dynamic variables for Question node 2
o
Can you make the node static and test in the web and show me a screenshot of the transcript on the web
d
Sure
o
Hello @dhruvil_49667 , it looks fine for me
d
For the prompt it doesn't work @Omar Ashraf | Community Lead
o
You have to prompt it to say the name
d
Hi @Omar Ashraf | Community Lead for the dynamic variables all the data is correctly passed via the Inbound Webhook and also the main use-case of using dynamic variables is to use customer's data during the conversation and so the end user would definitely not prompt to the AI Agent to say his name during the conversation.
It works without prompt also for the Question node 1. Please check the recording once
o
You have to tell the ai to great the user using his name if that what you want you have to explain to the ai what you want to do
d
You mean that we have to add the prompt in Global Prompt section @Omar Ashraf | Community Lead
It works without prompt as well when the dynamic variables and their values are passed via the Inbound Webhook. AI Agent replaces the values of the dynamic variables passed. Here just it doesn't replace for a specific node only
o
Hello @dhruvil_49667 , i hope you doing fine , Actually The agent is replacing the dynamic variables because if you see when you turned it into static it did pronounce your name which means The agent is actually replacing the dynamic variables with its value but when it comes to the prompt you have to Prompted To greet the user or address him by the name
d
Yes the text written is as follows Great {{first_name}} {{last_name}} Do you have any specific features or team size in mind for the software?
So here is it expected for AI Agent to not speak up the values of dynamic variables when using Prompt
As sometimes it replaces the dynamic variables with its values and sometimes it doesn't replace its values
o
put it the sentence between " " and try again
d
Yes checked and it doesn't work CallSid: call_0466f115d74467ce28d940290e7
For another Call it works CallSid: call_b4828ebc9ccf9a15c78d103e612
The same behavior like sometimes it replaces dynamic variables with its values and sometimes it doesn't replace its values
o
what llm are you using ?
d
GPT 4.1
o
from what i see it's prompting issue not that the agent is not replacing the values , because it did work when you used static instead of prompt , you have to prompt the agent well to do what you want
dm me we can do a quick meeting to solve this
d
Sure