spring-projects / spring-projects/spring-ai

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
#3,385 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

项目中导入了两种向量数据库,项目启动不了,提示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里没有,这个应该怎么配置。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the startup failure with the Cassandra and Redis vector-store dependencies shown in the issue. Inspect VectorStoreConfiguration and RedisVectorStoreAutoConfiguration, then check application.yml for the vector-store type setting. Done means the application starts without a duplicate vectorStore bean and uses the intended vector database.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis, spring
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.