https://retellai.com/?utm_source=discord&utm_medium=seo logo
Why is my agent making stuff up
# ❓・ai-evy-support
m
@AI Evy Why is my agent making stuff up? I am passing variables (sku and name), I can see them in the Data, yet the agent is completely making up the sku and name on the fly
a
Thanks for tagging me @maha387. I'll look through relevant sources and get back to you shortly.
### Answer Even though your dynamic variables appear in the Data tab, the agent might not be using them correctly. Here are the most common reasons and solutions: ## Check Your Prompt Syntax Dynamic variables must use the exact
{{variable_name}}
syntax in your prompts [(1) ]() . For example: - Correct:
"The product SKU is {{sku}} and the name is {{name}}"
- Incorrect:
"The product SKU is {sku}"
or
"The product SKU is $sku"
The spaces around the variable name will be trimmed when evaluating the variable . ## Verify Agent Version A very common issue: your phone number might be associated with an older version of your agent that doesn't have the updated prompts with dynamic variables [(2) ]() . Check that your phone number is bound to the current version of the agent you're viewing in the dashboard . ## Strengthen Your Prompting Be more explicit in your prompts, especially if using a weaker model . Instead of just mentioning the variable, provide clear context:
Copy code
The customer's product details are:
- SKU: {{sku}}
- Product Name: {{name}}

Always use these exact values when discussing the product.
## Check Variable Format for Inbound Calls If this is an inbound call using webhooks, ensure your webhook response uses the correct format [(3) ]() :
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "sku": "ABC123",
      "name": "Product Name"
    }
  }
}
Not this format:
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "sku": "ABC123",
    "name": "Product Name"
  }
}
## For Outbound Calls When using the Create Phone Call API, set your variables in the
retell_llm_dynamic_variables
field, and all values must be strings [(1) ]() :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "sku": "ABC123",
    "name": "Product Name"
  }
}
## Add Defensive Instructions Include instructions in your prompt to handle the variables properly :
Copy code
If {{sku}} or {{name}} appear with curly braces, inform the user that product details are unavailable.
Otherwise, use the exact SKU and name provided.
The agent making up values typically means it's not finding the variables in the evaluated prompt, so it's hallucinating based on context instead of using your actual data.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Discord message from @nitss21 on 2025-08-25](https://discord.com/channels/1186424376300679209/1186462578310910112/1409651885794791474) [[3] Agent not picking up dynamic variables](https://discord.com/channels/1186424376300679209/1395530229640073329) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.