chat memory timestamp override #4630
Closed
wonderful-coding-life
started this conversation in
General
Replies: 1 comment
-
wrong place |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I configured my application to use ChatMemoryRepositoryJdbc with MySQL.
I noticed that the timestamp field in the SPRING_AI_CHAT_MEMORY table is always overwritten with the latest timestamp.
Here’s the controller code.
When I chat up to the maximum window size, everything works fine.
However, once it exceeds the maximum window size, it seems to delete old messages to maintain the window size — but the messages retrieved by chatMemory.get(conversation_id) appear to be out of chronological order.
Here are the results of
SELECT * FROM SPRING_AI_CHAT_MEMORY sacm ORDER BY timestamp ASC;
All the timestamps are identical.
Every time I chat with the ChatModel, the timestamps of all messages are overwritten with the latest one.
Is this a bug, or did I misconfigure something?
CHAT-001 서울 올림픽은 몇회 올림픽이야? USER 2025-10-15 12:58:20
CHAT-001 서울 올림픽은 제24회 하계 올림픽입니다. 1988년에 개최되었습니다. ASSISTANT 2025-10-15 12:58:20
CHAT-001 몇개국이나 참가했지? USER 2025-10-15 12:58:20
CHAT-001 1988년 서울 올림픽에는 총 159개국이 참가했습니다. 이 대회는 올림픽 역사상 많은 나라가 참여한 대회 중 하나로 기록됩니다. ASSISTANT 2025-10-15 12:58:20
CHAT-001 그 다음 올림픽은 어디서 개최되었어? USER 2025-10-15 12:58:20
CHAT-001 그 다음 올림픽인 1992년 하계 올림픽은 스페인 바르셀로나에서 개최되었습니다. ASSISTANT 2025-10-15 12:58:20
CHAT-001 몇개국이나 참가했지? USER 2025-10-15 12:58:20
CHAT-001 1992년 바르셀로나 올림픽에는 총 169개국이 참가했습니다. 이 대회는 올림픽 역사상 중요한 이정표로 여겨지며, 다양한 스포츠와 문화적 교류가 이루어졌습니다. ASSISTANT 2025-10-15 12:58:20
Beta Was this translation helpful? Give feedback.
All reactions