Skip to content

Adding auto config to Oracle Chat Memory LangChain4j#343

Open
psilberk wants to merge 4 commits into
micronaut-projects:2.1.xfrom
psilberk:2.1.x
Open

Adding auto config to Oracle Chat Memory LangChain4j#343
psilberk wants to merge 4 commits into
micronaut-projects:2.1.xfrom
psilberk:2.1.x

Conversation

@psilberk

@psilberk psilberk commented Jun 4, 2026

Copy link
Copy Markdown

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.

@cla-assistant

cla-assistant Bot commented Jun 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@psilberk psilberk requested a review from graemerocher June 4, 2026 23:36
Comment thread src/main/docs/guide/chatModels/chatMemory.adoc Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 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-oracle module.
  • 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();
@psilberk psilberk marked this pull request as ready for review June 6, 2026 02:03
@psilberk psilberk requested a review from graemerocher June 6, 2026 02:03
@graemerocher

Copy link
Copy Markdown
Collaborator

please sign the CLA

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