https://retellai.com/?utm_source=discord&utm_medium=seo logo
how big a prompt can be in a single prompt agent
# ❓・ai-evy-support
j
@AI Evy how big a prompt can be in a single prompt agent? How can I prevent halucinations and maximise token use
a
Thanks for tagging me @japhetgan. I'll look through relevant sources and get back to you shortly.
### Answer For single prompt agents, the documentation recommends considering an upgrade to multi-prompt when your single prompt exceeds 500 words or uses more than 3 functions [(1) ]() . The LLM prompt token limit is now set to 32,768 tokens [(2) ]() . To prevent hallucinations and maximize token use, Retell AI recommends using multi-prompt agents instead of single prompt agents [(1) ]() . As complexity increases, single prompt agents may experience behavioral drift where the agent deviates from instructions in edge cases, function calling issues with unreliable tool usage when using multiple functions, maintenance challenges where large prompts become difficult to debug and update, and context confusion where the agent struggles to track conversation state . Multi-prompt agents help prevent these issues by organizing conversations into a structured tree of states, each with its own focused prompt and behavior . Each state includes a focused prompt with specific instructions for that conversation phase, state-specific functions where only relevant tools are available in each state, transition logic with clear conditions for moving between states, and context preservation where variables and information flow between states . The benefits of multi-prompt structure include predictable behavior where each state has a clear focused purpose, easier debugging with issues isolated to specific states, better function control with tools available only when appropriate, scalable design where you can add new states without affecting existing ones, and better team collaboration where different team members can work on different states .
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Chat Widget, Custom Function Enhancement and more!](https://www.retellai.com/changelog/chat-widget-custom-function-enhancement-and-more) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy how is the prompt shared between state? Would this cost more? Are there any known KB retrieval problem?
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ## Prompt Sharing Between States In multi-prompt agents, there's a general prompt that applies across all states, plus state-specific prompts [(1) ]() . The API structure shows that multi-prompt agents have both a
general_prompt
field and individual
state_prompt
fields for each state . Each state includes context preservation where variables and information flow between states [(2) ]() . ## Cost Considerations The sources don't provide specific pricing information for multi-prompt agents versus single-prompt agents, so I can't definitively answer whether multi-prompt costs more. ## Knowledge Base Retrieval Problems Yes, there are known KB retrieval issues [(3) ]() . When a knowledge base is linked to a multi-prompt agent, it can cause the agent to pull information for every reply, which can override your structured conversation flow and cause non-deterministic behavior . The agent may retrieve from the knowledge base and overlook node transitions, essentially ignoring the structured conversation flow . The recommended solution is to restrict knowledge base usage in your general prompt . Adding explicit instructions in the general prompt is usually sufficient to control when the KB should be used .
​ To learn more, see the sources I considered: [[1] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[2] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[3] Most of the times KB is invoked and the agent does not follow the node transitions](https://discord.com/channels/1186424376300679209/1407282116802252892) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy what is the besdt practice in building a state? What if the caller jumps in conversation, does conflic ansd general quesiton handling is done automatically? How transition statement between state works?
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ## Best Practices for Building States When building states in multi-prompt agents, follow these best practices: Keep prompts concise and focused - each state should have a clear, specific purpose [(1) ]() . For each state, keep the prompts as concise as possible, as multiple transitions from one state to 4-5 states can make it confusing for the LLM to follow [(2) ]() . Structure your prompts in sections using identity, style, guidelines, and tasks [(3) ]() :
Copy code
///## Identify
You are a friendly AI assistant for Retell AI. ....
///## Style Guardrails
Be concise: ...
Be conversational: ...
...
///## Response Guideline
Return dates in their spoken forms: ...
Ask up to one question at a time: ...
...
///## Task
1. Greet the user
...
Write tasks as clear steps to help the LLM understand what to ask at each step and how to proceed :
Copy code
///## Task
1. Ask for user's name.
2. Ask if user needs a refund, need a replacement, or just retriving information.
 - if user needs a refund, transition to refund state.
 - if user needs a replacement, transition to replacement state.
3. If user is just retriving information, ask for the order number.
...
Keep the general prompt short when using multi-states and write style guidelines and general identity info there [(2) ]() . ## Conversation Jumping and Conflict Handling The sources don't provide specific information about automatic handling of conversation jumping or conflict resolution. However, the documentation shows that each state includes context preservation where variables and information flow between states [(1) ]() . ## How Transition Statements Work Transitions between states work through transition logic with clear conditions for moving between states . Based on community examples, transitions should be written explicitly with specific conditions [(2) ]() :
Copy code
## Transition:
- **If the client mentions a workplace injury**: Transition to **WC_Injury_Details**.
- **If the client mentions insurance details**: Transition to **Insurance_adjuster**.
- **If discussing a claim adjuster**: Transition to **Claim_adjuster**.
For better transition reliability, write conditions more explicitly and provide specific examples . For instance, define keywords or scenarios like "I slipped at a liquor store means personal injury" . The key is to break down prompts into smaller, more controlled steps so the LLM knows when to move to the next step or state .
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Not transitioning between states](https://discord.com/channels/1186424376300679209/1291114413662801960) [[3] Write a single prompt](https://docs.retellai.com/build/single-multi-prompt/write-single-prompt) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
where should I define my functions? Global or at a state? @AI Evy
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ## Function Placement Best Practices For multi-prompt agents, you can define functions at two levels: global (agent level) and state-specific [(1) ]() . Here's the best practice approach: ### Global Functions (Recommended for Most Cases) Keep general functions at the agent level, including functions like
end_call
and those you want to call multiple times across different states [(2) ]() . The API structure shows this with
general_tools
that apply to all states [(1) ]() . ### State-Specific Functions State functions are limited to that specific state only [(2) ]() . Use state-specific functions when you need tools that are only relevant to a particular conversation phase [(3) ]() . ### Best Practice Decision Framework Use Global Functions for: - Functions you'll reuse across multiple states (like
end_call
,
transfer_call
) - Core utilities needed throughout the conversation - Functions that don't depend on specific state context Use State-Specific Functions for: - Tools only relevant to one conversation phase - Functions that should be restricted to certain states for better control ### Real-World Example As one community member noted, they initially had state-specific functions but realized they could re-use them in other places, so they moved all functions to the agent level [(4) ]() . The multi-prompt structure provides better function control where tools are available only when approp
riate, which helps with predictable behavior [(3) ]() .
​ To learn more, see the sources I considered: [[1] Update Retell LLM](https://docs.retellai.com/api-references/update-retell-llm) [[2] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171997744205925) [[3] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[4] Discord message from @jayzpio on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332178711369482302) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
can you explain Store Call Info as Variables (Optional) in Agent Edge? @AI Evy Is this similar to a extract Dynamic Variable in Converatioanl Flow
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
## Variable Collection Discussion Based on community discussions, there are ways to set variables dynamically during calls. One approach mentioned involves using Extract Variables nodes in conversation flows to set variables based on conversation context [(4) ]() . However, I don't have specific documentation about "Store Call Info as Variables (Optional) in Agent Edge" to provide a detailed comparison. For the most accurate information about this specific feature, I'd recommend checking the latest documentation or contacting support. Would you like a general answer based on my knowledge instead, or would you prefer to explore the documented dynamic variable features I can provide details about?
### Answer Based on the available sources, I can explain dynamic variables functionality, but I don't have specific information about "Store Call Info as Variables (Optional) in Agent Edge" in the provided documentation. ## Dynamic Variables in Retell AI Dynamic variables allow you to inject personalized data into your agent's responses for each specific call using the
{{variable_name}}
syntax [(1) ]() . They can be used in prompts, begin messages, tool configurations, and call handling . ## Setting Dynamic Variables For outbound calls, you set variables in the
retell_llm_dynamic_variables
field when creating a phone call [(2) ]() :
Copy code
javascript
const phoneCallResponse = await client.call.createPhoneCall({
 from_number: '+14157774444',
 to_number: '+12137774445',
}) ;
The API response shows both
retell_llm_dynamic_variables
(variables you set) and
collected_dynamic_variables
(variables collected during the call) :
Copy code
json
{
 "retell_llm_dynamic_variables": {
 "customer_name": "John Doe"
 },
 "collected_dynamic_variables": {
 "last_node_name": "Test node"
 }
}
## Conversation Flow Dynamic Variables For conversation flows, you can set
default_dynamic_variables
at the agent level [(3) ]() :
Copy code
json
{
 "default_dynamic_variables": {
 "company_name": "Retell Inc",
 "support_hours": "9 AM - 5 PM"
 }
}
​ 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) [[3] Update Conversation Flow](https://docs.retellai.com/api-references/update-conversation-flow) [[4] Discord message from @rkrausse on 2025-08-20](https://discord.com/channels/1186424376300679209/1186462578310910112/1407859048426115163) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy I mean in Multi Prompt when you connect state there is an edhe
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer I don't have specific information about "Store Call Info as Variables" functionality in multi-prompt agent edges based on the available sources. The documentation shows that multi-prompt agents use edges for transitions between states [(1) ]() , but doesn't detail variable storage options within edges. The API documentation shows that multi-prompt agents have
edges
defined within each state's structure [(2) ]() [(3) ]() [(4) ]() :
Copy code
json
"edges": [
  {
    "destination_state_name": "appointment_booking",
    "description": "Transition to book an appointment."
  }
]
However, the sources don't provide information about additional variable storage capabilities within these edge definitions. For multi-prompt agents, the documented variable functionality includes
default_dynamic_variables
at the agent level and context preservation where variables and information flow between states [(1) ]() . Since I don't have specific documentation about the "Store Call Info as Variables" feature in multi-prompt agent edges, would you like a general answer based on my knowledge instead, or would you prefer to: - Visit [Contact Sales]() - Visit [)
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[3] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) [[4] 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.
j
@AI Evy how is information share betweeen states? Take you time to understand all relevant infirmation
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ## Information Sharing Between States in Multi-Prompt Agents In multi-prompt agents, information is shared between states through several mechanisms: ### Context Preservation Multi-prompt agents include context preservation where variables and information flow between states [(1) ]() . This ensures that information gathered in one state remains available to subsequent states. ### General Prompt + State-Specific Prompts The architecture uses both a
general_prompt
that applies across all states and individual
state_prompt
fields for each specific state [(2) ]() . This structure allows shared context while maintaining state-specific focus. ### Default Dynamic Variables You can set
default_dynamic_variables
at the agent level that are accessible across all states :
Copy code
json
{
  "default_dynamic_variables": {
    "customer_name": "John Doe"
  }
}
### State Structure with Information Flow Each state in the multi-prompt structure includes transition logic with clear conditions for moving between states, and this transition process maintains context continuity [(1) ]() . The API shows states are structured with edges that define how information and control flow between states [(2) ]() :
Copy code
json
{
  "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."
        }
      ]
    },
    {
      "name": "appointment_booking",
      "state_prompt": "You will follow the steps below to book an appointment..."
    }
  ]
}
### Benefits for Information Management The multi-prompt structure provides predictable behavior where each state has a clear, focused purpose while maintaining information continuity [(1) ]() . This approach prevents context confusion that can occur in single prompt agents where the agent struggles to track conversation state . The key advantage is that variables and context information collected in earlier states remain available to later states, enabling complex multi-step conversations while keeping each individual state focused and manageable .
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] 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.
j
@AI Evy why KB is not fetching in multi prompt
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ### Answer Knowledge Base retrieval can be problematic in multi-prompt agents. When a knowledge base is linked to an agent, the agent will always try to retrieve information from the knowledge base before responding [(1) ]() . There's no need to change your prompt for it to trigger, as it will be done automatically, for every response generation . However, this automatic retrieval can interfere with multi-prompt agent behavior. The knowledge base can cause the agent to pull information for every reply, which can override your structured conversation flow and cause non-deterministic behavior [(2) ]() . The agent may retrieve from the knowledge base and overlook node transitions, essentially ignoring the structured conversation flow . ### Solutions The recommended solution is to restrict knowledge base usage in your general prompt . Adding explicit instructions in the general prompt is usually sufficient to control when the KB should be used . You can also use specific prompting to control when the knowledge base is accessed. For example, you can add the following to your agent prompt [(1) ]() :
Copy code
Only answer using the information in ## Related Knowledge Base Contexts.
If ## Related Knowledge Base Contexts is missing or does not contain relevant information, respond:
"There is no related information in knowledge base."
### Knowledge Base Configuration You can configure how many chunks are retrieved via "Adjust KB Retrieval Chunks and Similarity" : - Chunks to retrieve: The max number of chunks to retrieve from the KB, range 1-10. Default: 3 - Similarity Threshold: Adjust how strict the system is when matching chunks to the context. A higher setting gives you fewer, but more similar, matches. Default: 0.6 The API also shows that knowledge bases can be configured at the agent level with
knowledge_base_ids
and
kb_config
settings [(3) ]() [(4) ]() :
Copy code
json
{
  "knowledge_base_ids": [
    "<string>"
  ],
  "kb_config": {
    "top_k": 3,
    "filter_score": 0.6
  }
}
[(3) ]() , [(4) ]()
​ To learn more, see the sources I considered: [[1] Knowledge Base](https://docs.retellai.com/build/knowledge-base) [[2] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1412769473227657329) [[3] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[4] 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.
j
@AI Evy Im havong poroblem with Path Condition Describe the condition that triggers the transition to the next state its not triggering tranition, is there a right pattern?
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ### Answer Based on the conversation flow documentation, here are the correct patterns for transition conditions that should trigger properly: ## Types of Transition Conditions There are two types of transition conditions [(1) ]() : - **Prompt**: The condition is a prompt that is evaluated by the LLM - **Equation**: The condition is a mathematical equation that is hardcoded ## Prompt Condition Patterns For prompt conditions, write clear, specific conditions : -
User said something about booking a meeting
-
User said something about cancelling a meeting
-
User claims to be over 18
-
User said they lived in New York
-
User said they lived in New York or Los Angeles
## Equation Condition Patterns For equation conditions, use these exact patterns :
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
## Key Points for Successful Transitions Write conditions to be clear and not reference the instruction too much . The agent will have access to the current node's instruction when evaluating conditions, but conditions should be self-contained. Cover all possible cases to ensure smooth transitions and prevent the agent from getting stuck on a node . Some general cases can be covered by global nodes, so you can focus on specific cases for each node. Equation conditions are evaluated first, then prompt conditions are evaluated from top to bottom, and the system travels on the first condition that evaluates to true . ## Common Issue from Community Based on community feedback, there's an important distinction: the
condition
field is not used by the LLM to trigger transitions - only the
transition_condition.prompt
field is actually used [(2) ]() . Focus only on the content of
transition_condition.prompt
and make sure your prompt is concise, declarative, and matches actual language patterns the user would say . ## When Transitions Happen Transitions usually happen after the user speaks, but this can vary based on node type [(1) ]() . You can test in the dashboard to see which node is highlighted to track the current node and observe how transitions occur.
​ To learn more, see the sources I considered: [[1] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[2] Transition condition in Conversation flow agent](https://discord.com/channels/1186424376300679209/1389012084276334724) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer I need more context about what specific content you're planning to put in the state prompt. However, I can provide guidance on best practices for state prompts in multi-prompt agents. ## State Prompt Best Practices For multi-prompt agents, each state should have a focused prompt with specific instructions for that conversation phase [(1) ]() . Keep state prompts concise and focused - each state should have a clear, specific purpose . Based on community experience, it's recommended to keep the general prompt short when using multi-states and write style guidelines and general identity info there [(2) ]() . State-specific prompts should focus on the particular task or phase of conversation. ## Recommended Structure for State Prompts Structure your state prompts using clear sections [(3) ]() :
Copy code
7. Ask if user is interested in an in person tour.
 - if yes, transition to schedule_tour.
 - if no or hesitant, call function end_call to hang up politely and say will reach out if any other interesting properties pop up.
Copy code
3. Confirm the date, time, and timezone selected by user: "Just to confirm, you want to book the appointment at ...". Make sure this is a time from the available slots.
4. Once confirmed, call function book_appointment to book the appointment.
## Key Guidelines - Break down prompts into smaller, more controlled steps so the LLM knows when to move to the next step or state [(2) ]() - Define clear transition logic with specific conditions for moving between states [(1) ]() - Keep prompts concise as longer prompts can actually harm performance [(4) ]() - Multiple transitions from one state to 4-5 states can make it confusing for the LLM to follow [(2) ]() Without seeing the specific content you want to add, I'd recommend ensuring it follows these principles: focused on the state's specific purpose, includes clear transition conditions, and maintains concise instructions.
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Not transitioning between states](https://discord.com/channels/1186424376300679209/1291114413662801960) [[3] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[4] Custom LLM Best Practices](https://docs.retellai.com/integrate-llm/llm-best-practice) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy is state a task steps?
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer States in multi-prompt agents are not exactly task steps, but they can contain task steps within them [(1) ]() . ## What States Are States in multi-prompt agents are distinct conversation phases, each with their own focused prompt and behavior . Each state includes: - **Focused Prompt**: Specific instructions for that conversation phase - **State-Specific Functions**: Only relevant tools available in each state - **Transition Logic**: Clear conditions for moving between states - **Context Preservation**: Variables and information flow between states ## Task Steps Within States Within each state's prompt, you can define specific task steps. The prompt engineering guide recommends structuring prompts with clear task sections [(2) ]() :
Copy code
///## Task
1. Greet the user
2. Ask for user's name
3. Ask if user needs a refund, replacement, or information
...
## Real-World Example The API documentation shows how states work in practice [(3) ]() :
Copy code
javascript
{
  "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."
        }
      ]
    },
    {
      "name": "appointment_booking", 
      "state_prompt": "You will follow the steps below to book an appointment..."
    }
  ]
}
## Key Distinction - States = High-level conversation phases (information collection, appointment booking, etc.) - Task steps = Specific numbered instructions within each state's prompt This structure provides predictable behavior where each state has a clear, focused purpose [(1) ]() , while task steps within states guide the specific actions the agent should take.
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[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.
j
@AI Evy how the global propmt and staepropmt are combined
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ## How Global Prompt and State Prompt Are Combined In multi-prompt agents, the global prompt and state prompts work together in a specific way [(1) ]() : The global prompt is appended to the system prompt regardless of what state the agent is in [(2) ]() . The combination follows this pattern : - *System prompt (with state) * = general prompt + state prompt - *System prompt (no state) * = general prompt ## Global Prompt Purpose The global prompt is where you specify the agent's persona, identity, and guardrails [(1) ]() . This set of text will be available in every node and will influence all response generation . ## State-Specific Prompts Each state has its own focused prompt with specific instructions for that conversation phase [(3) ]() . The state prompt provides the detailed instructions for what the agent should do in that particular state . ## API Structure The API shows this structure in the response [(4) ]() [(2) ]() :
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."
        }
      ]
    },
    {
      "name": "appointment_booking",
      "state_prompt": "You will follow the steps below to book an appointment..."
    }
  ]
}
## Community Discussion Based on community discussion, when an agent transitions from one state to another, state-specific prompts override the general prompt, but they work hand in hand [(5) ]() . The new state prompt becomes part of the system prompt along with the general prompt .
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] Step 2: Configure the basic settings](https://docs.retellai.com/build/single-multi-prompt/configure-basic-settings) [[2] List Retell LLMs](https://docs.retellai.com/api-references/list-retell-llms) [[3] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[4] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[5] Multi-Prompt Agent State Transition - LLM Prompt Mechanics](https://discord.com/channels/1186424376300679209/1395545946066129039) ​
j
@AI Evy so i got two states my trantion statemetn is The person chooses a time and date for their appointment, why not transitoning?
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ## Transition Statement Issue Your transition statement "The person chooses a time and date for their appointment" might be too vague for reliable state transitions [(1) ]() . ## Better Transition Patterns Based on the documentation, here are more specific patterns that work better [(2) ]() :
Copy code
7. Ask if user is interested in an in person tour.
 - if yes, transition to schedule_tour.
 - if no or hesitant, call function end_call to hang up politely and say will reach out if any other interesting properties pop up.
Copy code
3. Confirm the date, time, and timezone selected by user: "Just to confirm, you want to book the appointment at ...". Make sure this is a time from the available slots.
4. Once confirmed, call function book_appointment to book the appointment.
## Recommended Fix Try making your transition condition more specific and actionable: - "User has confirmed a specific date and time for the appointment" - "User said yes to booking the appointment at the confirmed time" - "User provided both date and time details for scheduling" ## API Structure Your states should be structured with clear transition logic in the edges [(3) ]() :
Copy code
json
{
  "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."
    }
  ]
}
The key is making your transition description specific enough for the LLM to reliably detect when the condition has been met [(1) ]() .
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[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.
j
@AI Evy can I use variable {{current_time_{{timezone}}}} in simulation prompt?
a
Thanks for the follow-up, @japhetgan. I'll get back to you soon.
### Answer ### Answer Yes, you can use nested dynamic variables like
{{current_time_{{timezone}}}}
in simulation prompts [(1) ]() . The documentation shows that Retell AI supports system default dynamic variables with timezone functionality : - `{{current_time}}`: current time in America/Los_Angeles (Monday, March 24, 2025 at 02:53:01 PM PDT) - `{{current_time_[timezone]}}`: current time in given timezone Examples include: -
current_time_Australia/Sydney
-
current_time_America/New_York
Dynamic variables work in multiple contexts including prompts, begin messages, and tool configurations [(2) ]() . The
{{variable_name}}
syntax allows you to inject personalized data into your agent's responses . For simulation testing specifically, you can write user prompts that reference these dynamic variables to test time-sensitive scenarios across different timezones [(1) ]() .
​ To learn more, see the sources I considered: [[1] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.