Recently, i've faced an issue where the list of messages that were pased to the AI model consists of only assistant messages + the last message from a user. Thus, AI looses the context as there are no previous user-related messages in the conversation history.
I am using the upstash storage (all user messages successfully stored to the database - I've verified that).
I've attached screenshots from langfuse: the first one is the current state where only the last question is related to the user. On. the second screenshot is the expected history, which includes user-related messages.