.. | ||
getting-started-with-redis-and-openai.ipynb | ||
README.md |
Redis
Redis has first-class support for vector search through the RediSearch module. RediSearch is a Redis module that provides querying, secondary indexing, full-text search and vector search for Redis. To use RediSearch, you first declare indexes on your Redis data. You can then use the RediSearch query language to query that data.
Features
RediSearch uses compressed, inverted indexes for fast indexing with a low memory footprint. RediSearch indexes enhance Redis by providing exact-phrase matching, fuzzy search, and numeric filtering, among many other features. Such as:
- Full-Text indexing of multiple fields in Redis hashes
- Incremental indexing without performance loss
- Vector similarity search
- Document ranking (using tf-idf, with optional user-provided weights)
- Field weighting
- Complex boolean queries with AND, OR, and NOT operators
- Prefix matching, fuzzy matching, and exact-phrase queries
- Support for double-metaphone phonetic matching
- Auto-complete suggestions (with fuzzy prefix suggestions)
- Stemming-based query expansion in many languages (using Snowball)
- Support for Chinese-language tokenization and querying (using Friso)
- Numeric filters and ranges
- Geospatial searches using Redis geospatial indexing
- A powerful aggregations engine
- Supports for all utf-8 encoded text
- Retrieve full documents, selected fields, or only the document IDs
- Sorting results (for example, by creation date)
- JSON support through RedisJSON
Clients
Given the large ecosystem around Redis, there are most likely client libraries in the language you need. You can use any standard Redis client library to run RediSearch commands, but it's easiest to use a library that wraps the RediSearch API. Below are a few examples, but you can find more client libraries here.
Project | Language | License | Author | Stars |
---|---|---|---|---|
jedis | Java | MIT | Redis | |
redis-py | Python | MIT | Redis | |
node-redis | Node.js | MIT | Redis | |
nredisstack | .NET | MIT | Redis | |
redisearch-go | Go | BSD | Redis | |
redisearch-api-rs | Rust | BSD | Redis |
Deployment Options
There are many ways to deploy Redis with RediSearch. The easiest way to get started is to use Docker, but there are are many potential options for deployment such as
- Redis Cloud
- Cloud marketplaces: AWS Marketplace, Google Marketplace, or Azure Marketplace
- On-premise: Redis Enterprise Software
- Kubernetes: Redis Enterprise Software on Kubernetes
- Docker (RediSearch)
- Docker (Redis Stack)
Cluster support
RediSearch has a distributed cluster version that scales to billions of documents across hundreds of servers. At the moment, distributed RediSearch is available as part of Redis Enterprise Cloud and Redis Enterprise Software.
See RediSearch on Redis Enterprise for more information.
More Resources
For more information on how to use Redis as a vector database, check out the following resources:
- Redis Vector Similarity Docs - Redis official docs for Vector Search.
- Redis-py Search Docs - Redis-py client library docs for RediSearch.
- Vector Similarity Search: From Basics to Production - Introductory blog post to VSS and Redis as a VectorDB.
- AI-Powered Document Search - Blog post covering AI Powered Document Search Use Cases & Architectures.
- Vector Database Benchmarks - Jina AI VectorDB benchmarks comparing Redis against others.