Agent Memory
# support
b
Here is my prompt. An issue I'm having is that the agent asks the zip code question even when it has already done that. I have specifically put instruction and conversations guidelines in place but the agent still messes up. The agent is not consistent, sometimes my proimpt will work and other times not. Is there a better way to add in memory for an agent other than prompting it in?
Here is my prompt. An issue I'm having is that the agent asks the zip code question even when it has already done that. I have specifically put instruction and conversations guidelines in place but the agent still messes up. The agent is not consistent, sometimes my proimpt will work and other times not. Is there a better way to add in memory for an agent other than prompting it in? @Vapi https://cdn.discordapp.com/attachments/1314270679998267392/1314270841382371408/message.txt?ex=6753299a&is=6751d81a&hm=922fcd51fedffa0e454ae948ac2bbf9918f520d9d1d427b82e423da24beee9b7&
Here is my prompt. An issue I'm having is that the agent asks the zip code question even when it has already done that. I have specifically put instruction and conversations guidelines in place but the agent still messes up. The agent is not consistent, sometimes my proimpt will work and other times not. Is there a better way to add in memory for an agent other than prompting it in? @Vapi https://cdn.discordapp.com/attachments/1314270679998267392/1314271182782070784/message.txt?ex=675329eb&is=6751d86b&hm=eed3546bc7864c5da1937fe9c9bba6989db50ded4e96cb08625d7d767eda436f&
v
@brandon holley I understand the frustration that can come with an agent not consistently remembering context, such as a zip code that has already been provided. While prompt engineering is a common method to manage an agent's memory, there are other strategies you can employ to improve consistency. One approach is to use a more advanced state management system, where the context of the conversation is stored and managed outside of the agent's immediate responses. This can be done through databases or context objects that are updated with each interaction and passed to the agent for reference. Another method is to implement machine learning models that are specifically trained to handle context and maintain conversation state. These models can be more adept at recognizing when certain information has already been provided and adjust their responses accordingly. Additionally, you can explore using session-based identifiers that track the conversation and help the agent recall previous exchanges within the same session. If you're working with a specific platform or API, they may have built-in features or recommended practices for handling context and memory in conversations. It would be beneficial to consult their documentation or reach out to their support team for more tailored advice. If you need further assistance with implementing these strategies or have other questions, please let me know!
@brandon holley I understand that maintaining context and memory in a conversation can be challenging. While prompt engineering is one way to provide context to an agent, there are other methods you can use to improve consistency and memory retention. One approach is to implement state management within your application. This involves keeping track of the conversation state and user data across turns. By doing so, you can check if certain information, like a zip code, has already been provided and avoid asking for it again. Another method is to use machine learning models that are designed to handle longer contexts or that can be fine-tuned on your specific dialogues to better understand the flow of your conversations. If you're using an API or a platform, they might offer built-in context management features that you can leverage. For example, some platforms allow you to set session variables or context objects that persist throughout a session. If you're still facing issues, it might be helpful to review the conversation logs to identify patterns when the agent fails to remember information. This can help you refine your prompts or your state management logic. If you need more specific advice or technical assistance, please provide additional details about the technology you're using, and I'll do my best to assist you further.
You can continue this conversation by mentioning me in the message.
b
1. Are yopu companies you reccommend? 2. Machine learning models? 3. session based identtifiers? @Vapi
v
@brandon holley 1. Companies for Context Management and Machine Learning Models: - For context management and machine learning models, companies like Google (Dialogflow), Amazon (Lex), Microsoft (Azure Bot Service), IBM (Watson Assistant), and Rasa are well-known for providing robust platforms that support advanced conversation handling and machine learning capabilities. 2. Machine Learning Models: - Machine learning models that are particularly good at handling context in conversations include sequence-to-sequence models, transformer models (like BERT and GPT), and RNNs (Recurrent Neural Networks). These models can be trained on your specific dataset to improve their ability to maintain context. 3. Session-Based Identifiers: - Session-based identifiers are unique tokens or IDs assigned to each user session. They help track the state of the conversation and ensure continuity. Most conversational AI platforms provide a way to use session IDs to maintain context throughout an interaction. If you're considering implementing any of these solutions and need more detailed guidance or recommendations, please let me know, and I can provide further assistance.
b
tell me more about this "One approach is to use a more advanced state management system, where the context of the conversation is stored and managed outside of the agent's immediate responses. This can be done through databases or context objects that are updated with each interaction and passed to the agent for reference."
tell me more about this "One approach is to use a more advanced state management system, where the context of the conversation is stored and managed outside of the agent's immediate responses. This can be done through databases or context objects that are updated with each interaction and passed to the agent for reference." @Vapi
tell me more about this "One approach is to use a more advanced state management system, where the context of the conversation is stored and managed outside of the agent's immediate responses. This can be done through databases or context objects that are updated with each interaction and passed to the agent for reference." @Vapi
Can you tell me more about databases or context objects that are updated with each interaction? @Vapi
s
Hey @brandon holley 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!
b
67a018ed-9458-402a-a9db-9e16035d2662 Dec 7, 2024, 12:57 PM Continuation of the booking process. Agent said "we do service your zip code" Agent then said "unfortunately we don't service your zip code". I've tried roughly 9 different prompts. The current promotion is very well done, specific, and to the point(not too long). Despite this I'm constantly getting hallucinations like the this call above. This has unfortunately been a very frustrating process. I've studied the Vapi documentation up and down, plenty of online resources, etc to build the best type of prompt/KB. I really need some help with this. Thanks @Shubham Bajaj
p
@brandon holley Checked out your prompt structure, it could sometimes look very convincing to the bot, Trying looking for a cleaner way of structuring your prompt And as for the KB, best kb structure tat forms for me is the Table pdf kb format set up your knowledge base with a table having two colunms for question and answers, And convert th document to a pdf, upload it to vapi kb
b
@Philip_E Helpful, will try this out and post back. Thanks!
p
Cool cool
b
@Philip_E By making the prompt more “clear” do you have any advice on that? Because it seems just about as clear as I can possibly get it, but maybe I’m missing something.
here u go
b
Thanks wi try this out
Is there vapi documentation that shows the table format you mentioned for the KB? I did see this docs.vapi.ai/knowledgebase but it didn't provide an example
828a57f2-8a15-4f3e-9f7e-99fcd281db72 I did as suggested changing the KB to PDF. I also separated pricing vs general info. Though, the voice agent still can't even recognize whether or not a zip code is serviceable. I attached the call id above. I also used markdown for the KB's to help the agent navigate but it did not help. https://cdn.discordapp.com/attachments/1314270679998267392/1315454494271602738/Vent_Busting_Knowledge_Base_12-8-2024_General_Info.pdf?ex=675777f7&is=67562677&hm=d93a00696c6400a7a246a21528edbad0f5a5ead0d250b6eaa946a5d676ecd383& https://cdn.discordapp.com/attachments/1314270679998267392/1315454494842159236/Vent_Busting_Knowledge_Base_12-8-2024_Pricing.pdf?ex=675777f7&is=67562677&hm=bdbfd60a62192974a94a2f9a2febe5c1b6ed58804de16b657ea22fae87d4ba54&
@Philip_E
@Shubham Bajaj
@User
I simplfied the knowledge base to the below but the agent still cannot reconize if a zip code is or is not serviceable ## Pricing and Service Areas ### Serviceable Zip Codes **All Serviceable Zip Codes**: 27401, 27403, 27406, 27235, 27407, 27409, 27405, 27214, 27301, 27455, 27410, 27408, 27284, 27215, 27217, 27377, 27244, 27249, 27358, 27310, 27357, 27048, 27288, 27320, 27025, 27027, 27265, 27282, 27262, 27260, 27263, 27051, 27109, 27052, 27105, 27101, 27107, 27103, 27104, 27040, 27012 ### Pricing - **Standard Pricing**: Applies to most zip codes. - **Extended Pricing**: A $50 surcharge applies to the following zip codes: 27051, 27109, 27052, 27105, 27101, 27107, 27103, 27104, 27040, 27012. #### Dryer Vent Cleaning - **Standard Pricing**: - Basement: $249 - First Floor: $249 - Second Floor: $299 - Third Floor: $299 - **Extended Pricing (Surcharge)**: - Basement: $299 - First Floor: $299 - Second Floor: $349 - Third Floor: $349 #### Dryer Vent Repair/Replacement - **Standard Pricing**: - 1 vent: $229 - 2 vents: $229 - 3 vents: $329 - 4 vents: $329 - 5+ vents: $429 - **Extended Pricing (Surcharge)**: - 1 vent: $279 - 2 vents: $279 - 3 vents: $379 - 4 vents: $379 - 5+ vents: $479 --- ### Fallback for Unlisted Zip Codes > "Unfortunately, we do not service your zip code. Would you like me to note your details in case we expand to your area?" > > @User
s
@brandon holley looking into it.
@brandon holley I just checked your using old knowledge base provider
Canonical
which has stopped their services, can you try new KB provider
trieve
. Which you can learn more from here https://docs.vapi.ai/knowledgebase Do let me know if you require further help!!
b
I am simply uploading the KB to vapi. I am not using any json construct.
I used these steps Navigate to Platform > Files and upload your custom files in Markdown, PDF, plain text, or Microsoft Word (.doc and .docx) format to Vapi’s Knowledge Base.
I don't know how to "format to Vapi's knowledge base" though
@Shubham Bajaj
@User not to be a pest just trying to get to the bottom of the issue
s
@brandon holley did you read the documentation shared?