This version is still in development and is not considered stable yet. For the latest snapshot version, please use Spring AI 1.0.0-SNAPSHOT!spring-doc.cn

Testcontainers

Spring AI provides Spring Boot auto-configuration for establishing a connection to a model service or vector store running via Testcontainers. To enable it, add the following dependency to your project’s Maven pom.xml file:spring-doc.cn

<dependency>
   <groupId>org.springframework.ai</groupId>
   <artifactId>spring-ai-spring-boot-testcontainers</artifactId>
</dependency>

or to your Gradle build.gradle build file.spring-doc.cn

dependencies {
    implementation 'org.springframework.ai:spring-ai-spring-boot-testcontainers'
}
Refer to the Dependency Management section to add the Spring AI BOM to your build file.

Service Connections

The following service connection factories are provided in the spring-ai-spring-boot-testcontainers module:spring-doc.cn

Connection Details Matched on

AwsOpenSearchConnectionDetailsspring-doc.cn

Containers of type LocalStackContainerspring-doc.cn

ChromaConnectionDetailsspring-doc.cn

Containers of type ChromaDBContainerspring-doc.cn

MilvusServiceClientConnectionDetailsspring-doc.cn

Containers of type MilvusContainerspring-doc.cn

MongoConnectionDetailsspring-doc.cn

Containers of type MongoDBAtlasLocalContainerspring-doc.cn

OllamaConnectionDetailsspring-doc.cn

Containers of type OllamaContainerspring-doc.cn

OpenSearchConnectionDetailsspring-doc.cn

Containers of type OpensearchContainerspring-doc.cn

QdrantConnectionDetailsspring-doc.cn

Containers of type QdrantContainerspring-doc.cn

TypesenseConnectionDetailsspring-doc.cn

Containers named "typesense/typesense"spring-doc.cn

WeaviateConnectionDetailsspring-doc.cn

Containers of type WeaviateContainerspring-doc.cn