mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-01 08:58:31 +02:00
2.0 KiB
2.0 KiB
title, weight
| title | weight |
|---|---|
| Spring AI | 2200 |
Spring AI
Spring AI is a Java framework that provides a Spring-friendly API and abstractions for developing AI applications.
Qdrant is available as supported vector database for use within your Spring AI projects.
Installation
To acquire Spring AI artifacts, declare the Spring Snapshot repository in your pom.xml.
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
Add the spring-ai-qdrant package.
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-qdrant</artifactId>
<version>VERSION</version>
</dependency>
Usage
You can set up the Qdrant vector store with the QdrantVectorStoreConfig options.
@Bean
public QdrantVectorStoreConfig qdrantVectorStoreConfig() {
return QdrantVectorStoreConfig.builder()
.withHost("<QDRANT_HOSTNAME>")
.withPort(<QDRANT_GRPC_PORT>)
.withCollectionName("<QDRANT_COLLECTION_NAME>")
.withApiKey("<QDRANT_API_KEY>")
.build();
}
Build the vector store using the config and any of the support Spring AI embedding providers.
@Bean
public VectorStore vectorStore(QdrantVectorStoreConfig config, EmbeddingClient embeddingClient) {
return new QdrantVectorStore(config, embeddingClient);
}
You can now use the VectorStore instance backed by Qdrant as a vector store in the Spring AI APIs.
Further Reading
- 📚 Spring AI reference