https://retellai.com/?utm_source=discord&utm_medium=seo logo
How can we make a retell AI calling agent in such ...
# ❓・ai-evy-support
m
@AI Evy How can we make a retell AI calling agent in such a way that it can call the leads in a few seconds, and if a person asks for a callback, it can make a callback with the same number exactly at the same time at which the user has asked, and one more thing that when the appointment is booked, it can call one hour before the exact appointment time and intergrate in GHL also. Can you help me in this
a
Thanks for tagging me @madhav_89676. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available documentation, I can help you understand some aspects of building a Retell AI calling agent, though the specific callback scheduling and GHL integration features you're asking about aren't fully covered in the sources. ## Creating a Retell AI Agent You can create an agent using the Retell API [(1) ]() . The basic setup involves configuring the response engine, voice settings, and various call parameters [(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) ;
[(3) ]() ## Function Calling for Actions For callback scheduling and appointment booking, you can implement function calling [(4) ]() . This allows your agent to take actions like booking appointments or scheduling callbacks:
Copy code
export interface FunctionCall {
 id: string;
 funcName: string;
 rguments: Record<string, any>;
 result?: string;
}
// some class boilerplate codes
private PrepareFunctions() : ChatCompletionsFunctionToolDefinition[] {
 let functions: ChatCompletionsFunctionToolDefinition[] = [{
 type: "function",
 function: {
 name: "end_call",
## Appointment Booking Integration Retell AI supports appointment booking functionality that can integrate with Cal.com [(5) ]() . The platform can handle appointment scheduling scenarios and automated follow-ups . ## Limitations and Custom Development Needed Based on community discussions, some users have noted that the built-in appointment booking function has limitations [(6) ]() . For more advanced features like: - Exact callback timing - One-hour appointment reminders - GHL integration - Custom scheduling logic You may need to implement custom tools and backend integrations . For the specific requirements you mentioned (callback scheduling at exact times, appointment reminders, and GHL integration) , you would likely need to build custom webhook handlers and external scheduling systems that work with Retell's API. I don't have complete information about GHL integration or the exact callback scheduling features in the available sources. Would you like me to provide general guidance on how these systems typically work together?
​ 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] Update Agent](https://docs.retellai.com/api-references/update-agent) [[4] Integrate Function Calling](https://docs.retellai.com/integrate-llm/integrate-function-calling) [[5] 7 Personalization Tactics That Boost Call-to-Booking Rates 41% in AI-Powered Appointment Scheduling](https://www.retellai.com/resources/7-tactics-boost-call-to-booking-rates) [[6] calendar appointment booking through retell](https://discord.com/channels/1186424376300679209/1250814023067500657) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@User When the AI will callback at the exact same time or call before 1 hour of the appointment, then it will need different scripts for both the cases then how we can do this thing and I also want that when the AI caller should use only the single number only not the multiple number for calling.
@AI Evy Tell me
a
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
### Answer For handling different scripts based on callback scenarios and using a single number, here's what you can implement with Retell AI: ## Dynamic Scripts with Custom Functions You can create custom functions that handle different scenarios by passing context parameters [(1) ]() . When setting up your custom function, you can define parameters that indicate the call type:
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
## Response Variables for Context You can extract values from API responses and save them as dynamic variables for use later in the conversation . For example, you can extract call context and reference it using
{{call_type}}
or
{{appointment_time}}
. ## Single Number Configuration For using a single number for all calls, you'll need to configure your phone number settings in the agent configuration [(2) ]() . The voice settings and call settings can be configured to maintain consistency across all outbound calls . ## Custom Function Implementation To handle different scripts, you can create a custom function that: 1. Receives the call context (callback vs appointment reminder) 2. Returns the appropriate script or talking points 3. Uses dynamic variables to personalize the conversation [(1) ]() The function execution process works as follows [(3) ]() : 1. **Agent Decision**: Based on the conversation context, the LLM determines when a function is needed 2. **Parameter Extraction**: The agent extracts required information from the conversation 3. **Function Execution**: Retell calls your function with the extracted parameters 4. **Response Handling**: The function result is processed and incorporated into the conversation However, the specific implementation details for scheduling callbacks at exact times and appointment reminders would require custom backend development that integrates with Retell's webhook system. The available sources don't provide complete guidance on the automated scheduling system you're looking to build. Would you like me to provide general guidance on how such scheduling systems typically work with voice AI platforms?
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Step 2: Configure the basic settings](https://docs.retellai.com/build/single-multi-prompt/configure-basic-settings) [[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 Which type of conversational prompt is best
a
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
​ 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] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[3] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) ​
### Answer For your use case, I recommend using Conversation Flow as the best approach for handling different callback scenarios and appointment reminders [(1) ]() . ## Why Conversation Flow is Best for Your Needs Conversation Flow provides the most control over dialogue paths, allowing you to create intricate conversation structures that guide users through various scenarios effectively . This approach minimizes the need for extensive prompt engineering since it enables you to design dynamic interactions without rigid scripts . ## Comparison of Approaches **Single Prompt**: Uses one comprehensive prompt to define an agent's behavior . This is straightforward but requires significant effort in prompt engineering and may lead to hallucinations as complexity increases . **Multi-Prompt**: Combines several single prompt agents into a structured tree of fine-tuned prompts . Each node can contain its own specific prompt and transition logic to other nodes . **Conversation Flow**: Provides the most control over dialogue paths and is designed for users who prefer not to engage in AI prompt engineering . It addresses critical issues such as hallucinations by implementing a constrained framework . ## Implementation for Your Scenario You can create different nodes for different call types using the Conversation Flow API [(2) ]() :
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.create({
 model_choice: { model: 'gpt-5', type: 'cascading' },
 nodes: [
 {
 id: 'start',
 instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },
 type: 'conversation',
 },
 ],
 start_speaker: 'agent',
}) ;
## Best Practice Structure Use sectional prompts within your Conversation Flow nodes [(3) ]() . Break large prompts into focused sections for better organization and LLM comprehension : - **Identity section**: Define your agent's role and expertise - **Style Guardrails**: Set tone and response length - **Response Guidelines**: Specify formatting and interaction patterns For your specific needs with callbacks and appointment reminders, you can create separate nodes with tailored instructions for each scenario, ensuring consistent and appropriate responses for different call contexts.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Can you tell me the example what the worst that can happen with the Multi Prompt agent if I use that in place of conversational flow.
a
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
t don't hang up the phone until the second goodbye, happening 6/10 times [(4) ]() . This results in call failures in analytics even when the conversation flow was technically successful . ## Why Conversation Flow Addresses These Issues Conversation Flow provides a constrained framework that significantly mitigates hallucination problems by offering predefined pathways for interactions [(3) ]() . It ensures that interactions remain relevant and trustworthy, enhancing the overall user experience . The constrained framework benefits include clarity in responses where the AI can generate responses that are more aligned with user expectations, reducing the chances of irrelevant or incorrect information being provided . For your callback and appointment reminder use case, these multi-prompt limitations could result in unreliable state transitions, inconsistent behavior when handling different call scenarios, and potential failures in executing the precise timing requirements you need.
### Answer Based on the documentation and community experiences, here are the key issues that can occur with Multi-Prompt agents compared to Conversation Flow: ## Documented Limitations at Scale As complexity increases, multi-prompt agents experience several problems [(1) ]() : 1. **Behavioral Drift**: Agent deviates from instructions in edge cases 2. **Function Calling Issues**: Unreliable tool usage with multiple functions 3. **Maintenance Challenges**: Large prompts become difficult to debug and update 4. **Context Confusion**: Agent struggles to track conversation state You should consider upgrading to multi-prompt when your single prompt exceeds 500 words or uses more than 3 functions . ## Real-World Transition Problems Community users have reported specific issues with state transitions in multi-prompt agents. One user experienced that their agent would successfully move from state5 to state6 when starting at state5, but would stop at state5 when starting from an earlier state like state4 [(2) ]() . The solution required adding explicit transition language like: "Immediately and reliably initiate the transfer. You must invoke the transfer_call_six function at this point without fail. This is critical and non-negotiable" . ## Hallucination Issues Multi-prompt systems can suffer from hallucinations - instances where AI generates incorrect or nonsensical responses [(3) ]() . For example, if a customer inquires about their order status and the AI mistakenly provides unrelated information, it can lead to frustration and erode trust . ## Call Ending Problems Users have reported issues where multi-prompt agents say goodbye bu
​ 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] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) [[3] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[4] Our Agent will say goodbye but not hang-up the phone until the second time you say goodbye](https://discord.com/channels/1186424376300679209/1357024503531569393) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
m
@AI Evy Can you tell me that when we setup the retell AI chatbot and use that chatbot that chatbot can continue the same conversation that is done on the call or can senf a message to the user that your phone is not picking up in the case if the phone not pickups?
a
​ To learn more, see the sources I considered: [[1] Unlock AI Texting, SMS, & Chatbots with Retell AI Agents | Retell AI | Retell AI](https://www.retellai.com/blog/unlock-ai-texting-with-retell-ai-voice-agents) [[2] ](https://www.retellai.com/resources/automate-multi-channel-quote-delivery-salesforce-retell-ai-voice-chat-agents) ​
s to repurpose logic and workflows across channels without duplicating build time . The platform uses the same phone number infrastructure for both voice and SMS, requiring no extra setup . You can customize messages and include dynamic variables like {{first_name}} or {{booking_time}} for personalized follow-ups .
### Answer ### Answer Yes, Retell AI supports both conversation continuity and automated follow-up messaging for missed calls through its omni-channel capabilities. ## Cross-Channel Conversation Continuity Retell AI enables seamless conversation flow between voice calls and chatbots [(1) ]() . When a conversation starts via voice call, the AI agent can continue the interaction through chat or other channels without losing conversation history or requiring customers to repeat information . This is achieved through Retell AI's voice-to-chat context preservation, which maintains [(2) ]() : - Complete conversation history - Emotional context and sentiment - Technical requirements discussed - Budget and timeline parameters - Decision-maker information - Competitive landscape insights ## Missed Call Follow-Up Messaging For scenarios where phone calls aren't answered, Retell AI provides automated SMS follow-up capabilities [(1) ]() . You can set up standalone SMS agents that initiate follow-up messages when calls are missed or go unanswered, continuing the outreach in real time . ## Implementation Options You have two ways to implement chatbot functionality : 1. **SMS Nodes Within Voice Flows**: Add SMS nodes directly to your calling workflows to send texts during or after calls 2. **Standalone SMS/Chat Agents**: Create dedicated chatbot agents that can handle missed call follow-ups and continue conversations independently ## One-Click Conversion Retell AI offers a "Convert to Voice Agent" toggle that allows you to convert existing AI voice agents into SMS flows in one click . This enables team
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy Can you give the proper steps to build a retell AI multiprompt agent in the way I want
a
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
## Step 5: Define Function Calling Logic Specify when to call functions for booking and callbacks [(1) ]() :
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.
## Step 6: Create Custom Functions for Integration Set up custom functions for your GHL integration and scheduling [(3) ]() . Configure the function with: - Name (e.g.,
schedule_callback
) - Description for the LLM - HTTP method (POST recommended) - Endpoint URL for your backend - Parameter schema for callback timing and user details ## Step 7: Use API for Multi-Prompt Creation For programmatic creation, use the Retell API with states configuration [(4) ]() . The API endpoint supports multi-prompt agent creation through the states parameter structure. ## Important Considerations Multi-prompt agents can experience behavioral drift, function calling issues, and context confusion as complexity increases [(5) ]() . Consider upgrading when your prompt exceeds 500 words or uses more than 3 functions . For your specific requirements (exact callback timing, appointment reminders, GHL integration) , you'll need custom backend development to handle the scheduling logic that integrates with Retell's webhook system.
### Answer Based on your requirements for callbacks, appointment reminders, and GHL integration, here are the proper steps to build a Retell AI multi-prompt agent: ## Step 1: Break Down the Conversation into Steps Start by identifying the different conversation phases for your use case [(1) ]() : - Initial lead outreach - Callback scheduling - Appointment booking - Appointment reminder calls Each step should have its own focused prompt . ## Step 2: Define State Transition Logic Create clear conditions for moving between states . For your callback scenario:
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.
## Step 3: Structure Your Prompts by Section Use sectional prompts for better organization [(2) ]() :
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
...
## Step 4: Write Tasks as Sequential Steps For reliable conversation flow, structure your tasks as numbered steps :
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.
...
​ To learn more, see the sources I considered: [[1] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[2] Write a single prompt](https://docs.retellai.com/build/single-multi-prompt/write-single-prompt) [[3] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[4] Multi-prompt agent creation using Retell API](https://discord.com/channels/1186424376300679209/1338253252587946146) [[5] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@AI Evy This is not the proper guide. Can you give me a proper guide for this
a
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
Copy code
///## Identity

You are a friendly AI assistant for [Company Name].
Your role is to [specific purpose].
You have expertise in [relevant domains].
///## Style Guardrails
Be concise: Keep responses under 2 sentences unless explaining complex topics.
Be conversational: Use natural language, contractions, and acknowledge what the caller says.
Be empathetic: Show understanding for the caller's situation.
///## Response Guidelines
Return dates in spoken form: Say "January fifteenth" not "1/15".
Ask one question at a time: Avoid overwhelming the caller with multiple questions.
Confirm understanding: Paraphrase important information back to the caller.
///## Task Instructions
[Specific steps the agent should follow]
///## Objection Handling
If the caller says they're not interested: "I understand. Is there anything specific..."
If the caller is frustrated: "I hear your frustration, let me help resolve this..."
### Answer ### Comprehensive Multi-Prompt Agent Build Guide Based on your specific requirements for callbacks, appointment reminders, and integrations, here's a detailed step-by-step guide: ## Step 1: Break Down Your Conversation Flow First, identify the key conversation phases for your use case [(1) ]() : 1. Initial lead contact 2. Callback request handling 3. Appointment booking 4. Pre-appointment reminders In each step, you can define a prompt . ## Step 2: Define State Transition Logic Create clear transition conditions between states. For example :
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.
## Step 3: Configure Function Calling Define when to call functions for your specific actions :
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.
## Step 4: Use Recommended Prompt Structure Structure your prompts using sections for better LLM processing [(2) ]() :
## Important Limitations to Consider Multi-prompt agents can experience several issues as complexity increases [(3) ]() : 1. **Behavioral Drift**: Agent deviates from instructions in edge cases 2. **Function Calling Issues**: Unreliable tool usage with multiple functions 3. **Maintenance Challenges**: Large prompts become difficult to debug and update 4. **Context Confusion**: Agent struggles to track conversation state Consider upgrading to multi-prompt when your single prompt exceeds 500 words or uses more than 3 functions . ## Community-Reported Issues Based on user experiences, multi-prompt agents can have transition problems where agents don't reliably move between states [(4) ]() . Users have also reported issues with call ending where agents say goodbye but don't hang up until the second goodbye [(5) ]() . For your specific requirements (exact callback timing, appointment reminders, GHL integration) , the available documentation doesn't provide complete implementation details. You would need custom backend development that integrates with Retell's webhook system for the advanced scheduling features you described. Would you like me to provide general guidance on how such scheduling systems typically work with voice AI platforms?
​ To learn more, see the sources I considered: [[1] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[2] Prompt Engineering Guide](https://docs.retellai.com/build/prompt-engineering-guide) [[3] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[4] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1412769473227657329) [[5] Discord message from @_superwhale on 2025-01-24](https://discord.com/channels/1186424376300679209/1294891368505937952/1332171997744205925) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
@User We also want to nurture the lead that they are the right lead or not
@AI Evy Tell me
a
Thanks for the follow-up, @madhav_89676. I'll get back to you soon.
### Answer Based on the available sources, here's how Retell AI can help you nurture leads and determine if they're the right fit: ## Lead Qualification and Scoring Retell AI voice agents can automatically qualify leads through conversational interactions [(1) ]() . The agents engage prospects with qualifying questions about budget, timing, authority, and need, then score leads based on predefined criteria . ## Predictive Lead Scoring AI analyzes past behaviors, conversation quality, and firmographic/demographic data to assess a lead's likelihood of conversion [(2) ]() . By comparing these data points to your ideal customer profile, AI can generate a score that predicts the probability of a lead becoming a customer . ## Lead Segmentation and Targeting AI-powered solutions enable more accurate lead segmentation based on various factors such as demographics, industry, company size, and online behavior . This allows you to create highly targeted marketing campaigns and ensure that the right content is sent to the right person at the right time . ## Automated Lead Nurturing Retell AI can create and automate customized message sequences and campaigns, ensuring that leads receive the right information at the right time . This helps to keep leads engaged and move them closer to a purchase decision . ## Re-qualification and Nurture Automation Retell AI agents can periodically re-engage older or previously unqualified leads to identify new opportunities, while executing nurture call cadences automatically [(3) ]() [(4) ]() . This ensures no potential leads fall through t
he cracks. ## Real-time Lead Scoring and Routing The system scores leads in real time based on responses and sentiment signals, ensuring hot leads are prioritized, while allowing instant warm transfers when prospects are ready to engage with sales . ## Data-Driven Insights Automated outbound calls collect valuable data about customer behavior, preferences, and responses that can be used to refine strategies, adjust call scripts, and improve overall performance [(5) ]() .
​ To learn more, see the sources I considered: [[1] How Do Voice Bots Do Lead Qualification? | Retell AI](https://www.retellai.com/blog/how-do-voice-bots-do-lead-qualification) [[2] AI Lead Generation for Outbound Calls | Retell AI](https://www.retellai.com/blog/ai-lead-generation-strategies-for-outbound-calling-agents) [[3] Maximize Conversions with Retell AI SDR Lead Automation | Retell AI | Retell AI](https://www.retellai.com/blog/retell-ai-sdr-lead-generation-automation) [[4] Maximize Conversions with Retell AI SDR Lead Automation | Retell AI | Retell AI](https://www.retellai.com/blog/retell-ai-sdr-lead-generation-automation) [[5] Outbound Call Centers & AI Voice Agents | Retell AI](https://www.retellai.com/blog/outbound-call-center-automation-and-the-role-of-ai-voice-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.