Technology RadarTechnology Radar

Weaviate Java Client v6

vector-databasespring-ai
Trial

Weaviate is an open-source vector database with a dedicated Java client (v6, released late 2025) and first-class Spring AI integration — suited for teams needing advanced vector capabilities like multi-vector search (ColBERT), multi-tenancy, RBAC, and hybrid (vector + keyword) search.

Why Trial

Weaviate v6 Java client represents a significant rewrite addressing the verbosity and inconsistency of earlier versions. It now requires Java 17+ and supports Weaviate server 1.32+. Spring AI's PgVectorStore is still the lowest-friction starting point if you have Postgres, but Weaviate is the right choice when you need:

  • Multi-vector search (ColBERT, late interaction models)
  • Hybrid search (combined vector + BM25 keyword)
  • Multi-tenancy with data isolation per tenant
  • RBAC (role-based access control on collections)
  • Managed cloud scale beyond what pgvector handles well

Spring AI Integration

The simplest path for Spring Boot teams:

<dependency>
  <groupId>org.springframework.ai</groupId>
  <artifactId>spring-ai-weaviate-store</artifactId>
</dependency>
spring.ai.vectorstore.weaviate.scheme=https
spring.ai.vectorstore.weaviate.host=my-cluster.weaviate.network
spring.ai.vectorstore.weaviate.api-key=${WEAVIATE_API_KEY}

Usage is identical to every other Spring AI vector store:

@Autowired VectorStore vectorStore;

// Store
vectorStore.add(List.of(new Document("Weaviate supports hybrid search.")));

// Query with metadata filter
List<Document> results = vectorStore.similaritySearch(
    SearchRequest.query("hybrid vector keyword search")
        .withTopK(5)
        .withFilterExpression("language == 'en' && year >= 2025")
);

Spring AI automatically converts the portable filter expression to Weaviate's where filter format.

Native Java Client v6: The Tucked Builder Pattern

When you need features beyond what Spring AI exposes, the native client v6 is significantly cleaner than v5:

WeaviateClient client = WeaviateClient.builder()
    .scheme("https")
    .host("my-cluster.weaviate.network")
    .apiKey(new ApiKey(System.getenv("WEAVIATE_API_KEY")))
    .build();

// Multi-vector hybrid search
Result<GraphQLResponse> result = client.graphQL().get()
    .withClassName("Document")
    .withHybrid(HybridArgument.builder()
        .withQuery("vector database performance")
        .withAlpha(0.75f)  // 0=pure keyword, 1=pure vector
        .build())
    .withLimit(10)
    .run();

Multi-Tenancy

For SaaS applications where each customer's data must be isolated:

// Create a tenant-aware collection
client.schema().classCreator()
    .withClass(WeaviateClass.builder()
        .className("CustomerDocument")
        .multiTenancyConfig(MultiTenancyConfig.builder()
            .enabled(true)
            .build())
        .build())
    .run();

// Query scoped to a specific tenant
client.graphQL().get()
    .withClassName("CustomerDocument")
    .withTenant("customer-uuid-123")
    .withNearText(NearTextArgument.builder()
        .withConcepts(new String[]{"invoice"})
        .build())
    .run();

Compared to pgvector

pgvector Weaviate
Setup Zero (extend Postgres) Separate service
Multi-vector (ColBERT) No Yes
Hybrid search Via pg_search extension Native
Multi-tenancy Schema-based First-class
RBAC PostgreSQL roles Native
Scale ~100M vectors well Billions with Weaviate Cloud

Key Characteristics

Property Value
Java client version v6 (late 2025)
Java requirement 17+
Server requirement Weaviate 1.32+
Spring AI support spring-ai-weaviate-store
Deployment Self-hosted (Docker) or Weaviate Cloud

Further Reading