Guiding a user to stay on topic

Hey there. I’m a bit new to Rasa and I’ve only done a few tutorials thus far. I’m curious to know if Rasa can fit my particular use case. What I wish to achieve is to add an additional functionality wherein the responses given are dynamically adjusted based on the input. For example: Assume my main domain or focus area is about spacecraft.

If the user inputs something that is exact to what I expect then I can simply return the most relevant response. But in a case where the user’s input is odd but does include a keyword that is relevant for a response, would it be possible for me to a confidence check to decide the type of response rather than what to respond?

Better example: Q - What is a Spacecraft ? A - (Return defined response)

Q - Do cars use liquid hydrogen as fuel? In this case it has some key words [liquid hydrogen, fuel] that could point it into a direction for a response. So a generated response could be “I’m not sure about [(entity) - cars], however I can say that Spacecraft use liquid hydrogen as their source of fuel”.

Q - Can you tell me about cars? In this case, I assume the generic response is something like “Sorry I can’t answer that”. What I’d like is for it to inside look at [tell me, about] and then infer that the user is trying to get information about something. Since cars is more or less unrelated to spaceships a response would be “I can’t do that but I can tell you about spaceships if you’d like” which redirects them back to the main focus area.

Essentially what I want to do is to have it continuously try to keep the user on topic by making suggestions about related things it knows and generating responses based on that. I know this might be a bit of an extreme case but any guidance or suggestions will be greatly appreciated. The intention is to utilize Rasa to be the base of the system then to add the additional functionality which generates the output on a case by case basis at times when it’s not 100% sure what the user wants. Of course this is if it doesn’t already exist in some manner.

The financial-demo shows one way to handle this. You’ll see in their stories how they ask the user if they want to switch forms in the event they’ve raised an off topic intent.