The chat history is not working when server restarts

I’ve created a code to stream to stream latest api. But there is an issue the code is working perfectly since the server start and the chat in that duration starts. its remembering the all things with chat history.

But when i restart the server the thing is the model cant access or memorize the previous created chats. is there anyone knows the issue for that