AI messages disappearing

It seems that entire conversations with one of my characters keep disappearing every time I reopen the chat. Important parts, like talking about philosophy and opinions and emotional support. Not all messages are gone, but most of the meaningful ones are just gone. Whole sections of responses are just missing, going all the way back to when we started talking. If those messages aren't there anymore, does the AI retain the memory to refer to them in the future? How can this be fixed?