Does Gemini ChatSession remember anything at all?

I was excited to try out Gemini after experiencing long latency from OpenAI’s assistant/thread API.
Very fast, however, seems the ChatSession object doesn’t remember what we have chatted, even the sentence just asked. Is this known or just I did something wrong?

See this - seems like a joke

Note simple thing I did:

  1. just simple creating ChatSession by startChat api call, cache it for the conversation.
  2. every conversation message then use chat.sendMessage

For every chat, I tried to log the history from the chat session object, and found it’s always empty

chat.getHistory().then((history) => {
console.log(‘hisotry’, history);
});

Probably this is the reason? but why? the API doc says the ChatSession will record the conversations within the session. Is this a bug?

Turns out that I used a ChatSession cache that made a clone of the initial ChatSession object which doesn’t preserve the history. This is my fault.

Close it now. FYI. I was using NodeCache (node-cache - npm) in case others may encounter a similar issue.