# redis-vl-java
**Repository Path**: mirrors_redis/redis-vl-java
## Basic Information
- **Project Name**: redis-vl-java
- **Description**: Redis Vector Library (RedisVL) -- the AI-native Python client for Redis.
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-10-11
- **Last Updated**: 2026-05-24
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Vector Library
The AI-native Redis Java client
[](https://opensource.org/licenses/MIT)


[](https://central.sonatype.com/artifact/com.redis/redisvl)
[](https://s01.oss.sonatype.org/content/repositories/snapshots/com/redis/redisvl/)

[](https://github.com/redis/redis-vl-java/stargazers)
# Introduction
Redis Vector Library (RedisVL) is the ultimate Java client designed for AI-native applications harnessing the power of [Redis](https://redis.io).
RedisVL is your go-to client for:
- Lightning-fast information retrieval & vector similarity search
- Real-time RAG pipelines
- LLM semantic caching
- Hybrid search combining vectors and metadata
# ๐ช Getting Started
## Installation
Add RedisVL to your Java (17+) project using Maven or Gradle:
**Maven:**
```xml
com.redis
redisvl
0.12.2
```
**Gradle:**
```gradle
implementation 'com.redis:redisvl:0.12.2'
```
## Setting up Redis
Choose from multiple Redis deployment options:
1. [Redis Cloud](https://redis.io/try-free): Managed cloud database (free tier available)
2. [Redis on Docker](https://hub.docker.com/_/redis): Docker image for development
```bash
docker run -d --name redis -p 6379:6379 -p 8001:8001 redis:latest
```
3. [Redis Enterprise](https://redis.io/enterprise/): Commercial, self-hosted database
4. [Azure Managed Redis](https://azure.microsoft.com/en-us/products/managed-redis): Fully managed Redis Enterprise on Azure
> Enhance your experience and observability with the free [Redis Insight GUI](https://redis.io/insight/).
# Overview
## ๐๏ธ Redis Index Management
1. **Design a schema** for your use case that models your dataset with built-in Redis and indexable fields (*e.g. text, tags, numerics, geo, and vectors*). Load a schema from a YAML file:
```yaml
index:
name: user-idx
prefix: user
storage_type: json
fields:
- name: user
type: tag
- name: credit_score
type: tag
- name: embedding
type: vector
attrs:
algorithm: flat
dims: 4
distance_metric: cosine
datatype: float32
```
```java
import com.redis.vl.schema.IndexSchema;
IndexSchema schema = IndexSchema.fromYaml("schemas/schema.yaml");
```
Or load directly from a Java Map:
```java
Map schemaMap = Map.of(
"index", Map.of(
"name", "user-idx",
"prefix", "user",
"storage_type", "json"
),
"fields", List.of(
Map.of("name", "user", "type", "tag"),
Map.of("name", "credit_score", "type", "tag"),
Map.of(
"name", "embedding",
"type", "vector",
"attrs", Map.of(
"algorithm", "flat",
"datatype", "float32",
"dims", 4,
"distance_metric", "cosine"
)
)
)
);
IndexSchema schema = IndexSchema.fromMap(schemaMap);
```
2. **Create a SearchIndex** class with an input schema to perform admin and search operations on your index in Redis:
```java
import redis.clients.jedis.UnifiedJedis;
import com.redis.vl.index.SearchIndex;
// Define the index
UnifiedJedis jedis = new UnifiedJedis("redis://localhost:6379");
SearchIndex index = new SearchIndex(schema, jedis);
// Create the index in Redis
index.create(true); // overwrite if exists
```
3. **Load and fetch** data to/from your Redis instance:
```java
Map data = Map.of(
"user", "john",
"credit_score", "high",
"embedding", new float[]{0.23f, 0.49f, -0.18f, 0.95f}
);
// load list of maps, specify the "id" field
index.load(List.of(data), "user");
// fetch by "id"
Map john = index.fetch("john");
```
## ๐ Retrieval
Define queries and perform advanced searches over your indices, including the combination of vectors, metadata filters, and more.
- **VectorQuery** - Flexible vector queries with customizable filters enabling semantic search:
```java
import com.redis.vl.query.VectorQuery;
VectorQuery query = VectorQuery.builder()
.vector(new float[]{0.16f, -0.34f, 0.98f, 0.23f})
.field("embedding")
.numResults(3)
.build();
// run the vector search query against the embedding field
List