2415 chat-memory-builtin - Introduce built-in chat memory component with JDBC and Redis-based repositories#4470
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new built-in chat memory component (chat-memory-builtin) for AI agents, backed by either JDBC or Redis storage. Unlike the existing chat-memory-in-memory component, this one persists conversation history using the application's own database or a Redis instance, making it suitable for production deployments where chat history must survive restarts.
Changes:
- New
chat-memory-builtinmodule with CRUD actions (addMessages,getMessages,deleteConversation,listConversations) and a cluster element for use with AI agents. - New JDBC and Redis
ChatMemoryRepositorySpring configuration classes, with a custom TTL parser and optional schema initialization, conditionally activated viabytechef.ai.agent.memory.provider. - Extended
ApplicationPropertieswith a newAi.Agent.Memoryconfiguration block, and added default YAML configuration inapplication-bytechef.yml.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
settings.gradle.kts |
Registers the new chat-memory-builtin module in the Gradle multi-project build |
build.gradle.kts (module) |
Dependencies for JDBC/Redis repositories, Spring Boot autoconfigure, and app-config |
ChatMemoryComponentHandler.java |
Main component handler wiring the repository into all actions via static setters |
ChatMemoryAddMessagesAction.java |
Action to add messages to a conversation (fetch-modify-save) |
ChatMemoryGetMessagesAction.java |
Action to retrieve all messages for a conversation |
ChatMemoryDeleteAction.java |
Action to delete all messages for a conversation |
ChatMemoryListConversationsAction.java |
Action to list all conversation IDs |
ChatMemory.java |
Cluster element definition providing PromptChatMemoryAdvisor for AI agent use |
ChatMemoryConstants.java |
Shared string constants for property keys |
JdbcChatMemoryConfiguration.java |
Spring configuration bean for JDBC-backed repository with schema initialization |
RedisChatMemoryConfiguration.java |
Spring configuration bean for Redis-backed repository with TTL parsing |
ChatMemoryConfiguration.java |
Top-level configuration that imports JDBC/Redis configs conditionally |
ApplicationProperties.java |
Adds Ai.Agent.Memory config block with JDBC and Redis sub-configs |
application-bytechef.yml |
Adds default YAML configuration for the memory provider |
chat-memory_v1.json |
JSON snapshot for component definition test assertion |
ChatMemoryComponentHandlerTest.java |
Test asserting the component definition matches the JSON snapshot |
chat-memory.svg |
Icon asset for the new component |
worker-app/build.gradle.kts |
Excludes chat-memory-builtin from the worker app's auto-included components |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c15fd21 to
b4ea9c7
Compare
|
we can't connect to bytechef's redis because it doesn't have Redis Search functionality. We have to migrate to a docker image that has it like https://hub.docker.com/r/redis/redis-stack-server |
…ith JDBC and Redis-based repositories Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add output schema to AddMessages action (conversationId + messageCount) - Refactor static mutable fields to factory method pattern (of() methods) - Remove Redis dependency version pin (use BOM-managed version) - Remove stale chat-memory exclusions from worker-app build - Extract JedisPooled as separate bean with destroyMethod for proper cleanup - Wire indexName and initializeSchema into RedisChatMemoryRepository builder - Use instanceof for JDBC dialect detection instead of fragile string matching - Check conversation existence before returning deleted status Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… classes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|



Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com