https://retellai.com/?utm_source=discord&utm_medium=seo logo
Is there any service or function that merges multi...
# ❓・ai-evy-support
m
@AI Evy Is there any service or function that merges multiple call based agents into a single one based on some dynamic input
a
Thanks for tagging me @mehxbot. I'll look through relevant sources and get back to you shortly.
### Answer I don't have specific information about a service or function that directly merges multiple call-based agents into a single one based on dynamic input in the available sources. However, I can see that Retell AI does support dynamic functionality through the Extract Dynamic Variables tool [(1) ]() . This tool allows agents to extract values from user responses and save them as dynamic variables , which could potentially be used to route or modify agent behavior based on input . The Extract Dynamic Variables feature supports different variable types including Text, Number, Enum, and Boolean , and you can configure when to invoke the extraction function through prompt instructions . For specific information about merging multiple agents or dynamic agent routing, I'd recommend checking these resources: - [Extract Dynamic Variables]() - Visit [Contact Sales]() - Visit [) Would you like a general answer based on my knowledge instead?
​ To learn more, see the sources I considered: [[1] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Appreciate the feedback! Feel free to ask me again with additional guidance or context.
m
Hey! I’m building a multi-mode recruiter assistant with Retell. I currently have three conversation modes (basic screening, interview scheduling, and in-depth analysis). On my frontend, users can select one or more of these modes before triggering a call. My goal is to avoid creating 9 separate agents for each combination. Instead, I want to use one Retell agent and dynamically adjust its behavior per call — depending on which modes are selected. Questions: Can I pass per-call context (like mode_basic_screening=true, mode_interview_scheduling=true) using retell_llm_dynamic_variables in the Create Call API? Will those variables actually be injected into the agent’s prompt so that the LLM can adapt behavior accordingly? Is there an official or recommended way to achieve a dynamic prompt or context-dependent flow without duplicating agents? If not, what’s the best practice to handle such a multi-mode conversational flow using Retell’s API or Response Engine? Just want to confirm if Retell supports per-call dynamic variables that can guide the agent’s logic based on selected modes.
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Yes, Retell AI fully supports your approach using dynamic variables! Here's exactly what you need: ## Per-Call Dynamic Variables You can pass per-call context using
retell_llm_dynamic_variables
in the Create Phone Call API [(1) ]() . The variables are defined as key-value pairs of strings :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "mode_basic_screening": "true",
    "mode_interview_scheduling": "true", 
    "mode_in_depth_analysis": "false"
  }
}
## Variable Injection into Prompts Dynamic variables are injected into your agent's prompts and tool descriptions using the
{{variable_name}}
syntax [(2) ]() . You can reference them in: - **Prompts**: Agent instructions and personality - **Begin message**: Opening greeting - **Tool configurations**: Custom function URLs, tool descriptions, property descriptions For example, in your prompt:
Copy code
"Based on the selected modes: {{mode_basic_screening}}, {{mode_interview_scheduling}}, {{mode_in_depth_analysis}}, adapt your conversation approach accordingly."
## Agent-Level Default Variables You can also set default values at the agent level using
default_dynamic_variables
[(3) ]() . These serve as fallbacks when specific variables aren't included in the call request [(2) ]() :
Copy code
json
{
  "default_dynamic_variables": {
    "mode_basic_screening": "false",
    "mode_interview_scheduling": "false",
    "mode_in_depth_analysis": "false"
  }
}
[(3) ]() ## Important Requirements All values in
retell_llm_dynamic_variables
must be strings [(1) ]() . Numbers, booleans, or other data types are not supported . The spaces around variable names are trimmed when evaluating . This approach allows you to use a single agent that dynamically adapts its behavior based on the selected modes, avoiding the need for multiple agent configurations.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
what should my prompt that allows swift logic based dynamic calling, eliminating the need of multiple ai agents
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Based on your multi-mode recruiter assistant use case, here's a prompt structure that leverages dynamic variables for swift logic-based calling: ## Dynamic Prompt Structure You can create a single agent prompt that adapts based on your dynamic variables [(1) ]() . Here's an example structure:
Copy code
You are a professional recruiter assistant. Your behavior adapts based on the selected conversation modes:

ACTIVE MODES:
- Basic Screening: {{mode_basic_screening}}
- Interview Scheduling: {{mode_interview_scheduling}} 
- In-Depth Analysis: {{mode_in_depth_analysis}}

CONDITIONAL LOGIC:
If {{mode_basic_screening}} is "true", focus on:
- Collecting basic candidate information
- Verifying job fit and interest level
- Asking screening questions relevant to the role

If {{mode_interview_scheduling}} is "true", focus on:
- Coordinating interview times and availability
- Confirming interview format preferences
- Sending calendar invitations

If {{mode_in_depth_analysis}} is "true", focus on:
- Conducting detailed technical assessments
- Exploring career motivations and goals
- Evaluating cultural fit

