Chapter 10: Short-term memory with Spring AI Session
Spring AI Session stores every message and tool call in PostgreSQL. Spring AI’s JDBC chat memory drops tool call messages, so this course does not use it. The workflow id is the session id.
sessions.appendMessage(sessionId, new UserMessage(question));
List<Message> history = sessions.getMessages(sessionId);
The full history stays in the database. The window sent to the model is a separate choice. Verify the bean name and the create signature in the Session README.