spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Two types of vectordatabase are imported into the project pom.xml. When starting the project, an error is reported, indicating that vectorstore has been defined.

Open chenm202501 opened this issue 1 year ago • 3 comments

项目中导入了两种向量数据库,项目启动不了,提示vectorstore已经定义。

<dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-starter-vector-store-cassandra</artifactId>
        </dependency>
<dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-starter-vector-store-redis</artifactId>
        </dependency>

Bug description 报错如下:

Description:

The bean 'vectorStore', defined in class path resource [org/springframework/ai/vectorstore/redis/autoconfigure/RedisVectorStoreAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/houmong/emp/imcp/ai/demo/VectorStoreConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Environment Spring AI 1.0.0

有个spring.ai.vectorstore.type配置项可以指定向量数据库的类型,指定后自动配置应该就会跳过,不知为啥application.yml里没有,这个应该怎么配置。

chenm202501 avatar May 30 '25 02:05 chenm202501

You might want to check out this issue: https://github.com/spring-projects/spring-ai/issues/3346, which may help with your question

sunyuhan1998 avatar May 30 '25 04:05 sunyuhan1998

This is also related to #3172

markpollack avatar May 30 '25 15:05 markpollack

We should examine the impact of this to see if we can backport to 1.0.x line. It is very important to support this use case.

markpollack avatar May 30 '25 15:05 markpollack