https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> what is the difference betw...
# ❓・ai-evy-support
w
@AI Evy what is the difference between metadata and retell llm dynamic ariables i want to pass data into the curl request so that it can be used as custom variables in the converstaion workflow
a
Thanks for tagging me @wesleybldc. I'll look through relevant sources and get back to you shortly.
### Answer The key difference between
metadata
and
retell_llm_dynamic_variables
is their purpose and usage: Metadata: - Used for storage purposes only [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() - Not used for processing - Can contain arbitrary data like internal customer IDs - Available for retrieval after the call but doesn't affect agent behavior Retell LLM Dynamic Variables: - Inject data into your Response Engine prompt and tool description [(6) ]() [(1) ]() [(3) ]() [(4) ]() [(5) ]() - Only applicable for Response Engine [(1) ]() [(3) ]() [(4) ]() [(5) ]() - Allow you to personalize your agent's responses while keeping the core conversation flow intact [(6) ]() - Can be used in prompts, begin messages, tool call URLs, tool call descriptions, and other agent components For your use case of passing data as custom variables in conversation workflow, you want
retell_llm_dynamic_variables
. Here's how to use them: In API calls, set dynamic variables like this:
Copy code
json
{
 "customer_name": "John Doe"
}
[(1) ]() [(3) ]() [(4) ]() In your prompts/conversation flow, reference them with double curly braces:
Copy code
"Hello {{customer_name}}, how can I help you today?"
[(6) ]() For outbound calls, use the Create Phone Call API with the
retell_llm_dynamic_variables
field [(6) ]() [(3) ]() . For inbound calls, supply dynamic variables in the Inbound Call Webhook [(6) ]() . All values in
retell_llm_dynamic_variables
must be strings .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy the voice model keeps adding ums in the speech. how do you remove that?
a
Thanks for the follow-up, @wesleybldc. I'll get back to you soon.
### Answer To address the voice model adding "ums" in the speech, you can configure several voice settings in Retell AI: Voice Temperature Control: You can adjust the
voice_temperature
parameter to make the voice more stable [(1) ]() [(2) ]() [(3) ]() [(4) ]() . The value ranges from [0,2], where a lower value means more stable speech generation and a higher value means more variant speech generation . This setting currently only applies to
11labs
voices . Voice Model Selection: You can set the
voice_model
parameter to choose between different voice model options . Available options include: -
eleven_turbo_v2
-
eleven_flash_v2
-
eleven_turbo_v2_5
-
eleven_flash_v2_5
-
eleven_multilingual_v2
-
tts-1
-
gpt-4o-mini-tts
Speech Normalization: Enable
normalize_for_speech
to convert entities like numbers, currency, and dates into spoken form for more consistent speech synthesis . This can help prevent issues where the voice synthesis system might not pronounce text correctly . Pronunciation Dictionary: You can use the
pronunciation_dictionary
parameter to provide specific pronunciation guidance for words or phrases . This is currently only supported for English & 11labs voices . Global Settings Configuration: In the conversation flow builder, you can access these voice settings by clicking on the empty canvas and accessing the global settings [(5) ]() . Here you can adjust voice temperature, speed, volume, and voice model selection . From the Discord discussion, there was mention of voice model changes mid-call, which could contribute to inconsiste
nt speech patterns [(6) ]() . Using stable voice settings and the appropriate voice model for your use case should help reduce unwanted speech artifacts like "ums."
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy in the conversation workflow, what is the best way to add a if else conditional based on a custom variable if custom variblle is this then set a string
a
Thanks for the follow-up, @wesleybldc. I'll get back to you soon.
### Answer For implementing if-else conditionals based on custom variables in conversation workflow, you have several options: ## Logic Split Node Approach The best way is to use a Logic Split Node [(1) ]() . This node is specifically designed to branch out the conversation flow based on conditions . When entering this node, the agent will immediately evaluate the conditions and branch out to the corresponding destination nodes . The agent would not speak in this node, and the time spent in this node is minimal . To configure branching logic: - Add conditions just like you would in other nodes - Setup the else destination: there will always be an else condition, which will be the default destination if none of the conditions are met ## Plain English Instructions Based on community discussion, the recommended approach is to use plain English instructions rather than template syntax [(2) ]() . As one user explained: "Try doing it in just plain ol' English" and "Pretend it's a human" . For example, instead of using template syntax like:
Copy code
{{#if reminiscent and medicine_reminders}}
    ....
{{#elsif reminiscent}}
    ....
{{#elsif medicine_reminders}}
    ....
{{else}}
    ...
{{/if}}
Use natural language instructions like:
Copy code
## TASK
1.) You must transition to the next state. If {{variable_1}} is some_value_here, transition to state "name_of_state_1." If {{variable_2}} is some_other_value_here, transition to state "name_of_state_2."
## Dynamic Variable Usage For custom variables in conversation flow, use the format
{{variable_name}}
[(3) ]() . The LLM should handle JSON fairly well, especially if you tell it to understand it as JSON [(2) ]() . ## Alternative Approach You can also handle this server-side by telling the agent what state to transition to based on the values of your custom variables . The Logic Split Node approach gives you the most control and clarity for complex conditional logic, while plain English instructions work well for simpler conditionals within conversation nodes.
​ To learn more, see the sources I considered: [[1] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[2] Discord message from @simonyost on 2024-10-31](https://discord.com/channels/1186424376300679209/1186462578310910112/1301659535575879731) [[3] Outbound Custom Variable](https://discord.com/channels/1186424376300679209/1371090783989530694) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy how does logic split note work? is the transition a prompt?
a
Thanks for the follow-up, @wesleybldc. I'll get back to you soon.
### Answer ## How Logic Split Node Works The Logic Split Node is used to branch out the conversation flow based on conditions [(1) ]() . When entering this node, the agent will immediately evaluate the conditions and branch out to the corresponding destination nodes . The agent would not speak in this node, and the time spent in this node is minimal . ## Transition Timing Transition happens immediately when the agent enters this node . ## Configuring Branching Logic To configure the branching logic : - Add conditions just like you would in other nodes - Setup the else destination: there will always be an else condition, which will be the default destination if none of the conditions are met, because this node is designed to be a split point and you want to make sure the conversation flow is not stuck here ## Transition Conditions Yes, the transitions use prompt-based conditions. In the API structure, you can see that transition conditions use a prompt format [(2) ]() :
Copy code
json
"transition_condition": {
  "type": "prompt",
  "prompt": "Customer wants to book appointment"
}
The Logic Split Node can come in handy when you want to further split the conversation flow based on conditions, and do not want to stack all your conditions in previous nodes [(1) ]() . It can also be hard for the agent to handle a bunch of conditions all at once, so this node can help break it down . It can also be useful when you want to branch out based on dynamic variables .
​ To learn more, see the sources I considered: [[1] Logic Split Node](https://docs.retellai.com/build/conversation-flow/logic-split-node) [[2] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
w
@AI Evy show me resources for best practices for building prompts in converstaion workflow
a
Thanks for the follow-up, @wesleybldc. I'll get back to you soon.
### Answer Here are the key resources for best practices in building prompts for conversation workflow: ## Official Documentation Resources General Prompt Engineering Guide [(1) ]() This covers fundamental principles including: - Sectional prompts: Breaking large prompts into focused sections (identity, style, guidelines, tasks & goals) - For complex tasks, using Conversation Flow instead of single prompts - Explicitly writing when to call tools for Single/Multi Prompt Agents Debug Guide for Conversation Flow [(2) ]() Provides troubleshooting steps when agents aren't following instructions: - Split complex nodes into multiple simpler nodes - Change the node model for better performance - Add conversation finetune examples - Adjust LLM temperature for consistency Transition Conditions Guide [(3) ]() Covers how to write effective transition conditions: - Use clear conditions that don't rely heavily on node instructions - Cover all possible cases to prevent the agent from getting stuck - Examples of good transition conditions like "When user indicates they want to book a meeting" ## Blog Resources with Practical Examples Advanced Conversation Flow Blog [(4) ]() Explains the benefits of structured conversation management and how it reduces AI hallucinations 5 Useful Prompts for AI Agent Builders [(5) ]() Provides specific prompt examples for: - Maintaining context across conversations - Handling multi-step workflows - Personalizing responses using user data - Voic
e scheduling and automation tasks - Handling unexpected inputs and conversation recovery ## Community Best Practices From Discord discussions, additional insights include: - For long-running conversations (30+ minutes) , use individual nodes for each question with specific prompting [(6) ]() - Use markdown formatting in prompts for better LLM understanding [(7) ]() - Say "Run the function" instead of "Call" when referencing function calls The most comprehensive starting point is the General Prompt Engineering Guide [(1) ]() , which provides the foundational principles for effective prompt design in Retell AI's conversation workflow system.
​ To learn more, see the sources I considered: [[1] General prompt engineering guide](https://docs.retellai.com/build/prompt-engineering-guide) [[2] Debug guide](https://docs.retellai.com/build/conversation-flow/debug-guide) [[3] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[4] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[5] 5 Useful Prompts for AI Agent Builders | Retell AI](https://www.retellai.com/blog/5-useful-prompts-for-building-ai-voice-agents-on-retell-ai) [[6] How to have Retell Agent Dig In and Get In Depth Answers](https://discord.com/channels/1186424376300679209/1242845789294956574) [[7] Single prompt is confirming action twice](https://discord.com/channels/1186424376300679209/1351007284431552572) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.