Adding auto config to Oracle Chat Memory LangChain4j#343
Open
psilberk wants to merge 4 commits into
Open
Conversation
graemerocher
requested changes
Jun 4, 2026
graemerocher
requested changes
Jun 5, 2026
There was a problem hiding this comment.
Pull request overview
This PR adds Micronaut auto-configuration for LangChain4j’s new Oracle-backed OracleChatMemoryStore, plus guide documentation showing how to enable and configure it.
Changes:
- Documented how to use the Oracle chat memory store in the Chat Memory guide.
- Added Oracle chat memory store configuration + factory beans in the
micronaut-langchain4j-store-oraclemodule. - Added a Micronaut test to validate Oracle chat memory store beans are created.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/docs/guide/chatModels/chatMemory.adoc |
Adds Oracle chat memory store dependency + configuration example. |
micronaut-langchain4j-store-oracle/src/main/java/io/micronaut/langchain4j/oracle/memory/package-info.java |
Introduces conditional package-level activation for Oracle chat memory beans. |
micronaut-langchain4j-store-oracle/src/main/java/io/micronaut/langchain4j/oracle/memory/OracleChatMemoryStoreFactory.java |
Creates OracleChatMemoryStore.Builder and OracleChatMemoryStore beans. |
micronaut-langchain4j-store-oracle/src/main/java/io/micronaut/langchain4j/oracle/memory/OracleChatMemoryStoreConfiguration.java |
Defines configuration contract/prefix for Oracle chat memory store. |
micronaut-langchain4j-store-oracle/src/main/java/io/micronaut/langchain4j/oracle/memory/OracleChatMemoryStoreConfigurationProperties.java |
Implements configuration binding (currently via @EachProperty). |
micronaut-langchain4j-store-oracle/src/test/java/io/micronaut/langchain4j/oracle/memory/OracleChatMemoryStoreConfigurationTest.java |
Validates config + store beans can be injected. |
Comment on lines
+25
to
+32
| Then configure a JDBC datasource and the chat memory store properties, for example: | ||
|
|
||
| [configuration] | ||
| ---- | ||
| datasources.default.dialect: oracle | ||
| langchain4j.chat-memory-store.oracle.enabled: true | ||
| langchain4j.chat-memory-store.oracle.table-name: CHAT_MEMORY | ||
| ---- |
Comment on lines
+19
to
+29
| @Configuration | ||
| @Requires(property = OracleChatMemoryStoreConfiguration.PREFIX) | ||
| @Requires(classes = OracleChatMemoryStore.class) | ||
| @Requires(beans = DataSource.class) | ||
| package io.micronaut.langchain4j.oracle.memory; | ||
|
|
||
| import dev.langchain4j.store.memory.chat.oracle.OracleChatMemoryStore; | ||
| import io.micronaut.context.annotation.Configuration; | ||
| import io.micronaut.context.annotation.Requires; | ||
|
|
||
| import javax.sql.DataSource; |
Comment on lines
+28
to
+37
| @Prototype | ||
| @EachBean(OracleChatMemoryStoreConfigurationProperties.class) | ||
| OracleChatMemoryStore.Builder createOracleChatMemoryStoreBuilder(OracleChatMemoryStoreConfiguration config) { | ||
| return config.getBuilder(); | ||
| } | ||
|
|
||
| @Singleton | ||
| @EachBean(OracleChatMemoryStore.Builder.class) | ||
| OracleChatMemoryStore createOracleChatMemoryStore(OracleChatMemoryStore.Builder builder) { | ||
| return builder.build(); |
Collaborator
|
please sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR depends on langchain4j/langchain4j#5351 which adds Oracle Chat Memory to LangChain4j (we added the Oracle Embedding Store). Creating this draft PR to get feedback.