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

spring-ai-starter-vector-store-pgvector doesn't work without spring-boot-starter-jdbc

Open ilyakastsenevich opened this issue 6 months ago • 2 comments

Bug description When using spring-ai-starter-vector-store-pgvector as described here https://docs.spring.io/spring-ai/reference/2.0/api/vectordbs/pgvector.html

APPLICATION FAILED TO START

Description:

Parameter 0 of method vectorStore in org.springframework.ai.vectorstore.pgvector.autoconfigure.PgVectorStoreAutoConfiguration required a bean of type 'org.springframework.jdbc.core.JdbcTemplate' that could not be found.

Environment spring-ai 2.0.0-M7

    <dependency>
      <groupId>org.springframework.ai</groupId>
      <artifactId>spring-ai-starter-vector-store-pgvector</artifactId>
    </dependency>
Image Image

ilyakastsenevich avatar May 26 '26 13:05 ilyakastsenevich

Hi, I can try to reproduce this.

Looks like PgVectorStoreAutoConfiguration needs a JdbcTemplate, but with only spring-ai-starter-vector-store-pgvector added, the JDBC setup may not be created automatically.

I’ll check it with a minimal Spring Boot project on 2.0.0-M7 and see whether this is a starter dependency issue or something that should be clearer in the docs.

AbaSheger avatar May 26 '26 13:05 AbaSheger

I was able to reproduce this issue on 2.0.0-M7.

It seems PgVectorStoreAutoConfiguration requires a JdbcTemplate, but spring-ai-starter-vector-store-pgvector does not bring in spring-boot-starter-jdbc, so the application fails to start with the documented setup.

I’d like to work on a fix for this.

jyt6640 avatar May 27 '26 06:05 jyt6640