tacitus_16379
10/21/2025, 11:12 AMAI Evy
10/21/2025, 11:12 AMAI Evy
10/21/2025, 11:13 AM{{summary}} variable, you'll need to use Retell's dynamic variables feature in your agent prompt [(1) ]() .
Here's how to structure your prompt to achieve this:
Prompt Structure:
Include instructions in your general prompt that reference the {{summary}} variable and specify how the agent should use it. For example:
"You are a follow-up call agent. At the beginning of the call, briefly summarize the previous conversation using this information: {{summary}}. Start by saying something like 'I'm calling to follow up on our previous conversation where we discussed [brief recap of {{summary}}].' Then proceed with the purpose of this call."
Implementation:
When making the outbound call, pass the summary data through the retell_llm_dynamic_variables parameter [(1) ]() [(2) ]() :
javascript
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
retell_llm_dynamic_variables: {
"summary": "Customer expressed interest in premium plan, discussed pricing concerns, requested callback about implementation timeline"
}
}) ;AI Evy
10/21/2025, 11:13 AM{{summary}} variable will be dynamically injected into your prompt at runtime [(1) ]()
- Structure your prompt to naturally incorporate the summary at the beginning of the conversation
- You can store call summaries from previous interactions and pass them as dynamic variables for follow-up calls [(3) ]()
This approach allows your agent to provide context-aware follow-up calls that reference previous conversation details.AI Evy
10/21/2025, 11:13 AMAI Evy
10/21/2025, 11:13 AMtacitus_16379
10/21/2025, 11:17 AMAI Evy
10/21/2025, 11:17 AMAI Evy
10/21/2025, 11:17 AM{{summary}} variable while filtering out sensitive information like phone numbers or contact preferences, you can use specific prompt instructions that guide the agent on what to include and exclude from the summary [(1) ]() .
Prompt Structure with Filtering Instructions:
Structure your prompt to explicitly instruct the agent on what information to share and what to omit:
"You are a follow-up call agent. At the beginning of the call, provide a brief summary of our previous conversation using this information: {{summary}}.
IMPORTANT: When summarizing, only mention:
- The main topics discussed
- Customer interests or concerns raised
- Next steps or commitments made
- Product/service details covered
DO NOT mention or reference:
- Phone numbers
- Best times to call
- Personal contact preferences
- Internal notes or codes
- Any sensitive personal information
Start with something like: 'I'm calling to follow up on our previous conversation where we discussed [filtered summary content].' Then proceed with the purpose of this call."
Alternative Approach - Pre-process the Summary:
You could also clean the summary data before passing it to the dynamic variable by removing sensitive information in your application logic before setting the retell_llm_dynamic_variables [(1) ]() [(2) ]() :AI Evy
10/21/2025, 11:17 AMjavascript
// Clean the summary before passing to the call
const cleanedSummary = originalSummary
.replace(/\+?\d{1,3}[\s-]?\(?\d{3}\) ?[\s-]?\d{3}[\s-]?\d{4}/g, '[PHONE REDACTED]')
.replace(/best time to call|contact preference/gi, '[CONTACT INFO REDACTED]') ;
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
retell_llm_dynamic_variables: {
"summary": cleanedSummary
}
}) ;
The prompt-based approach is generally more flexible since it allows the LLM to intelligently filter content while maintaining conversational flow [(1) ]() .AI Evy
10/21/2025, 11:17 AMAI Evy
10/21/2025, 11:17 AMtacitus_16379
10/21/2025, 11:39 AMAI Evy
10/21/2025, 11:39 AMAI Evy
10/21/2025, 11:39 AM{{summary}} variable isn't being populated, this appears to be a common dynamic variables problem. Let me help you troubleshoot this.
Debugging Steps:
First, verify that the dynamic variable is being received by temporarily adding it to your begin message to test if the agent is getting the correct value [(1) ]() . In your agent settings, try setting the begin message to:
"Hello, I'm calling to follow up. Previous conversation summary: {{summary}}"
This will help confirm whether the variable is being passed correctly [(1) ]() [(2) ]() .
Common Issues and Solutions:
1. **Variable Format**: Ensure all values in retell_llm_dynamic_variables are strings [(1) ]() . For outbound calls, use this format:
javascript
{
"summary": "Customer discussed premium plan pricing and requested follow-up call"
}
2. **API Implementation**: For outbound calls, set variables in the retell_llm_dynamic_variables field when using the Create Phone Call API [(1) ]() [(3) ]() :
javascript
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
retell_llm_dynamic_variables: {
"summary": "Your cleaned summary content here"
}
}) ;AI Evy
10/21/2025, 11:39 AMAI Evy
10/21/2025, 11:39 AMAI Evy
10/21/2025, 11:39 AMtacitus_16379
10/21/2025, 11:44 AMAI Evy
10/21/2025, 11:44 AMAI Evy
10/21/2025, 11:44 AM{{summary}} isn't being used despite being set correctly, this appears to be a known problem where the agent doesn't take the variables during API calls but works in testing [(1) ]() .
Troubleshooting Steps:
1. **Verify Variable Placement**: Ensure the {{summary}} variable is placed directly in your main agent prompt, not just referenced indirectly [(2) ]() . The spaces around the variable name will be trimmed when evaluating the variable .
2. **Test with Simple Prompt**: Create a very simple test where the agent just speaks the dynamic variables to isolate the issue [(1) ]() . Try a prompt like:
"You are a follow-up agent. Start every call by saying: The summary from our previous conversation is: {{summary}}. Then ask how you can help."
3. **Check API Implementation**: For outbound calls, ensure you're setting variables correctly in the retell_llm_dynamic_variables field [(2) ]() [(3) ]() :
javascript
const phoneCallResponse = await client.call.createPhoneCall({
from_number: '+14157774444',
to_number: '+12137774445',
retell_llm_dynamic_variables: {
"summary": "Ms. Vogt, who has statutory insurance, would like to pick up her finished, altered insole on Monday without an appointment."
}
}) ;
4. **Alternative Solution**: One user reported success using the inbound webhook format for dynamic variables [(1) ]() :AI Evy
10/21/2025, 11:44 AMjavascript
return {
"call_inbound": {
"dynamic_variables": {
"summary": "Ms. Vogt, who has statutory insurance, would like to pick up her finished, altered insole on Monday without an appointment."
}
}
}
**Default Behavior Check**: When a dynamic variable has no assigned value, it remains in its raw form with the curly braces intact [(2) ]() . Since you're seeing a generic response instead of the variable content, this suggests the variable isn't being processed at all.
Try the simple test approach first to confirm whether the variable is being received, then gradually add complexity once the basic functionality works.AI Evy
10/21/2025, 11:44 AMAI Evy
10/21/2025, 11:44 AMtacitus_16379
10/21/2025, 11:58 AMAI Evy
10/21/2025, 11:58 AMAI Evy
10/21/2025, 11:59 AMAI Evy
10/21/2025, 11:59 AM{{appointment_start_date}} remained as literal text with curly braces instead of being replaced with their actual values, even though the same variables worked correctly when manually specified at the agent level .
**Solution**: Test your dynamic variables using voice/audio testing instead of the chat interface to verify they're working correctly . The chat test mode appears to have limitations with dynamic variable substitution that don't affect actual voice calls.
This explains why you're seeing generic responses like "I'm calling back on behalf of the practice" instead of your specific summary content during chat testing, even though your variable assignment appears correct.AI Evy
10/21/2025, 11:59 AM