japhetgan
09/06/2025, 6:20 AMAI Evy
09/06/2025, 6:20 AMAI Evy
09/06/2025, 6:20 AMAI Evy
09/06/2025, 6:20 AMAI Evy
09/06/2025, 6:20 AMjaphetgan
09/06/2025, 6:38 AMAI Evy
09/06/2025, 6:38 AMAI Evy
09/06/2025, 6:38 AMgeneral_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 .AI Evy
09/06/2025, 6:38 AMAI Evy
09/06/2025, 6:38 AMjaphetgan
09/06/2025, 6:41 AMAI Evy
09/06/2025, 6:41 AMAI Evy
09/06/2025, 6:41 AM///## 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 :
///## 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.
...AI Evy
09/06/2025, 6:41 AM## 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 .AI Evy
09/06/2025, 6:41 AMAI Evy
09/06/2025, 6:41 AMjaphetgan
09/06/2025, 6:50 AMAI Evy
09/06/2025, 6:50 AMAI Evy
09/06/2025, 6:50 AMend_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 appropAI Evy
09/06/2025, 6:50 AMAI Evy
09/06/2025, 6:50 AMjaphetgan
09/06/2025, 6:56 AMAI Evy
09/06/2025, 6:56 AMAI Evy
09/06/2025, 6:57 AMAI Evy
09/06/2025, 6:57 AM{{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) ]() :
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) :
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) ]() :
json
{
"default_dynamic_variables": {
"company_name": "Retell Inc",
"support_hours": "9 AM - 5 PM"
}
}AI Evy
09/06/2025, 6:57 AMAI Evy
09/06/2025, 6:57 AMjaphetgan
09/06/2025, 6:57 AMAI Evy
09/06/2025, 6:57 AMAI Evy
09/06/2025, 6:57 AMedges defined within each state's structure [(2) ]() [(3) ]() [(4) ]() :
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 [)AI Evy
09/06/2025, 6:57 AMAI Evy
09/06/2025, 6:57 AMjaphetgan
09/06/2025, 7:15 AMAI Evy
09/06/2025, 7:15 AMAI Evy
09/06/2025, 7:15 AMgeneral_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 :
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) ]() :AI Evy
09/06/2025, 7:15 AMjson
{
"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 .AI Evy
09/06/2025, 7:15 AMAI Evy
09/06/2025, 7:15 AMjaphetgan
09/06/2025, 8:01 AMAI Evy
09/06/2025, 8:01 AMAI Evy
09/06/2025, 8:01 AMOnly 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."AI Evy
09/06/2025, 8:01 AMknowledge_base_ids and kb_config settings [(3) ]() [(4) ]() :
json
{
"knowledge_base_ids": [
"<string>"
],
"kb_config": {
"top_k": 3,
"filter_score": 0.6
}
}
[(3) ]() , [(4) ]()AI Evy
09/06/2025, 8:01 AMAI Evy
09/06/2025, 8:01 AMjaphetgan
09/08/2025, 1:27 PMAI Evy
09/08/2025, 1:27 PMAI Evy
09/08/2025, 1:27 PMUser 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 :
- {{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}} existsAI Evy
09/08/2025, 1:27 PMcondition 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.AI Evy
09/08/2025, 1:27 PMAI Evy
09/08/2025, 1:27 PMjaphetgan
09/08/2025, 1:31 PMAI Evy
09/08/2025, 1:31 PMAI Evy
09/08/2025, 1:31 PM7. 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.
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.AI Evy
09/08/2025, 1:31 PMAI Evy
09/08/2025, 1:32 PMAI Evy
09/08/2025, 1:32 PMjaphetgan
09/08/2025, 2:02 PMAI Evy
09/08/2025, 2:02 PMAI Evy
09/08/2025, 2:03 PM///## 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) ]() :
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..."
}
]
}AI Evy
09/08/2025, 2:03 PMAI Evy
09/08/2025, 2:03 PMAI Evy
09/08/2025, 2:03 PMjaphetgan
09/08/2025, 2:07 PMAI Evy
09/08/2025, 2:07 PMAI Evy
09/08/2025, 2:07 PMjson
{
"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..."
}
]
}AI Evy
09/08/2025, 2:07 PMAI Evy
09/08/2025, 2:07 PMAI Evy
09/08/2025, 2:07 PMjaphetgan
09/08/2025, 2:37 PMAI Evy
09/08/2025, 2:37 PMAI Evy
09/08/2025, 2:37 PM7. 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.
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) ]() :
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) ]() .AI Evy
09/08/2025, 2:42 PMAI Evy
09/08/2025, 2:42 PMjaphetgan
09/09/2025, 11:45 AMAI Evy
09/09/2025, 11:45 AMAI Evy
09/09/2025, 11:45 AM{{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) ]() .AI Evy
09/09/2025, 11:45 AMAI Evy
09/09/2025, 11:45 AM