spring-projects / spring-projects/spring-ai

Redis documentation does not show the required JedisConnectionFactory declaration

Open
#1,886 2 comments 1 reaction 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

Bug description
More info here. I am trying to configure RedisVector store via these instructions. However, it doesn't work, instead when I add debug I see

RedisVectorStoreAutoConfiguration:
      Did not match:
         - @ConditionalOnBean (types: org.springframework.data.redis.connection.jedis.JedisConnectionFactory; SearchStrategy: all) did not find any beans of type org.springframework.data.redis.connection.jedis.JedisConnectionFactory (OnBeanCondition)
      Matched:
         - @ConditionalOnClass found required classes 'redis.clients.jedis.JedisPooled', 'org.springframework.data.redis.connection.jedis.JedisConnectionFactory', 'org.springframework.ai.vectorstore.RedisVectorStore', 'org.springframework.ai.embedding.EmbeddingModel' (OnClassCondition)

To get it to work I have to add

    @Bean
    public JedisConnectionFactory redisConnectionFactory() {
        return new JedisConnectionFactory();
    }

Which is not documented anywhere as far as I can find.

Environment
Spring AI 1.0.0.m4 and Java 23

Steps to reproduce
In my case I just had to add the lib and debug but ftr here is my entire build.gradle

/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Java application project to get you started.
 * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.10.2/userguide/building_java_projects.html in the Gradle documentation.
 * This project uses @Incubating APIs which are subject to change.
 */

plugins {
    id 'com.google.cloud.tools.jib' version '3.4.4'
    // Apply the application plugin to add support for building a CLI application in Java.
    id 'java'
    id 'org.springframework.boot' version '3.3.4'
    id "io.spring.dependency-management" version '1.1.6'
    id 'idea'
}
idea {
    module {
        downloadJavadoc = true
        downloadSources = true
    }
}

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
    maven {
        url 'https://repo.spring.io/milestone'
    }
}

group = 'org.cbusha'
version = '0.0.1-SNAPSHOT'

ext {
    springAiVersion = '1.0.0-M3'
}

dependencies {
    implementation platform("org.springframework.ai:spring-ai-bom:${springAiVersion}")
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-logging'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.data:spring-data-redis'

    implementation 'org.springframework.boot:spring-boot-starter-integration'
    implementation 'org.springframework.integration:spring-integration-mqtt:6.3.4'

    implementation "org.springframework.ai:spring-ai-openai-spring-boot-starter:${springAiVersion}"
    implementation "org.springframework.ai:spring-ai-anthropic-spring-boot-starter:${springAiVersion}"
    implementation "org.springframework.ai:spring-ai-pinecone-store-spring-boot-starter:${springAiVersion}"
    implementation "org.springframework.ai:spring-ai-redis-store-spring-boot-starter:${springAiVersion}"
    implementation 'org.springframework.boot:spring-boot-starter-websocket:3.3.5'

    implementation 'com.github.ben-manes.caffeine:caffeine'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'

    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

}

testing {
    suites {
        // Configure the built-in test suite
        test {
            // Use JUnit Jupiter test framework
            useJUnitJupiter('5.10.3')
        }
    }
}

// Apply a specific Java toolchain to ease working on different environments.
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(23)
    }
}

Expected behavior
I would expect either the documentation shows the need to add the Connection Factory bean or that it would work without declaring it.

Minimal Complete Reproducible example
Should be available here https://github.com/jrgleason/spring-ai-example/tree/CHANGES_AND_FIXES

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 with the Redis vector store reference page linked in the issue, then compare its setup with the supplied build.gradle and minimal reproducible example. Confirm whether the JedisConnectionFactory bean is required; done means the documentation clearly covers the required setup or the expected automatic configuration behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis, spring, spring-boot
Domain
databases, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.