Skip to content

2415 chat-memory-builtin - Introduce built-in chat memory component with JDBC and Redis-based repositories#4470

Merged
ivicac merged 4 commits intomasterfrom
2415_4
Mar 25, 2026
Merged

2415 chat-memory-builtin - Introduce built-in chat memory component with JDBC and Redis-based repositories#4470
ivicac merged 4 commits intomasterfrom
2415_4

Conversation

@ivicac
Copy link
Copy Markdown
Contributor

@ivicac ivicac commented Mar 9, 2026

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-builtin module with CRUD actions (addMessages, getMessages, deleteConversation, listConversations) and a cluster element for use with AI agents.
  • New JDBC and Redis ChatMemoryRepository Spring configuration classes, with a custom TTL parser and optional schema initialization, conditionally activated via bytechef.ai.agent.memory.provider.
  • Extended ApplicationProperties with a new Ai.Agent.Memory configuration block, and added default YAML configuration in application-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.

Comment thread server/ee/apps/worker-app/build.gradle.kts Outdated
@blacksmith-sh

This comment has been minimized.

@blacksmith-sh

This comment has been minimized.

@ivicac ivicac force-pushed the 2415_4 branch 2 times, most recently from c15fd21 to b4ea9c7 Compare March 17, 2026 05:05
@marko-kriskovic
Copy link
Copy Markdown
Collaborator

marko-kriskovic commented Mar 20, 2026

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

ivicac and others added 3 commits March 23, 2026 20:46
…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>
@sonarqubecloud
Copy link
Copy Markdown

@ivicac ivicac merged commit 9d8ad34 into master Mar 25, 2026
7 checks passed
@ivicac ivicac deleted the 2415_4 branch March 25, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants