Storing user behaviour, info, chat history and previous dialogues for a chatbot

Hi all,
I’m trying to build a tutor chatbot, much like Khan Academy’s Khanmigo. I’m planning to use GPT4 API, currently 3.5. Currently figuring out how do I store user info and previous history to give enough context to the GPT API. I don’t want to send all the chat history in the request, because of the token limit of course. Is there a way I can achieve infinite context memory here. I’ve heard about Vector Databases. Is that gonna solve my problem? How?