You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adapt chat memory to Spring AI 1.1.6 mandatory conversationId
Spring AI 1.1.6 removed default conversationId from memory advisors.
Move memory advisor from default ChatClient advisors to per-request,
activated only when CamelSpringAiChatConversationId header is set.
Copy file name to clipboardExpand all lines: components/camel-spring-parent/camel-spring-ai/camel-spring-ai-chat/src/main/docs/spring-ai-chat-component.adoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -293,6 +293,8 @@ The component provides automatic conversation memory management via Spring AI's
293
293
294
294
IMPORTANT: Do not configure both `chatMemory` and `chatMemoryVectorStore` on the same endpoint. If both are provided, `chatMemory` (MessageChatMemoryAdvisor) will take precedence.
295
295
296
+
NOTE: Chat memory is only activated when the `CamelSpringAiChatConversationId` header is set on the exchange. Without this header, the memory advisor is not applied, even if `chatMemory` or `chatMemoryVectorStore` is configured. This allows you to selectively enable memory on a per-request basis.
297
+
296
298
==== Message-based Memory (ChatMemory)
297
299
298
300
Configure a `ChatMemory` on the endpoint for automatic conversation tracking using traditional message window approach. This strategy keeps a configurable number of recent messages in memory.
Copy file name to clipboardExpand all lines: components/camel-spring-parent/camel-spring-ai/camel-spring-ai-chat/src/main/java/org/apache/camel/component/springai/chat/SpringAiChatProducer.java
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,7 @@ public class SpringAiChatProducer extends DefaultProducer {
Copy file name to clipboardExpand all lines: components/camel-spring-parent/camel-spring-ai/camel-spring-ai-chat/src/test/java/org/apache/camel/component/springai/chat/SpringAiChatMemoryIT.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ public void testAutomaticChatMemoryWithChatClient() {
165
165
// First message
166
166
varexchange1 = template().request("direct:chat-with-auto-memory", e -> {
167
167
e.getIn().setBody("My favorite number is 42. Please remember this.");
0 commit comments