Version current

RedisVL

A powerful, AI-native Java client library for Redis. Leverage the speed, flexibility, and reliability of Redis for real-time data to supercharge your AI application.

What is RedisVL?

RedisVL is a comprehensive Java library for building AI-native applications with Redis. It provides a high-level interface for:

  • Vector similarity search with advanced filtering

  • Schema-based index management from YAML or programmatic configuration

  • Hybrid queries combining vector search with metadata filters

  • Semantic and embedding caching for LLM applications

  • Multiple vectorization options (LangChain4J, local ONNX models)

  • Flexible storage with both Redis Hash and JSON support

RedisVL is a port of the popular Python RedisVL library, bringing these powerful capabilities to the Java ecosystem.

Resources

Getting Started

Learn the basics and create your first vector search application.

Get Started

Hybrid Queries

Combine vector search with powerful metadata filtering.

Learn More

LLM Cache

Implement semantic caching to reduce costs and increase performance.

Explore Caching

Vectorizers

Create embeddings with LangChain4J or local ONNX models.

Choose a Vectorizer

Rerankers

Improve search quality with HuggingFace cross-encoder models.

Boost Relevance

Features

RedisVL for Java offers powerful features for AI-native applications:

  • Index Management - Design search schema and indices with ease from YAML or programmatic configuration

  • Advanced Vector Search - Perform powerful vector search queries with complex filtering support

  • Embedding Creation - Use LangChain4J, local ONNX models, or any of the other supported vectorizers to create embeddings

  • Reranking - Improve search result quality with HuggingFace cross-encoder models via ONNX Runtime

  • Semantic Caching - Cache LLM responses with semantic similarity, increasing QPS and decreasing system cost

  • Embeddings Cache - Cache vector embeddings to avoid redundant computation

  • Storage Flexibility - Choose between Hash and JSON storage based on your needs

  • Pagination - Efficiently handle large result sets

Installation

Add RedisVL to your project:

Maven
<dependency>
    <groupId>com.redis</groupId>
    <artifactId>redisvl</artifactId>
    <version>0.0.1</version>
</dependency>
Gradle
implementation 'com.redis:redisvl:0.0.1'

Quick Example

import com.redis.vl.index.SearchIndex;
import com.redis.vl.schema.IndexSchema;
import com.redis.vl.query.VectorQuery;

// Load schema from YAML
IndexSchema schema = IndexSchema.fromYaml("schema.yaml");

// Create index
SearchIndex index = new SearchIndex(schema, jedis);
index.create(true);

// Load data
index.load(data);

// Vector search with filters
VectorQuery query = VectorQuery.builder()
    .vector(queryVector)
    .field("embedding")
    .numResults(5)
    .withPreFilter("@age:[20 35]")
    .build();

List<Map<String, Object>> results = index.query(query);

Connecting with the Community

Join the Redis community to get help, share your experiences, and contribute: