Skip to content

Commit 43df859

Browse files
committed
Migrate Couchbase vector store auto-configuration to dedicated module
- Update dependencies and module names in maven pom.xml files affecting couchbase vector store support - Rename artifact from spring-ai-couchbase-store-spring-boot-starter to spring-ai-starter-vector-store-couchbase - Update imports and related cleanup - Update corresponding documentation references Signed-off-by: Soby Chacko <[email protected]>
1 parent e1e75d7 commit 43df859

File tree

9 files changed

+156
-21
lines changed

9 files changed

+156
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2023-2025 the original author or authors.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
18+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xmlns="http://maven.apache.org/POM/4.0.0"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.springframework.ai</groupId>
24+
<artifactId>spring-ai</artifactId>
25+
<version>1.0.0-SNAPSHOT</version>
26+
<relativePath>../../../pom.xml</relativePath>
27+
</parent>
28+
<artifactId>spring-ai-autoconfigure-vector-store-couchbase</artifactId>
29+
<packaging>jar</packaging>
30+
<name>Spring AI Auto Configuration for Couchbase vector store</name>
31+
<description>Spring AI Auto Configuration for Couchbase vector store</description>
32+
<url>https://github.com/spring-projects/spring-ai</url>
33+
34+
<scm>
35+
<url>https://github.com/spring-projects/spring-ai</url>
36+
<connection>git://github.com/spring-projects/spring-ai.git</connection>
37+
<developerConnection>[email protected]:spring-projects/spring-ai.git</developerConnection>
38+
</scm>
39+
40+
<dependencies>
41+
<!-- production dependencies -->
42+
<dependency>
43+
<groupId>org.springframework.ai</groupId>
44+
<artifactId>spring-ai-couchbase-store</artifactId>
45+
<version>${project.parent.version}</version>
46+
<optional>true</optional>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter</artifactId>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.springframework.boot</groupId>
54+
<artifactId>spring-boot-configuration-processor</artifactId>
55+
<optional>true</optional>
56+
</dependency>
57+
<!-- test dependencies -->
58+
<dependency>
59+
<groupId>org.springframework.ai</groupId>
60+
<artifactId>spring-ai-test</artifactId>
61+
<version>${project.parent.version}</version>
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.springframework.boot</groupId>
66+
<artifactId>spring-boot-starter-test</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.springframework.boot</groupId>
71+
<artifactId>spring-boot-testcontainers</artifactId>
72+
<scope>test</scope>
73+
</dependency>
74+
<dependency>
75+
<groupId>org.testcontainers</groupId>
76+
<artifactId>testcontainers</artifactId>
77+
<scope>test</scope>
78+
</dependency>
79+
<dependency>
80+
<groupId>org.testcontainers</groupId>
81+
<artifactId>junit-jupiter</artifactId>
82+
<scope>test</scope>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.awaitility</groupId>
86+
<artifactId>awaitility</artifactId>
87+
<scope>test</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>org.testcontainers</groupId>
91+
<artifactId>couchbase</artifactId>
92+
<scope>test</scope>
93+
</dependency>
94+
<dependency>
95+
<groupId>org.springframework.ai</groupId>
96+
<artifactId>spring-ai-transformers</artifactId>
97+
<version>${project.parent.version}</version>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.springframework.ai</groupId>
102+
<artifactId>spring-ai-autoconfigure-retry</artifactId>
103+
<version>${project.parent.version}</version>
104+
<scope>test</scope>
105+
</dependency>
106+
<dependency>
107+
<groupId>org.springframework.ai</groupId>
108+
<artifactId>spring-ai-autoconfigure-model-openai</artifactId>
109+
<version>${project.parent.version}</version>
110+
<scope>test</scope>
111+
</dependency>
112+
</dependencies>
113+
</project>

spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/vectorstore/couchbase/CouchbaseSearchVectorStoreAutoConfiguration.java auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase/src/main/java/org/springframework/ai/vectorstore/couchbase/autoconfigure/CouchbaseSearchVectorStoreAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 - 2024 the original author or authors.
2+
* Copyright 2023 - 2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.ai.autoconfigure.vectorstore.couchbase;
16+
package org.springframework.ai.vectorstore.couchbase.autoconfigure;
1717

1818
import com.couchbase.client.java.Cluster;
1919
import org.springframework.ai.embedding.EmbeddingModel;

spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/vectorstore/couchbase/CouchbaseSearchVectorStoreProperties.java auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase/src/main/java/org/springframework/ai/vectorstore/couchbase/autoconfigure/CouchbaseSearchVectorStoreProperties.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 - 2024 the original author or authors.
2+
* Copyright 2023 - 2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,11 +13,11 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.ai.autoconfigure.vectorstore.couchbase;
16+
package org.springframework.ai.vectorstore.couchbase.autoconfigure;
1717

18-
import org.springframework.ai.autoconfigure.vectorstore.CommonVectorStoreProperties;
1918
import org.springframework.ai.vectorstore.CouchbaseIndexOptimization;
2019
import org.springframework.ai.vectorstore.CouchbaseSimilarityFunction;
20+
import org.springframework.ai.vectorstore.properties.CommonVectorStoreProperties;
2121
import org.springframework.boot.context.properties.ConfigurationProperties;
2222

2323
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright 2025-2025 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
org.springframework.ai.vectorstore.couchbase.autoconfigure.CouchbaseSearchVectorStoreAutoConfiguration

spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/couchbase/CouchbaseContainerMetadata.java auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase/src/test/java/org/springframework/ai/vectorstore/couchbase/autoconfigure/CouchbaseContainerMetadata.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 - 2024 the original author or authors.
2+
* Copyright 2023 - 2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.ai.autoconfigure.vectorstore.couchbase;
16+
package org.springframework.ai.vectorstore.couchbase.autoconfigure;
1717

1818
import org.testcontainers.couchbase.BucketDefinition;
1919
import org.testcontainers.utility.DockerImageName;

spring-ai-spring-boot-autoconfigure/src/test/java/org/springframework/ai/autoconfigure/vectorstore/couchbase/CouchbaseSearchVectorStoreAutoConfigurationIT.java auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase/src/test/java/org/springframework/ai/vectorstore/couchbase/autoconfigure/CouchbaseSearchVectorStoreAutoConfigurationIT.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 - 2024 the original author or authors.
2+
* Copyright 2023 - 2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,13 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.ai.autoconfigure.vectorstore.couchbase;
16+
package org.springframework.ai.vectorstore.couchbase.autoconfigure;
1717

1818
import org.junit.jupiter.api.Test;
1919
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
20-
import org.springframework.ai.autoconfigure.openai.OpenAiAutoConfiguration;
21-
import org.springframework.ai.autoconfigure.retry.SpringAiRetryAutoConfiguration;
2220
import org.springframework.ai.document.Document;
21+
import org.springframework.ai.model.openai.autoconfigure.OpenAiEmbeddingAutoConfiguration;
22+
import org.springframework.ai.retry.autoconfigure.SpringAiRetryAutoConfiguration;
2323
import org.springframework.ai.vectorstore.CouchbaseIndexOptimization;
2424
import org.springframework.ai.vectorstore.CouchbaseSimilarityFunction;
2525
import org.springframework.ai.vectorstore.SearchRequest;
@@ -39,7 +39,10 @@
3939
import java.util.Map;
4040

4141
import static org.assertj.core.api.Assertions.assertThat;
42-
import static org.springframework.ai.autoconfigure.vectorstore.couchbase.CouchbaseContainerMetadata.*;
42+
import static org.springframework.ai.vectorstore.couchbase.autoconfigure.CouchbaseContainerMetadata.COUCHBASE_IMAGE_ENTERPRISE;
43+
import static org.springframework.ai.vectorstore.couchbase.autoconfigure.CouchbaseContainerMetadata.PASSWORD;
44+
import static org.springframework.ai.vectorstore.couchbase.autoconfigure.CouchbaseContainerMetadata.USERNAME;
45+
import static org.springframework.ai.vectorstore.couchbase.autoconfigure.CouchbaseContainerMetadata.bucketDefinition;
4346

