Is there a way to have the VAPI agent respond diff...
# support
v
Is there a way to have the VAPI agent respond differently on the call if dynamic variables exist for a previous client? For example, I would like the experience to be more streamlined for the previous client as we have all their information. Currently, when I ask for my details, it provides, but it doesn't seem to recognize this without me telling it on the call that it has my information. I would like it to be able to execute a prompt like this: If they are a previous client, use their information for any booking fields. The information should be as follows: Phone Number: [phone_number] First Name: [first_name] Last Name: [last_name] Email: [email] etc... and this: Recognizing Frequent Callers If the caller is a previous client and their history indicates frequent bookings: Greet them warmly with acknowledgment: Example: "Welcome back, [first_name]! It’s great to hear from you again." "Hi [first_name], I see you’ve booked with us before. Let’s get you taken care of!" Use stored preferences to anticipate needs: Example: "Would you like to book with Dr. [last_seen_doctor] again?" "I see your last appointment was for [appointment_type]. Are you looking to book the same service today?" Tailor appointment options based on booking history: Example: "Your last visit was in [last_seen]. Based on your usual schedule, it might be time for a follow-up. Would you like me to check availability for [next_appointment_date_by]?" Currently, even though it has my information, it onboards me like a new client. How do I get it to recognize a previous client without the caller telling it? Is this possible?
v
@vrancic Absolutely, VAPI can be configured to recognize previous clients and personalize their experience using dynamic variables. To achieve this, you would typically need to implement a system that checks the caller's phone number or another unique identifier against a database of previous clients. If a match is found, the system would then load the client's information into dynamic variables for use during the call. Here's a high-level overview of how you could set this up: 1. **Caller Identification**: When a call is received, the system should automatically capture the caller's phone number or ask for a unique identifier (like a customer ID). 2. **Database Lookup**: Use the captured information to look up the client in your database. If they are a returning client, retrieve their details. 3. **Dynamic Variables**: Populate dynamic variables with the client's information, such as
[phone_number]
,
[first_name]
,
[last_name]
,
[email]
, etc. 4. **Personalized Prompts**: Customize the call flow to use these dynamic variables in your prompts and responses. For frequent callers, you can use their booking history to tailor the conversation. 5. **Call Flow Logic**: Implement logic in your call flow to differentiate between new and returning clients. This logic can then trigger different sets of prompts and actions accordingly. 6. **Testing and Iteration**: Test the system thoroughly to ensure it recognizes returning clients correctly and provides a personalized experience as intended. If you need assistance with setting up this feature or have any specific questions about implementing it with VAPI, please let me know, and I'd be happy to help guide you through the process.
You can continue this conversation by mentioning me in the message.
v
I’ve done this but the agent doesn’t follow the prompt in this scenario- it continues on-boarding as if I was a new client
@User
j
create a vapi tool and set its server URL to a new Make.com webhook. Pass the phone number through the webhook and then create a make.com workflow that searches for this number on your CRM or whatever you use to track calls. If you can get a call summary or call logs you can feed into ChatGPT (still in a Make.com workflow), you can have ChatGPT put the info into a format that won't confuse your assistant. Set it up to run at the beginning of your call or if possible do it before. Then write into your vapi prompt how you want the assistant to use this info the biggest issue is going to be tool response time, so try to avoid using chatgpt if you can
Ideally you would pass a customer id through the webhook instead of phone number, because phone numbers are not always the same format
v
Hi Jon, thanks for responding. I do have this already setup and the variables are working well. When I ask the assistant, it is knowledgeable about my account, but only when I ask. I would like it to recognize if I am a previous caller and handle the call differently based on that. I’ve tried to use prompting but haven’t been successful.
j
Oh I see. Vapi Blocks and also "squads" both seem like potential workarounds. Although vapi blocks is still in beta and probably not quite ready for your application, this is what I had in mind. With squads, you could have two separate agents, one to talk to customers with call history, and one to talk to new customers. That way you can clearly define how you want each conversation to go https://cdn.discordapp.com/attachments/1312785985565626398/1312925270168174765/image.png?ex=674e4471&is=674cf2f1&hm=4a8f2a1235137bd5e9202c444e82291f81aa8ae8b02a533ccaf1479fce5bdf24&
The green label on the left is supposed to say
call_history== null
and the one on the right is supposed to say ``call_history!= null`
v
Thanks for responding. I hadn’t had luck with blocks as I found it a bit buggy. I’m also wondering if the logic in blocks used to speak to new/previous clients not unlike the logic I would already have in my dashboard Vapi prompt. I feel that it should just work through the prompting but maybe there is a better approach to getting the agent to register when the variables are filled with client information.
s
Hey @vrancic To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help me figure out what went wrong!
v
Call ID: 76d94f17-2db3-4edf-ba88-394378f65469 Between 9:00 - 9:01 I have in my prompting for it to speak to the caller differently if it is a previous client (if the dynamic tags are filled). The dynamic tags become filled from the google sheet but the agent doesn't treat me different. I would like to customize the experience for previous clients with that information. In this call, I have to ask if I am a previous client for the agent to kick in and say yes you are, can you confirm these details etc... Here is my current prompting (part 1) for the previous caller section: revious Client If the caller is a previous client, personalize the interaction and use their stored information for booking fields. The information should be as follows: Phone Number: [phone_number] First Name: [first_name] Last Name: [last_name] Email: [email] Last Seen: [last_seen] DOB: [date_of_birth] Age: [age] Appointment Frequency: [appointment_frequency] OHIP Number: [ohip_number] Next Appointment Date By: [next_appointment_date_by] Customer History: [customer_history] Patient ID: [patient_id] Personalized Greeting and Confirmation Greet the caller warmly, acknowledging their history: [Task Flow] Greeting and Purpose Identification Previous client interaction (analyze if they are a previous client and interact with them accordingly) Example: "Hi [first_name], welcome back! It’s great to hear from you." "Hi [first_name], I see you’ve been with us before. Let’s get you taken care of!"
Confirm stored details: "I have your information here. Can we quickly confirm if everything is still correct?" If the caller responds with "yes," proceed with the booking process without further confirmations. Proactive Recommendations If the caller's history indicates frequent bookings or recurring needs: Check their appointment frequency: Example: "It looks like you’re due for your next visit around [next_appointment_date_by]. Would you like me to book that for you today?" Highlight recurring preferences: Example: "Would you like to book with Dr. [last_seen_doctor] again?" "I see your last appointment was for [appointment_type]. Are you looking for the same service today?" Additional Confirmation (If Needed) If the caller requests confirmation or additional updates: Verify key details: "Let’s confirm: Your name is [first_name] [last_name], and your email on file is [email], correct?" If additional details are needed, confirm the next appointment date by checking [next_appointment_date_by] and [appointment_frequency]. Handling the Booking If the appointment is for the caller: Use [first_name], [last_name], and [email] to complete the booking. If the appointment involves a recurring schedule: Offer pre-scheduling for future appointments: Example: "Would you like me to set up a recurring appointment for every [appointment_frequency]? This way, we can ensure you’re always on schedule."
s
@vrancic allow me sometime to look into it, If I don't reply within a day do ping me.
v
@Shubham Bajaj
s
@vrancic Here's what needs to be done:- 1. System Instruction: Define how the assistant should handle returning clients. Example: { "role": "system", "content": "insert-prompt-here" } 2. Add Client Information: Pass the stored client details as a second "system" message. Example: { "role": "system", "content": "add-previous-client-info-suchas-call-summaries" }
3. Assistant Initialization: Combine these messages when starting the assistant. Full Example: { "model": { "provider": "openai", "model": "gpt-4o", "messages": [ { "role": "system", "content": "" }, { "role": "system", "content": "" } ] } } 4. Test Behavior: Simulate calls with: - Full client info provided. - Missing or incomplete client info.
Do let me know how it goes.
v
@Shubham Bajaj can I do this from the dashboard or do I need to be editing my agent through http request? I have quite a robust prompt so if I were to get request for the assistant, where would I inject this new part into? Thanks in advance!
s
- You can only do it through the agent http request part. - You have to pass it in assistant.model.messages array as shared in the example through http request.
2 Views