Passing context between assistants in a squad
# support
v
Is it possible to create some values and save them in a context of one assistant and pass that context to another assistant in a squad. Specifically I would like to build an assistant which authenticates a user (using a tool) and pass the name and the authentication info to another assistant so that the 2nd assistant can help the user. Thank you
v
@VahidKowsari Yes, it is possible to create values and save them in the context of one assistant and then pass that context to another assistant in a squad. This is a common practice in multi-assistant systems where one assistant may handle authentication and then pass the authenticated user's information to another assistant for further processing or assistance. In the context of VAPI, you would typically handle this by creating a squad with multiple assistants. The first assistant would authenticate the user, save the necessary information (such as the user's name and authentication token) in its context, and then pass this context to the next assistant in the squad. The second assistant would then have access to the authentication information and could use it to assist the user accordingly. To implement this, you would need to ensure that the mechanism for context passing is supported by VAPI and that both assistants are designed to handle the context information appropriately. If you need more specific guidance on how to set this up or if you have any other questions, please feel free to ask!
You can continue this conversation by mentioning me in the message.
b
Not very helpful @Vapi whats the mechanism for context passing in vapi
v
@Bishop I apologize for any confusion. In VAPI, context passing between assistants typically involves using the server URL to communicate data. Here's a simplified mechanism for how you might achieve context passing: 1. **Authentication Assistant**: This assistant would authenticate the user and store the authentication information, such as the user's name and authentication token, in its context. 2. **Context Storage**: After authentication, the assistant would send a POST request to the server URL with the context information. The server would then store this context. 3. **Context Retrieval**: The second assistant would send a GET request to the server URL to retrieve the stored context before assisting the user. 4. **Continued Assistance**: With the context information retrieved, the second assistant can now provide personalized help based on the authenticated user's information. This process relies on the server's ability to handle HTTP GET and POST requests to store and retrieve context information. The specific implementation details, such as the format of the data and the endpoints used, would depend on your server's API. If you need to perform a specific action or have more questions about the VAPI context passing mechanism, please let me know, and I'll be glad to assist further!
v
Ok so the vapi/assistant is not really saving the context it is up to the backend server app to save the context. It would be nice to have a feature to pass these using dynamic variables.
s
@VahidKowsari as of now there is no feature to share/pass the context, but the messages are shared between all of the squad members. Depending upon your squad you can use rolling-history transferMode if assistants doesn't overlap with each other if by any chances members can overlap you can use swap-system-message mode.
Do let me know if you require further help.
v
Ah interesting. Thanks @Shubham Bajaj. Is that for transferring calls to a different number? Or is that for transferring between assistants in a squad? Thanks!
Nevermind I got it to work. Thanks!
s
Transfering b/w the squad members.
@VahidKowsari do you mind sharing your findings.
v
Initially I had tried asking for user name and pin number and verifying the user in one assistant and then transferring the user to another assistant and somehow it didnt remember my name in the second assistant...but somehow that seems to work now. If I ask the 2nd assistant now it knows the uers name and pin.
I also tried another way of doing it...by creating a tool that uses the call id and arbitrary parameter to save a context value...but I couldnt get that to work.
2 Views