4447
/**
4548
* @author Laurent Doguin
@@ -63,7 +66,7 @@ class CouchbaseSearchVectorStoreAutoConfigurationIT {
6366
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
6467
.withConfiguration(AutoConfigurations.of(CouchbaseAutoConfiguration.class,
6568
CouchbaseSearchVectorStoreAutoConfiguration.class, RestClientAutoConfiguration.class,
66-
SpringAiRetryAutoConfiguration.class, OpenAiAutoConfiguration.class))
69+
SpringAiRetryAutoConfiguration.class, OpenAiEmbeddingAutoConfiguration.class))
6770
.withPropertyValues("spring.couchbase.connection-string=" + couchbaseContainer.getConnectionString(),
6871
"spring.couchbase.username=" + couchbaseContainer.getUsername(),
6972
"spring.couchbase.password=" + couchbaseContainer.getPassword(),
@@ -112,7 +115,7 @@ public void propertiesTest() {
112115
new ApplicationContextRunner()
113116
.withConfiguration(AutoConfigurations.of(CouchbaseAutoConfiguration.class,
114117
CouchbaseSearchVectorStoreAutoConfiguration.class, RestClientAutoConfiguration.class,
115-
SpringAiRetryAutoConfiguration.class, OpenAiAutoConfiguration.class))
118+
SpringAiRetryAutoConfiguration.class, OpenAiEmbeddingAutoConfiguration.class))
116119
.withPropertyValues("spring.couchbase.connection-string=" + couchbaseContainer.getConnectionString(),
117120
"spring.couchbase.username=" + couchbaseContainer.getUsername(),
118121
"spring.couchbase.password=" + couchbaseContainer.getPassword(),

pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@
6565
<module>auto-configurations/models/spring-ai-autoconfigure-model-watsonx-ai</module>
6666
<module>auto-configurations/models/spring-ai-autoconfigure-model-zhipuai</module>
6767

68-
69-
7068
<module>auto-configurations/mcp/spring-ai-autoconfigure-mcp-client</module>
7169
<module>auto-configurations/mcp/spring-ai-autoconfigure-mcp-server</module>
7270

7371
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-azure</module>
7472
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-azure-cosmos-db</module>
7573
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-cassandra</module>
7674
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-chroma</module>
75+
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-couchbase</module>
7776
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-elasticsearch</module>
7877
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-gemfire</module>
7978
<module>auto-configurations/vector-stores/spring-ai-autoconfigure-vector-store-hanadb</module>
@@ -124,12 +123,12 @@
124123
<module>vector-stores/spring-ai-weaviate-store</module>
125124

126125
<module>spring-ai-spring-boot-starters/spring-ai-starter-coherence-store</module>
127-
<module>spring-ai-spring-boot-starters/spring-ai-starter-couchbase-store</module>
128126
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-aws-opensearch</module>
129127
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-azure</module>
130128
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-azure-cosmos-db</module>
131129
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-cassandra</module>
132130
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-chroma</module>
131+
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-couchbase</module>
133132
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-elasticsearch</module>
134133
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-gemfire</module>
135134
<module>spring-ai-spring-boot-starters/spring-ai-starter-vector-store-hanadb</module>

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/vectordbs/couchbase.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To enable it, add the following dependency to your project's Maven `pom.xml` fil
2323
----
2424
<dependency>
2525
<groupId>org.springframework.ai</groupId>
26-
<artifactId>spring-ai-couchbase-store-spring-boot-starter</artifactId>
26+
<artifactId>spring-ai-starter-vector-store-couchbase</artifactId>
2727
</dependency>
2828
----
2929

spring-ai-spring-boot-starters/spring-ai-starter-couchbase-store/pom.xml spring-ai-spring-boot-starters/spring-ai-starter-vector-store-couchbase/pom.xml

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<version>1.0.0-SNAPSHOT</version>
88
<relativePath>../../pom.xml</relativePath>
99
</parent>
10-
<artifactId>spring-ai-couchbase-store-spring-boot-starter</artifactId>
10+
<artifactId>spring-ai-starter-vector-store-couchbase</artifactId>
1111
<packaging>jar</packaging>
1212
<name>Spring AI Starter - Couchbase Store</name>
1313
<description>Spring AI Couchbase Store Auto Configuration</description>
@@ -28,10 +28,14 @@
2828

2929
<dependency>
3030
<groupId>org.springframework.ai</groupId>
31-
<artifactId>spring-ai-spring-boot-autoconfigure</artifactId>
31+
<artifactId>spring-ai-autoconfigure-vector-store-couchbase</artifactId>
32+
<version>${project.parent.version}</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.springframework.ai</groupId>
36+
<artifactId>spring-ai-autoconfigure-vector-store-observation</artifactId>
3237
<version>${project.parent.version}</version>
3338
</dependency>
34-
3539
<dependency>
3640
<groupId>org.springframework.ai</groupId>
3741
<artifactId>spring-ai-couchbase-store</artifactId>

0 commit comments

Comments
 (0)