Is there an option to reconnect to previous chat?
# support
b
I am implementing a web only assistant. I have added client using VAPI webclient API. The web application is developed using ASP.Net webforms so in few scenario, when the user navigates to a different page, the whole browser reloads. I want to be able to reconnect to the previous conversation/call when user switches between browser without loosing the context of the ongoing call in between navigations. Is there a way to achieve this?
v
Hi there! 👋 I understand you're looking for a way to reconnect to previous chat sessions when users navigate between pages in your ASP.Net webforms application using the VAPI webclient API. While I don't have specific code examples for ASP.Net webforms, I can share several approaches that might help you achieve this. Here are some options you could explore: ### 1. Use Persistent Assistants According to the [Vapi Dashboard documentation](https://docs.vapi.ai/quickstart/web), you can create persistent assistants that can be reused across multiple calls. This might help maintain context across browser reloads. ### 2. Utilize the Control URL for Message Injection When creating a room (web or phone), you can request a control URL which can be used to inject messages (system/user) into the conversation. This could potentially help restore context after a page reload by injecting previous conversation data. ### 3. Implement Context Management and State Tracking You could maintain a running list of collected information and, upon page navigation, store the current progress. After navigation completes, you can explicitly return to where you left off by saving the current state, handling the interruption, and returning to the last incomplete field. ### 4. Configure Server URL Properly Ensure your Server URL is correctly configured to receive real-time conversation data. Vapi uses Server URLs to send status updates, transcript updates, function calls, and other conversation data that could be essential for maintaining context. ### 5. Manage Assistant Lifecycle You can use
window.vapiSDK?.terminate()
to remove the assistant when needed and
window.vapiSDK?.run()
with updated
variableValues
to pass more data to the assistant when reconnecting. ### 6. Store and Retrieve Call History
Consider retrieving the previous call history from your database, formatting it in a way that's comprehensible to the AI, and including this context in your API calls to maintain continuity. Is there a specific approach from these options that you'd like to explore further? Or do you have any other questions about implementing these solutions? Sources: - [Vapi Dashboard documentation](https://docs.vapi.ai/quickstart/web) - [Discord thread on control URL](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339634926248525935) - [Discord thread on context management](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1344181455567196170) - [Discord thread on assistant lifecycle](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333973419485823037) - [Vapi Server URL documentation](https://docs.vapi.ai/server-url) - [Discord thread on call history](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334393915071135825)
b
i want to get more information about 2. Utilize the Control URL for Message Injection
p
You can save convo in your database, then start new convo with whole context and messages of previous call. I believe thats only possible with custom llm
a
Thank you for reaching out to us. We've received your message and will get back to you as soon as possible.
Hi, checking if this is resolved/solved for you?