Rasa to remember last 2 message user asked

Hi all,

I am building a bot which answers queries related to subject.

scenario :

User : asked a question

Bot : replied some answer

Bot : did that helped you? buttons (yes/no)

User : selects no button

when no button is clicked its runs custom action. and search that query on google.

so in order to do this, in actions I wrote

text = tracker.latest_message[‘text’]

bot fetched ‘No’ as text . but I want the bot to fetch, users question before he said "No" so that I can search that question on google.

any suggestions/help are highly appreciated!

can you mention this scenario whilst adding to original scenario?

@nik202 ,let me show you example

In below image, user asked Question “what is break in for loop”

bot replied with some answer and at end it has asked “did that help you?”

image

below is the action file code image

in actions it fetched the latest reply as “No (/deny)”

I want bot to fetched previous question “what is break in for loop”