PirateKittenP
Voiceflow Partnersโ€ข6mo agoโ€ข
5 replies
PirateKitten

How do I stop an agent responding to the last message incorrectly when I route back to them?

I'm trying to create a multi-agent setup. My first agent, which is used at start of chat, can answer KB questions and also perform a property search for the user based on asking them location questions. If a search is performed, I have the agent exit and pass to a flow that uses custom message steps to render the property information exactly how we want. At the end of these I want to pass back to the original agent so it can pick up the conversation again.

However, every time it goes back to the original agent, that agent decides it needs to perform a search for that particular property either using the API or the KB and tries to give information on that, which it can't do. It shouldn't be doing this as that has already been done in the conversation by my custom steps. How do I handle this? It should effectively be coming back to the original agent "fresh", where it can just ask if there's anything else it can do. Do I need to manually clear out some variables that it might be picking up?

This is effectively what happens (a little simplified but demos the issue):

General / Search Agent: Hello! I'm able to answer your general queries and look up properties based on your location. How can I help?
User: Can you find me properties in [location]?
General / Search Agent: Sure! Let me look for you
[General / Search Agent uses API tool and exits via Found Property path]
Custom Message: We've found this for you. This property X at Y, here are some further details....
[Routes now back to General / Search Agent as part of flow]
General / Search Agent: I can't find any specific details about X, but I can answer your general queries and look up properties based on your location. How can I help?
Was this page helpful?