BEHAVIOR GUIDELINES:
- Always check which modes are active before proceeding
- Adapt your questioning style based on active modes
- If multiple modes are active, prioritize based on conversation flow
- Use the candidate's name: {{candidate_name}} when available
## Implementation with API Call When making your API call, pass the mode selections as dynamic variables [(2) ]() :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "mode_basic_screening": "true",
    "mode_interview_scheduling": "true", 
    "mode_in_depth_analysis": "false",
    "candidate_name": "John Smith"
  }
}
## Best Practices for Dynamic Logic The dynamic variables are injected into your prompts using the
{{variable_name}}
syntax and can be used in prompts, begin messages, and tool configurations [(1) ]() . You can also set agent-level default values as fallbacks when specific variables aren't included in the call request . This approach allows one agent to handle multiple conversation flows based on the dynamic input, eliminating the need for separate agents for each mode combination.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
i am asking various thing in each agent as of now, so does that mean should i creat 9 possible permutations and combinations for all 3 of my agents? or should i create one agent which will work well and accordingly?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ## Recommended Approach: One Dynamic Agent You should create one agent that adapts based on dynamic variables, not 9 separate agents [(1) ]() . This is exactly what Retell AI's dynamic variables feature is designed for. ## Why One Agent is Better Creating multiple agents for each combination leads to maintenance challenges and unnecessary complexity [(2) ]() . Single prompt agents work well for straightforward conversations, but as complexity increases, they may experience behavioral drift and maintenance challenges . ## Implementation Strategy Use dynamic variables to control your agent's behavior [(1) ]() :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "mode_basic_screening": "true",
    "mode_interview_scheduling": "false", 
    "mode_in_depth_analysis": "true"
  }
}
## Multi-Prompt Structure for Complex Logic For your multi-mode recruiter assistant, consider using a multi-prompt agent structure [(2) ]() . Multi-prompt agents organize conversations into structured states, each with focused prompts and state-specific functions . This provides: - **Predictable Behavior**: Each state has a clear, focused purpose - **Easier Debugging**: Issues isolated to specific states - **Better Function Control**: Tools available only when appropriate - **Scalable Design**: Add new states without affecting existing ones ## Dynamic Variable Integration Dynamic variables work in prompts, begin messages, tool configurations, and call handling [(1) ]() . You can set default values at the agent level using
default_dynamic_variables
[(3) ]() , which serve as fallbacks when specific variables aren't included in the call request [(1) ]() . This approach eliminates the need for 9 separate agents while maintaining the flexibility to handle all your conversation modes dynamically.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[3] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
can i implement logic in multi-prompt? and create 9 flows in an single agent?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Yes, you can implement logic in multi-prompt agents and handle multiple flows within a single agent, but you don't need to create 9 separate flows. ## Multi-Prompt Agent Capabilities Multi-prompt agents combine several single prompt agents into a structured tree of fine-tuned prompts [(1) ]() . Each node can contain its own specific prompt and transition logic to other nodes . This approach allows for more complex conversations while maintaining context throughout the flow . ## Dynamic Variables with Multi-Prompt Logic You can use dynamic variables within multi-prompt agents to control logic and flow [(2) ]() . Dynamic variables work in: - **Prompts**: Agent instructions and personality - **Begin message**: Opening greeting - **Tool configurations**: Custom function URLs, tool descriptions, property descriptions - **Call handling**: Voicemail prompts and messages, transfer call phone numbers, warm transfer instructions ## Recommended Approach Instead of creating 9 separate flows, use dynamic variables to control behavior within your multi-prompt structure . For example:
Copy code
{
  "mode_basic_screening": "true",
  "mode_interview_scheduling": "true",
  "mode_in_depth_analysis": "false"
}
## State Transition Logic Based on community feedback, you can improve state transitions by being explicit in your prompts about when to transition [(3) ]() . For reliable transitions, use specific language like "Immediately and reliably initiate the transfer" and treat transitions as "high-priority actions" . This approach gives you the flexibility of multi-prompt agents while using dynamic variables to handle different conversation modes within a single agent structure.
​ To learn more, see the sources I considered: [[1] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[3] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
how ca i import my existing agent? like upload the json or yaml
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer [(1) ]() Based on the available sources, you can import your existing agent using JSON format. The dashboard agent import dialog supports "Only Retell Agent format files" . ## Getting the JSON Format To understand the format, you can export an existing agent from the dashboard to get the JSON file structure . This will show you the exact format needed for imports. ## Import Process You can import agents through the dashboard's import dialog . However, there are some considerations: - The format must match the Retell Agent format exactly - If you create a JSON definition externally and it gets rejected without explanation, you may need to debug the format by comparing it to an exported agent ## Potential Issues Based on community feedback, there can be import issues with certain agent types: - For outbound agents, you might encounter errors like "Error Failed to import agent configurationError in tool Wait: Parameters must be object" [(2) ]() - If using the "Wait" tool, ensure its settings are written in the correct format ## Format Documentation Currently, there doesn't appear to be official documentation of the JSON file format [(1) ]() . The recommended approach is to export an existing agent to understand the structure and use that as a template for your imports.
​ To learn more, see the sources I considered: [[1] Conversation/agent JSON file format](https://discord.com/channels/1186424376300679209/1399111940982177962) [[2] Import Option does not work for outbound agents](https://discord.com/channels/1186424376300679209/1385302044956426451) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy is there anyway i can make my agent to be time aware? like what current date and time is
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Discord message from @nocodecreative.io on 2024-12-15](https://discord.com/channels/1186424376300679209/1186462578310910112/1317840635717222432) ​
### Answer Yes, Retell AI provides several built-in system variables to make your agent time-aware [(1) ]() . You don't need to configure these - they're automatically available: ## Default System Variables Retell automatically provides these time-related system variables : -
{{current_time}}
- Current time in
America/Los_Angeles
-
{{current_time_[timezone]}}
- Current time in specified timezone, for example:
{{current_time_Australia/Sydney}}
-
{{current_calendar}}
- 14-day calendar in
America/Los_Angeles
-
{{current_calendar_[timezone]}}
- 14-day calendar in specified timezone, for example:
{{current_calendar_Australia/Sydney}}
## Example Usage in Prompts You can use these variables directly in your agent prompts :
Copy code
"The current time is {{current_time}}. Based on the time of day, adjust your greeting accordingly."
## Important Timezone Considerations Based on community feedback, there are some limitations with the
{{current_time}}
variable [(2) ]() . The default
{{current_time}}
returns time in PST (Pacific Standard Time) , not UTC as some might expect . For more precise timezone control, you can: 1. Use the timezone-specific format:
{{current_time_[your_timezone]}}
[(1) ]() 2. Send custom time variables via
retell_llm_dynamic_variables
when initiating calls [(2) ]() ## Custom Time Variables If you need more control over timezone handling, you can also pass custom time variables through the API when creating calls, ensuring your agent works with the exact timezone and format you need .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy give me smthg that catches current date and time in utc
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Based on the documentation, Retell AI's built-in
{{current_time}}
variable doesn't provide UTC time by default [(1) ]() . The default
{{current_time}}
returns time in
America/Los_Angeles
timezone . ## Built-in Time Variables Retell provides these system variables automatically : -
{{current_time}}
- Current time in
America/Los_Angeles
-
{{current_time_[timezone]}}
- Current time in specified timezone, for example:
{{current_time_Australia/Sydney}}
## Custom UTC Time Solution To get UTC time, you have a few options: 1. **Use a specific UTC timezone variable**:
{{current_time_UTC}}
2. **Pass custom UTC time via API**: When creating calls, send UTC time through
retell_llm_dynamic_variables
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "utc_time": "2024-01-15T14:30:00Z"
  }
}
## Known Issues Based on community feedback, there can be inconsistencies with the
{{current_time}}
variable where it sometimes shows incorrect dates [(2) ]() . This happens both in LLM testing and actual calls, and appears to be intermittent . For reliable UTC time handling, I'd recommend passing the current UTC time as a custom dynamic variable when initiating calls rather than relying solely on the built-in time variables.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] im using the {{current_time}} variable, but the agent says is march 14th instead of march 5th](https://discord.com/channels/1186424376300679209/1346957336966725683) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy the current variables don't work buddy
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer I understand your frustration with the current time variables not working properly. Based on the available sources, there are indeed known issues with Retell AI's built-in time variables. ## Known Issues with Current Time Variables The
{{current_time}}
variable has documented inconsistencies where it can show incorrect dates, and this affects both LLM testing and actual calls [(1) ]() . Community members have reported similar issues where the agent shows wrong dates despite using the built-in time variables. ## Alternative Solutions Here are some workarounds for reliable time handling: ### 1. Pass Custom Time Variables via API When creating calls, send the current UTC time through
retell_llm_dynamic_variables
:
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "current_utc_time": "2025-01-15T14:30:00Z",
    "current_date": "2025-01-15"
  }
}
[(2) ]() ### 2. Use Extract Dynamic Variables Tool You can also use the Extract Dynamic Variables tool to capture time-related information during the conversation [(3) ]() . This tool supports different variable types including Text and allows you to extract values from user responses and save them as dynamic variables [(4) ]() . ### 3. Custom Function Approach Based on community feedback, some users have had success using custom functions to handle time-related operations instead of relying on the built-in variables [(5) ]() . ## Recommendation For reliable time handling in your recruiter assistant, I'd recommend passing the current UTC time as custom dynamic variables when initiating calls rather than depending on the built-in
{{current_time}}
variables [(1) ]() . This ensures your agent has accurate, consistent time information for scheduling and time-aware responses. Would you like help setting up the custom time variables in your API calls?
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[3] Extract Dynamic Variables](https://docs.retellai.com/build/single-multi-prompt/extract-dv) [[4] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[5] Can't use dynamic variable with date-time format in GET URL for custom function?](https://discord.com/channels/1186424376300679209/1405204331896246434) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
like live date and time inbuilt
@AI Evy like live date and time inbuilt
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Yes, Retell AI does provide built-in live date and time variables that are automatically available without configuration [(1) ]() . These system variables are updated in real-time: ## Built-in Live Time Variables Retell automatically provides these system variables : -
{{current_time}}
- Current time in
America/Los_Angeles
-
{{current_time_[timezone]}}
- Current time in specified timezone, for example:
{{current_time_Australia/Sydney}}
-
{{current_calendar}}
- 14-day calendar in
America/Los_Angeles
-
{{current_calendar_[timezone]}}
- 14-day calendar in specified timezone, for example:
{{current_calendar_Australia/Sydney}}
## Example Format The
{{current_time}}
variable returns time in this format: "Thursday, March 28, 2024 at 11:46:04 PM PST" ## Known Issues However, based on community reports, there are intermittent issues with the
{{current_time}}
variable showing incorrect dates [(2) ]() . This happens both in LLM testing and actual calls randomly . Some users have reported that the current_time function "messes up 70% of the time" [(3) ]() . ## Alternative Approach If the built-in variables are unreliable, you can pass your own live time data using
retell_llm_dynamic_variables
when creating calls [(4) ]() :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "current_utc_time": "2025-01-15T14:30:00Z"
  }
}
The built-in time variables should work for live date and time, but given the reported reliability issues, you may want to test them thoroughly or use custom time variables as a backup.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] im using the {{current_time}} variable, but the agent says is march 14th instead of march 5th](https://discord.com/channels/1186424376300679209/1346957336966725683) [[3] Discord message from @gebstrategy on 2025-03-11](https://discord.com/channels/1186424376300679209/1294891368505937952/1349112741129879572) [[4] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
can i give json based prompt to retell?
@AI Evy can i give json based prompt to retell?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Yes, Retell AI accepts JSON-based prompts and configurations through its API [(1) ]() . You can provide structured JSON for creating and configuring your agent's behavior. ## JSON Prompt Structure When creating a Retell LLM through the API, you can define your prompts and agent configuration using JSON format :
Copy code
json
{
  "general_prompt": "You are ...",
  "states": [
    {
      "name": "information_collection",
      "state_prompt": "You will follow the steps below to collect information...",
      "edges": [
        {
          "destination_state_name": "appointment_booking",
          "description": "Transition to book an appointment."
        }
      ]
    }
  ],
  "starting_state": "information_collection",
  "begin_message": "Hey I am a virtual assistant calling from Retell Hospital.",
  "default_dynamic_variables": {
    "customer_name": "John Doe"
  }
}
## JSON Schema for Custom Functions You can also define custom function parameters using JSON schema format [(2) ]() :
Copy code
json
{
  "type": "object",
  "properties": {
    "city": {
      "type": "string",
      "description": "The city of the weather"
    }
  },
  "required": [
    "city"
  ]
}
## Function Calling with JSON Function calling uses structured JSON to communicate between the LLM and your systems [(3) ]() . The agent can output JSON to trigger external functions and receive JSON responses. This JSON-based approach gives you programmatic control over your agent's configuration, prompts, and function definitions through the Retell AI API.
​ To learn more, see the sources I considered: [[1] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[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
@AI Evy is there anyway i can have multiple dynamic conversation flow based on single input
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Yes, you can create multiple dynamic conversation flows within a single agent using dynamic variables and conversation flow logic [(1) ]() . Here are the approaches: ## Single Agent with Dynamic Flow Control You can use dynamic variables to control which conversation path your agent takes based on a single input . Dynamic variables work in prompts, begin messages, tool configurations, and call handling . ## Conversation Flow with Dynamic Variables Conversation Flow provides the most control over dialogue paths, allowing you to create intricate conversation structures that guide users through various scenarios effectively [(2) ]() . You can use dynamic variables within conversation flows to determine which nodes and edges to follow [(1) ]() . ## Checking Dynamic Variables in Flow Logic For conversation flow conditions, you can check if variables are set using equations :
Copy code
Equation: {{user_name}} exists
Result: True if variable is set
## Nested Variables Support Retell supports nested variables for more complex logic :
Copy code
{{current_time_{{my_timezone}} }}
If you set
my_timezone
to
America/Los_Angeles
, this evaluates to
{{current_time_America/Los_Angeles}}
first, then to the actual time . ## Implementation Approach Based on your single input, you can: 1. Set multiple dynamic variables when creating the call :
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "flow_type": "screening",
    "priority_level": "high",
    "department": "sales"
  }
}
2. Use conditional logic in prompts to handle different flows :
Copy code
If {{flow_type}} appears with curly braces, use a generic approach.
Otherwise, follow the specific flow for {{flow_type}}.
3. Configure conversation flow nodes with dynamic transitions based on your variables [(3) ]() , [(4) ]() . This approach eliminates the need for multiple separate agents while giving you dynamic control over conversation paths based on your single input.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[3] List Conversation Flows](https://docs.retellai.com/api-references/list-conversation-flows) [[4] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) ​
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Yes, the approach I outlined would work for multi-flow scenarios. Here's how dynamic variables integrate with conversation flows specifically: ## Dynamic Variables in Conversation Flow Dynamic variables can be used in conversation flows for controlling transitions and behavior [(1) ]() . You can reference dynamic variables in: - **Prompts**: Agent instructions and personality - **Begin message**: Opening greeting - **Tool configurations**: Custom function URLs, tool descriptions, property descriptions - **Call handling**: Voicemail prompts and messages, transfer call phone numbers, warm transfer instructions ## Equation-Based Flow Control In conversation flow transition conditions, you can check dynamic variables using equations [(2) ]() :
Copy code
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
- "New York, Los Angeles" CONTAINS {{user_location}}
- "New York, Los Angeles" NOT CONTAINS {{user_location}}

- {{user_age}} < 18 OR {{user_location}} == "New York"
- {{name}} exists
## Checking Variable Existence You can check whether a dynamic variable exists using equation conditions : -
{{variable_name}} exists
- Returns true if the variable is defined and has a value -
{{variable_name}} does not exists
- Returns true if the variable is undefined or has no value ## Default Dynamic Variables in Conversation Flow When creating conversation flows, you can set
default_dynamic_variables
[(3) ]() , [(4) ]() :
Copy code
json
{
  "default_dynamic_variables": {
    "company_name": "Retell Inc",
    "support_hours": "9 AM - 5 PM"
  }
}
[(3) ]() ## Potential Issues Based on community feedback, there can be issues with dynamic variables in conversation flows. Some users report that dynamic variables populate successfully in multi-prompt agents but not in conversation flow agents, even when using the same webhook endpoint [(5) ]() . The multi-flow approach using dynamic variables and conversation flow should work well for your recruiter assistant scenario, allowing you to control different conversation paths based on your single input variable.
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[3] List Conversation Flows](https://docs.retellai.com/api-references/list-conversation-flows) [[4] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[5] Dynamic variables populating in multi-prompt agent but not conversation flow](https://discord.com/channels/1186424376300679209/1352134741377417329) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy does retell send webhook call_analyzed for all calls regardless of call outcome?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer No, Retell AI does not send the
call_analyzed
webhook for all calls regardless of outcome [(1) ]() . There are specific conditions that affect when this webhook is triggered: ## When call_analyzed is NOT sent The
call_analyzed
webhook will not be triggered for [(2) ]() : - Non-connected calls - Calls where no conversation happened ## Specific Call Types Affected When calls do not connect (such as calls with
dial_failed
,
dial_no_answer
,
dial_busy
disconnection reasons) , they will not have their
call_started
webhook triggered, but they will still have their
call_ended
and
call_analyzed
webhook triggered [(1) ]() . ## What call_analyzed Contains When the
call_analyzed
webhook is triggered, it contains full call data including the
call_analysis
object . The webhook payload includes [(2) ]() :
Copy code
json
{
 "event_type": "call_analyzed",
 "call": {
 // Call object with call_analysis field populated
 }
}
## Additional Considerations Based on community feedback, there can be reliability issues with the
call_analyzed
webhook for longer calls [(3) ]() . For calls longer than 5 minutes, approximately 50% may not receive the
call_analyzed
webhook event due to payload size limitations that can cause HTTP 413 "request entity too large" errors. The
call_analyzed
webhook is specifically designed to provide post-call analysis data, but it's only sent when there's meaningful conversation data to analyze [(2) ]() .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Consume the analysis data](https://docs.retellai.com/features/post-call-analysis-consumption) [[3] Call_Analyzed webhook event not working reliably for longer calls](https://discord.com/channels/1186424376300679209/1400191602206576790) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy is it possible that my webhook recieves call_ended event before call_analysed
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Yes, it is absolutely possible and expected that your webhook will receive the
call_ended
event before the
call_analyzed
event [(1) ]() . This is the normal sequence of webhook events in Retell AI. ## Webhook Event Sequence The webhooks are triggered in this order : 1.
call_started
- Triggered when a new call begins (if the call connects) 2.
call_ended
- Triggered when a call completes, transfers, or encounters an error 3.
call_analyzed
- Triggered when call analysis is complete ## Why call_analyzed Comes Later The
call_analyzed
webhook is sent after the call analysis processing is complete [(2) ]() . This analysis takes additional time because it includes: - Call summary generation - Sentiment analysis - Custom analysis data extraction - Other post-call processing ## Webhook Behavior Details The webhook system is designed so that [(1) ]() : - Webhooks are triggered in order but are not blocking - If the
call_started
webhook fails, the
call_ended
webhook can still be triggered - The
call_analyzed
webhook contains full call data including the
call_analysis
object [(2) ]() ## Real Example from Community Based on community logs, you can see this sequence in action [(3) ]() :
Copy code
2025-07-30 17:30:17.643 call_89b9c83bce9588096a3bbd74505 info: Ending call
2025-07-30 17:30:19.080 call_89b9c83bce9588096a3bbd74505 info: Webhook triggered for call_ended  
2025-07-30 17:30:19.288 call_89b9c83bce9588096a3bbd74505 info: Webhook response received for call_ended
2025-07-30 17:30:23.102 call_89b9c83bce9588096a3bbd74505 info: Webhook triggered for call_analyzed
This shows
call_ended
being triggered first, followed by
call_analyzed
several seconds later after the analysis processing completes.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Consume the analysis data](https://docs.retellai.com/features/post-call-analysis-consumption) [[3] Call_Analyzed webhook event not working reliably for longer calls](https://discord.com/channels/1186424376300679209/1400191602206576790) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy can you explain even tho my prompt is of 1400 tokens i am being charged for aroud 9k tokens during a single call
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Based on the documentation, the token count in Retell AI includes much more than just your prompt length [(1) ]() . Here's what contributes to your total token usage: ## What's Included in Token Calculation The LLM token count includes all of these components : - Global prompt - Functions (tool descriptions) - State / node prompt - Transcript between agent and user - Tool call history and results ## Why You're Seeing 9k Tokens vs 1400 Prompt Tokens Your 1400-token prompt is just one component. During a call, the total token usage accumulates from : 1. **Your base prompt**: 1400 tokens 2. **Function/tool descriptions**: Can add hundreds or thousands of tokens depending on how many tools you have configured 3. **Conversation transcript**: Every exchange between the agent and user adds tokens 4. **Tool call history**: Each function call and its results contribute additional tokens ## Pricing Impact When your total LLM tokens exceed 3,500, Retell applies proportional scaling : - Scaling Factor = Total LLM Tokens ÷ 3,500 - Billed Duration = Original Duration × Scaling Factor For example, with 9,000 tokens: - Scaling factor: 9,000 ÷ 3,500 = 2.57 - A 60-second call would be billed as 154 seconds (60 × 2.57) ## Community Insight Based on community discussions, you're only charged for prompt tokens, not output tokens [(2) ]() . However, the "prompt tokens" include the entire context sent to the LLM, which grows throughout the conversation as the transcript and tool history accumulate. The token count reflects the full conversational context, not just your initial prompt, which explains why you're seeing much higher usage than expected.
​ To learn more, see the sources I considered: [[1] Exceptions to Our Per-Minute Pricing](https://docs.retellai.com/accounts/billing-exceptions) [[2] Pricing changes - token count?](https://discord.com/channels/1186424376300679209/1373097245011873944) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
when i click on my agent it shows not found @AI Evy
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Based on community reports, when you see a "not found" error in the dashboard for an agent that exists, this typically happens when the LLM (Response Engine) connected to that agent has been deleted [(1) ]() . ## Why This Happens When an LLM ID is connected to more than one agent and you delete any agent using that LLM, it also deletes the LLM itself . As a result, all agents that were using this LLM no longer work because the LLM they were connected to was deleted . ## Verification Steps You can verify your agent exists through the API using the Get Agent endpoint [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('your_agent_id') ;
console.log(agentResponse.agent_id) ;
## Resolution To fix this issue, you'll need to: 1. Create a new Response Engine (LLM) 2. Update your agent to use the new Response Engine When creating or updating agents, ensure the
response_engine
object points to a valid LLM [(3) ]() :
Copy code
json
{
  "response_engine": {
    "type": "retell-llm",
    "llm_id": "llm_234sdertfsdsfsdf",
    "version": 0
  }
}
This is a known issue with how Retell manages object lifecycles when LLMs are shared across multiple agents [(1) ]() .
​ To learn more, see the sources I considered: [[1] Agent returned by API but "not found" in dashboard](https://discord.com/channels/1186424376300679209/1409472949987315722) [[2] Get Agent](https://docs.retellai.com/api-references/get-agent) [[3] Create Agent](https://docs.retellai.com/api-references/create-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@User What should i do?
o
Hello @mehxbot , to get human support you can post on here #❓・bug-report , and we will help you.
m
@AI Evy where do I find llm id
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer You can find the LLM ID in several ways: ## Via API - Get Agent You can retrieve your agent details to see the LLM ID it's using [(1) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('your_agent_id') ;
console.log(agentResponse.agent_id) ;
The response will include the
response_engine
object with the
llm_id
:
Copy code
json
{
  "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
  "response_engine": {
    "type": "retell-llm",
    "llm_id": "llm_234sdertfsdsfsdf",
    "version": 0
  }
}
## Via API - Get Retell LLM You can also retrieve LLM details directly if you know the LLM ID [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The LLM ID is the unique identifier for your Retell LLM Response Engine . If your agent is showing "not found" in the dashboard, it's likely because the LLM connected to it was deleted, as mentioned in the previous response.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) ​
m
@AI Evy so should I create a new engine or update this one with a different response d? If I update where do I get that llm id from
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Based on the situation where your agent shows "not found" due to a deleted LLM, you should *create a new Response Engine (LLM) * rather than trying to update a non-existent one [(1) ]() [(2) ]() . ## Creating a New Retell LLM You'll need to create a new Retell LLM Response Engine first. When you create it, you'll receive a new
llm_id
in the response [(3) ]() [(4) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({
  general_prompt: "You are ...",
  start_speaker: "user",
  begin_message: "Hey I am a virtual assistant calling from Retell Hospital."
}) ;
console.log(llmResponse.llm_id) ;
[(4) ]() ## Getting the LLM ID The
llm_id
is returned in the response when you create a new Retell LLM [(3) ]() [(4) ]() . The response will include:
Copy code
json
{
  "llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
  "version": 0,
  "is_published": false,
  "model": "gpt-4.1"
}
[(3) ]() ## Updating Your Agent Once you have the new
llm_id
, update your agent to use it [(2) ]() [(5) ]() :
Copy code
javascript
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', {
  response_engine: { 
    llm_id: 'llm_234sdertfsdsfsdf', 
    type: 'retell-llm' 
  }
}) ;
[(2) ]() The
llm_id
comes from the create LLM response - you don't need to find it elsewhere, you generate it by creating a new Response Engine [(3) ]() [(4) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy creating a new agent requires llm id right?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Yes, creating a new agent requires an
llm_id
[(1) ]() [(2) ]() [(3) ]() . The
response_engine
object with a valid
llm_id
is a required field when creating an agent. ## Required Fields for Creating an Agent When you create an agent via the API, the
response_engine
parameter is required and must include an
llm_id
:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
[(1) ]() ## Response Engine Structure The
response_engine
object requires [(2) ]() [(3) ]() : - `type`: Must be
"retell-llm"
- `llm_id`: The ID of your Retell LLM Response Engine (required) - `version`: Optional version number ## Workflow Based on community experience, the correct workflow is [(4) ]() : 1. First, create a Retell LLM Response Engine (which gives you an
llm_id
) 2. Then, use that
llm_id
when creating your agent If you receive a 404 error when creating an agent, verify that the
llm_id
you're using exists and is valid .
​ To learn more, see the sources I considered: [[1] Create Agent](https://docs.retellai.com/api-references/create-agent) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Create Agent](https://docs.retellai.com/api-references/create-agent) [[4] 404 when creating agent with /create-agent](https://discord.com/channels/1186424376300679209/1392679614882517042) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy I am using chatgpt 4.1 fast
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer [(1) ]() [(2) ]() [(3) ]() When you create a new agent in Retell AI, you need to specify a
response_engine
object that includes your LLM configuration [(1) ]() [(2) ]() . Since you're using GPT-4.1 Fast, you'll need to create a Retell LLM Response Engine first (which will generate an
llm_id
for you) , and then use that
llm_id
when creating your agent [(4) ]() . The
response_engine
object structure requires [(1) ]() [(2) ]() [(3) ]() : - `type`: Set to
"retell-llm"
- `llm_id`: The ID of your Retell LLM Response Engine (required) - `version`: Optional version number Here's the code structure for creating an agent with your response engine [(1) ]() [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
[(1) ]() , [(2) ]() The workflow is [(4) ]() : 1. Create a Retell LLM Response Engine (specifying GPT-4.1 as your model) 2. Use the returned
llm_id
when creating your agent If you're experiencing issues where your agent shows "not found," it's likely because the LLM connected to it was deleted [(5) ]() . The best practice is to have a different LLM for each agent to avoid this issue .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy how do I create a response engine
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer To create a Response Engine (Retell LLM) , you use the Create Retell LLM API endpoint [(1) ]() . Here's how: ## Creating a Retell LLM Response Engine Use the following code to create a new Retell LLM :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({ start_speaker: 'user' }) ;
console.log(llmResponse.llm_id) ;
## Required Parameters When creating a Retell LLM, you must specify : - `start_speaker`: Must be either
'user'
or
'agent'
(required) ## Optional Configuration You can also configure : - `model`: Select the underlying text LLM (defaults to
gpt-4.1
if not set) - `general_prompt`: General prompt for the agent - `begin_message`: First utterance by the agent - `general_tools`: Tools the model can use - `states`: Multi-state conversation flows ## Response The API returns an
llm_id
that you'll use when creating or updating your agent :
Copy code
json
{
 "llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "version": 0,
 "is_published": false,
 "model": "gpt-4.1"
}
Once you have the
llm_id
, you can use it in your agent's
response_engine
configuration [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Create Agent](https://docs.retellai.com/api-references/create-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy so i will have to create a new response engine and update it to my current agent to get it working?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Yes, that's correct. Since your agent is showing "not found" (likely because its connected LLM was deleted) , you need to create a new Retell LLM Response Engine and then update your existing agent to use it [(1) ]() [(2) ]() . ## Step 1: Create a New Retell LLM First, create a new Response Engine using the Create Retell LLM endpoint [(3) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({ start_speaker: 'user' }) ;
console.log(llmResponse.llm_id) ;
The response will include your new
llm_id
:
Copy code
json
{
 "llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "version": 0,
 "is_published": false,
 "model": "gpt-4.1"
}
## Step 2: Update Your Agent Once you have the new
llm_id
, update your existing agent to use it [(1) ]() [(2) ]() :
Copy code
javascript
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { agent_name: 'Jarvis' }) ;
console.log(agentResponse.agent_id) ;
[(1) ]() The
response_engine
object in your update should look like this [(1) ]() [(2) ]() :
Copy code
json
{
  "response_engine": {
    "type": "retell-llm",
    "llm_id": "llm_234sdertfsdsfsdf",
    "version": 0
  }
}
This will reconnect your agent to a valid Response Engine and resolve the "not found" issue .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Update Agent](https://docs.retellai.com/api-references/update-agent) [[2] Update Agent](https://docs.retellai.com/api-references/update-agent) [[3] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) ​
m
@AI Evy
Copy code
{
  "status": "error",
  "message": "Cannot update response engine of agent version > 0"
}
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Based on the error you're receiving, you cannot update the
response_engine
for agents with version > 0. This is a limitation in Retell AI's agent versioning system. ## Your Options Since you cannot update the
response_engine
on an existing agent with version > 0, you have two options: ### Option 1: Create a New Agent Create a completely new agent with the new Response Engine [(1) ]() [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
[(1) ]() ### Option 2: Check Agent Version First, verify your agent's version using the Get Agent endpoint [(3) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('your_agent_id') ;
console.log(agentResponse.agent_id) ;
The response will show your agent's version [(3) ]() [(4) ]() [(5) ]() :
Copy code
json
{
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "version": 0,
 "is_published": false,
 "response_engine": {
 "type": "retell-llm",
 "llm_id": "llm_234sdertfsdsfsdf",
 "version": 0
 }
}
[(3) ]() ## Why This Happens The error indicates that Retell AI restricts
response_engine
updates for agents that have been modified (version > 0) . This is likely a design decision to maintain agent stability and prevent breaking changes to active agents. ## Recommended Approach Create a new agent with the new Response Engine. This ensures a clean configuration and avoids version-related restrictions [(1) ]() [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy how do i export my current agent via api
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer To export your current agent via API, use the Get Agent endpoint [(1) ]() . This retrieves all the details about your agent configuration. ## Exporting Your Agent
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
## What You'll Get The response includes the complete agent blueprint :
Copy code
json
{
 "agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "version": 0,
 "is_published": false,
 "response_engine": {
 "type": "retell-llm",
 "llm_id": "llm_234sdertfsdsfsdf",
 "version": 0
 },
 "agent_name": "Jarvis",
 "voice_id": "11labs-Adrian",
 "voice_model": "eleven_turbo_v2",
 "fallback_voice_ids": [
 "openai-Alloy",
 "deepgram-Angus"
 ],
 "voice_temperature": 1,
 "voice_speed": 1,
 "volume": 1,
 "responsiveness": 1,
 "interruption_sensitivity": 1,
 "enable_backchannel": true,
 "backchannel_frequency": 0.9,
 "backchannel_words": [
 "yeah",
 "uh-huh"
 ],
 "reminder_trigger_ms": 10000,
 "reminder_max_count": 2,
 "ambient_sound": "coffee-shop",
 "ambient_sound_volume": 1,
 "language": "en-US",
 "webhook_url": "<https://webhook-url-here%22,>
 "webhook_timeout_ms": 10000,
 "boosted_keywords": [
 "retell",
 "kroger"
 ],
 "data_storage_setting": "everything",
 "opt_in_signed_url": true,
 "pronunciation_dictionary": [
 {
 "word": "actually",
 "alphabet": "ipa",
 "phoneme": "ˈæktʃuəli"
 }
 ],
 "normalize_for_speech": true,
 "end_call_after_silence_ms": 600000,
 "max_call_duration_ms": 3600000,
 "voicemail_option": {
 "action": {
 "type": "static_text",
 "text": "Please give us a callback tomorrow at 10am."
 }
 },
 "post_call_analysis_data": [
 {
 "type": "string",
 "name": "customer_name",
 "description": "The name of the customer.",
 "examples": [
 "John Doe",
 "Jane Smith"
 ]
 }
 ],
 "post_call_analysis_model": "gpt-4o-mini",
 "begin_message_delay_ms": 1000,
 "ring_duration_ms": 30000,
 "stt_mode": "fast",
 "vocab_specialization": "general",
 "allow_user_dtmf": true,
 "user_dtmf_options": {
 "digit_limit": 25,
 "termination_key": "#",
 "timeout_ms": 8000
 },
 "denoising_mode": "noise-cancellation",
 "pii_config": {
 "mode": "post_call",
 "categories": []
 },
 "last_modification_timestamp": 1703413636133
}
## Complete Export (Agent + LLM) If you're using Retell LLM, you'll also need to export the LLM details separately [(2) ]() . The complete blueprint requires both: 1. Get Agent details API call [(1) ]() 2. Get LLM details API call (if using Retell LLM) [(2) ]() These two combined give you the entire blueprint of the agent .
​ To learn more, see the sources I considered: [[1] Get Agent](https://docs.retellai.com/api-references/get-agent) [[2] Discord message from @sanava.ai on 2024-05-11](https://discord.com/channels/1186424376300679209/1186462578310910112/1238890773638807622) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy my llm id is deleted as i deleted another agent can't i restorE?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer Unfortunately, once an LLM is deleted in Retell AI, it cannot be restored [(1) ]() . When you delete an agent that has an LLM attached to it, if that same LLM is being used by other agents, those agents will lose their connection to the LLM . As mentioned in the Discord thread, when an LLM gets deleted, the affected agent will show an error and you'll need to create a new agent . The engineering team confirmed that "unfortunately the llm id assigned to this got deleted, you'll need to create a new agent" . ## Your Options Since restoration isn't possible, you'll need to: 1. Create a new Retell LLM with your desired configuration 2. Create a new agent using that new LLM ID [(2) ]() Here's how to create a new agent with a new LLM:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
  response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
  voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
## Best Practice Going Forward To avoid this issue in the future, it's recommended to have a separate LLM for each agent [(1) ]() . This way, deleting one agent won't affect others.
​ To learn more, see the sources I considered: [[1] My Agent Got Nuked](https://discord.com/channels/1186424376300679209/1419790903836676117) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy what about prompt and all? how do i get that from my initial agent
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer Since your LLM was deleted, you can't directly retrieve the prompt from your initial agent. However, you can retrieve the LLM configuration (including the prompt) if you still have access to the LLM ID [(1) ]() . ## Retrieving LLM Details (Including Prompt) If you know the LLM ID that was attached to your agent, you can retrieve its configuration using the Get Retell LLM endpoint :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The response will include the
general_prompt
and other configuration details :
Copy code
json
{
 "llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "version": 0,
 "is_published": false,
 "model": "gpt-4.1",
 "general_prompt": "You are ...",
 "general_tools": [...],
 "states": [...]
}
## If the LLM Was Deleted Unfortunately, if the LLM was already deleted, you cannot retrieve the prompt through the API [(2) ]() . In this case, you'll need to: 1. Check if you have any backups or documentation of your original prompt 2. Recreate the prompt configuration manually 3. Create a new Retell LLM with your prompt configuration [(3) ]() ## Listing All Available LLMs You can also list all your existing LLMs to see if the configuration is still available [(4) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponses = await client.llm.list() ;
console.log(llmResponses) ;
​ To learn more, see the sources I considered: [[1] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[2] URGENT: 404 Error - Cannot Retrieve Agent agent_24a7b7382eca64e0fcbe118931 via API](https://discord.com/channels/1186424376300679209/1382991998654480505) [[3] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[4] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy does delete a agent from dashboard delete the llm?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer ### Answer Yes, deleting an agent from the dashboard does delete the LLM if that LLM is connected to the agent [(1) ]() [(2) ]() [(3) ]() . ## What Happens When You Delete an Agent When you delete an agent that has an LLM attached to it, the LLM itself gets deleted [(1) ]() [(3) ]() . This is problematic if multiple agents share the same LLM ID, because all those agents will lose their connection to that LLM [(1) ]() [(2) ]() [(3) ]() . As confirmed in the Discord community: "when you delete any agent connected to this LLM ID, it also deleted the LLM itself. As a result, all agents that were using this LLM no longer work, because the LLM they were connected to was deleted" [(3) ]() . ## Best Practice The recommended best practice is to have a different LLM for each agent [(1) ]() [(2) ]() . This prevents accidental deletion of LLMs that are being used by multiple agents. If you want to create agents programmatically using the API and need an LLM ID, you should creat
e a separate LLM for each agent using the Create Retell LLM API endpoint . --- **
​ To learn more, see the sources I considered: [[1] Discord message from @seant6217 on 2025-07-29](https://discord.com/channels/1186424376300679209/1186462578310910112/1399840727357456516) [[2] Discord message from @seant6217 on 2025-07-29](https://discord.com/channels/1186424376300679209/1186462578310910112/1399840859339489352) [[3] Agent returned by API but "not found" in dashboard](https://discord.com/channels/1186424376300679209/1409472949987315722) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy how do i connect new llm to my agent?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer Based on your earlier message, your agent has version > 0, which means you cannot update the
response_engine
on that existing agent [(1) ]() [(2) ]() . However, you have two options: ## Option 1: Create a New Agent (Recommended) Since you cannot update the
response_engine
for agents with version > 0, the most straightforward approach is to create a new agent with your new LLM ID [(3) ]() [(4) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
 response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
 voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
[(3) ]() ## Option 2: Update Agent (Only Works for Version 0) If your agent were version 0, you could update it using the Update Agent endpoint [(1) ]() [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { agent_name: 'Jarvis' }) ;
console.log(agentResponse.agent_id) ;
[(1) ]() The
response_engine
object structure requires [(1) ]() [(2) ]() : - `type`: Must be
"retell-llm"
- `llm_id`: The ID of your new Retell LLM Response Engine (required) - `version`: Optional version number ## Why You're Getting the Error The error "Cannot update response engine of agent version > 0" occurs because Retell AI restricts
response_engine
updates for agents that have been modified (version > 0) . This is a design decision to maintain agent stability. ## Recommended Workflow 1. First, create a new Retell LLM Response Engine (which gives you an
llm_id
) 2. Then, create a new agent using that
llm_id
[(3) ]() [(4) ]() 3. Going forward, use a separate LLM for each agent to avoid deletion issues [(7) ]()
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy what about my old prompt from that agent?
a
Thanks for the follow-up, @mehxbot. I'll get back to you soon.
### Answer --- ### Answer Unfortunately, since your LLM was deleted when you deleted the agent, you cannot retrieve the old prompt directly from that agent [(1) ]() [(2) ]() . However, you have a few options: ## If You Still Have the LLM ID If you know the LLM ID that was attached to your old agent, you can try retrieving it using the Get Retell LLM endpoint [(3) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The response includes the
general_prompt
field :
Copy code
json
{
 "llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
 "general_prompt": "You are ...",
 "general_tools": [...],
 "states": [...]
}
## If the LLM Was Already Deleted If the LLM was deleted along with your agent, the prompt is no longer retrievable through the API [(1) ]() [(2) ]() . In this case, you'll need to: 1. Check if you have any backups or documentation of your original prompt 2. Recreate the prompt configuration manually 3. Create a new Retell LLM with your reconstructed prompt using the Create Retell LLM endpoint [(4) ]() ## Creating a New LLM with Your Prompt Once you've reconstructed your prompt, create a new LLM :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({ start_speaker: 'user' }) ;
console.log(llmResponse.llm_id) ;
You can include your
general_prompt
in the create request . ## Best Practice Going Forward To avoid losing prompts in the future, consider keeping backups of your LLM configurations, and remember to use a separate LLM for each agent to prevent accidental deletion [(1) ]() [(2) ]() . ---
​ To learn more, see the sources I considered: [[1] Discord message from @userrk1329 on 2025-08-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1405073658904444969) [[2] Discord message from @userrk1329 on 2025-08-13](https://discord.com/channels/1186424376300679209/1294891368505937952/1405220586338390186) [[3] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[4] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.