# How to generate a response while considering past questions as well?

User: What is the tallest mountain?
Agent: Everest
User: Where is it located? # Agent hears: "Where is Everest located?"
Agent: Nepal


I want to be able to generate a sequence that has been generated using the user's current query as well as the past conversation.

More specifically, I am using Google's T5 for closed-book question answering, but, instead of trivial questions, we use the user's frequently asked queries.

I want to be able to encode their past questions and the agent's past answers, then use them to generate the agent's next answer. How can I do that?

• Hello. I edited your post. Please, make sure I didn't change its meaning. In particular, I added this part "we use the user's frequently asked queries.", because what you had originally written wasn't clear (at least to me).
– nbro
Sep 20 at 13:00