You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redis Vector Library (RedisVL) is the production-ready Python client for AI applications built on Redis. **Lightning-fast vector search meets enterprise-grade reliability.**
27
+
28
+
<divalign="center">
31
29
32
-
# Introduction
30
+
|**🎯 Core Capabilities**|**🚀 AI Extensions**|**🛠️ Dev Utilities**|
31
+
|:---:|:---:|:---:|
32
+
|**[Index Management](#index-management)**<br/>*Schema design, data loading, CRUD ops*|**[Semantic Caching](#semantic-caching)**<br/>*Reduce LLM costs & boost throughput*|**[CLI](#command-line-interface)**<br/>*Index management from terminal*|
33
+
|**[Vector Search](#retrieval)**<br/>*Similarity search with metadata filters*|**[LLM Memory](#llm-memory)**<br/>*Agentic AI context management*|**Async Support**<br/>*Async indexing and search for improved performance*|
|**[Multi-Query Types](#retrieval)**<br/>*Vector, Range, Filter, Count queries*|**[Embedding Caching](#embedding-caching)**<br/>*Cache embeddings for efficiency*|**[Rerankers](#rerankers)**<br/>*Improve search result relevancy*|
33
36
34
-
Redis Vector Library is the ultimate Python client designed for AI-native applications harnessing the power of [Redis](https://redis.io).
37
+
</div>
35
38
36
-
[redisvl](https://pypi.org/project/redisvl/) is your go-to client for:
39
+
### **Built for Modern AI Workloads**
37
40
38
-
- Lightning-fast information retrieval & vector similarity search
39
-
- Real-time RAG pipelines
40
-
- Agentic memory structures
41
-
- Smart recommendation engines
41
+
-**RAG Pipelines** → Real-time retrieval with hybrid search capabilities
42
+
-**AI Agents** → Short term & long term memory and semantic routing for intent-based decisions
43
+
-**Recommendation Systems** → Fast retrieval and reranking
42
44
43
45
44
46
# 💪 Getting Started
45
47
46
48
## Installation
47
49
48
-
Install `redisvl` into your Python (>=3.8) environment using `pip`:
50
+
Install `redisvl` into your Python (>=3.9) environment using `pip`:
49
51
50
52
```bash
51
53
pip install redisvl
52
54
```
53
55
> For more detailed instructions, visit the [installation guide](https://docs.redisvl.com/en/stable/overview/installation.html).
54
56
55
-
## Setting up Redis
57
+
## Redis
56
58
57
59
Choose from multiple Redis deployment options:
58
60
@@ -71,7 +73,7 @@ Choose from multiple Redis deployment options:
71
73
# Overview
72
74
73
75
74
-
## 🗃️ Redis Index Management
76
+
## Index Management
75
77
1. [Design a schema for your use case](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#define-an-indexschema) that models your dataset with built-in Redis and indexable fields (*e.g. text, tags, numerics, geo, and vectors*). [Load a schema](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#example-schema-creation) from a YAML file:
76
78
```yaml
77
79
index:
@@ -147,7 +149,7 @@ and [fetch](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.htm
147
149
john = index.fetch("john")
148
150
```
149
151
150
-
## 🔍 Retrieval
152
+
## Retrieval
151
153
152
154
Define queries and perform advanced searches over your indices, including the combination of vectors, metadata filters, and more.
153
155
@@ -186,7 +188,7 @@ Define queries and perform advanced searches over your indices, including the co
186
188
> Read more about building [advanced Redis queries](https://docs.redisvl.com/en/stable/user_guide/02_hybrid_queries.html).
187
189
188
190
189
-
## 🔧 Utilities
191
+
## Dev Utilities
190
192
191
193
### Vectorizers
192
194
Integrate with popular embedding providers to greatly simplify the process of vectorizing unstructured data for your index and queries:
@@ -223,12 +225,12 @@ embeddings = co.embed_many(
223
225
[Integrate with popular reranking providers](https://docs.redisvl.com/en/stable/user_guide/06_rerankers.html) to improve the relevancy of the initial search results from Redis
224
226
225
227
226
-
## 💫 Extensions
228
+
## Extensions
227
229
We're excited to announce the support for **RedisVL Extensions**. These modules implement interfaces exposing best practices and design patterns for working with LLM memory and agents. We've taken the best from what we've learned from our users (that's you) as well as bleeding-edge customers, and packaged it up.
228
230
229
231
*Have an idea for another extension? Open a PR or reach out to us at [email protected]. We're always open to feedback.*
230
232
231
-
### LLM Semantic Caching
233
+
### Semantic Caching
232
234
Increase application throughput and reduce the cost of using LLM models in production by leveraging previously generated knowledge with the [`SemanticCache`](https://docs.redisvl.com/en/stable/api/cache.html#semanticcache).
> Learn more about [semantic caching]((https://docs.redisvl.com/en/stable/user_guide/03_llmcache.html))for LLMs.
260
262
261
-
### LLM Memory History
263
+
### Embedding Caching
264
+
Reduce computational costs and improve performance by caching embedding vectors with their associated text and metadata using the [`EmbeddingsCache`](https://docs.redisvl.com/en/stable/api/cache.html#embeddingscache).
265
+
266
+
```python
267
+
from redisvl.extensions.cache.embeddings import EmbeddingsCache
268
+
from redisvl.utils.vectorize import HFTextVectorizer
262
269
263
-
Improve personalization and accuracy of LLM responses by providing user message history as context. Manage access to message history data using recency or relevancy, *powered by vector search* with the [`MessageHistory`](https://docs.redisvl.com/en/stable/api/message_history.html).
270
+
# Initialize embedding cache
271
+
embed_cache = EmbeddingsCache(
272
+
name="embed_cache",
273
+
redis_url="redis://localhost:6379",
274
+
ttl=3600 # 1 hour TTL
275
+
)
276
+
277
+
# Initialize vectorizer with cache
278
+
vectorizer = HFTextVectorizer(
279
+
model="sentence-transformers/all-MiniLM-L6-v2",
280
+
cache=embed_cache
281
+
)
282
+
283
+
# First call computes and caches the embedding
284
+
embedding = vectorizer.embed("What is machine learning?")
285
+
286
+
# Subsequent calls retrieve from cache (much faster!)
287
+
cached_embedding = vectorizer.embed("What is machine learning?")
288
+
```
289
+
```stdout
290
+
>>> Cache hit! Retrieved from Redis in <1ms
291
+
```
292
+
293
+
> Learn more about [embedding caching](https://docs.redisvl.com/en/stable/user_guide/10_embeddings_cache.html) for improved performance.
294
+
295
+
### LLM Memory
296
+
297
+
Improve personalization and accuracy of LLM responses by providing user conversation context. Manage access to memory data using recency or relevancy, *powered by vector search* with the [`MessageHistory`](https://docs.redisvl.com/en/stable/api/message_history.html).
264
298
265
299
```python
266
300
from redisvl.extensions.message_history import SemanticMessageHistory
>>> [{"role": "user", "content": "what is the weather going to be today?"}]
294
328
```
295
-
> Learn more about [LLM message history]((https://docs.redisvl.com/en/stable/user_guide/07_message_history.html)).
329
+
> Learn more about [LLM memory]((https://docs.redisvl.com/en/stable/user_guide/07_message_history.html)).
296
330
297
331
298
-
### LLM Semantic Routing
332
+
### Semantic Routing
299
333
Build fast decision models that run directly in Redis and route user queries to the nearest "route" or "topic".
300
334
301
335
```python
@@ -331,7 +365,7 @@ router("Hi, good morning")
331
365
```
332
366
> Learn more about [semantic routing](https://docs.redisvl.com/en/stable/user_guide/08_semantic_router.html).
333
367
334
-
## 🖥️ Command Line Interface
368
+
## Command Line Interface
335
369
Create, destroy, and manage Redis index configurations from a purpose-built CLI interface: `rvl`.
336
370
337
371
```bash
@@ -349,25 +383,20 @@ Commands:
349
383
350
384
## 🚀 Why RedisVL?
351
385
352
-
In the age of GenAI, **vector databases** and **LLMs** are transforming information retrieval systems. With emerging and popular frameworks like [LangChain](https://github.com/langchain-ai/langchain) and [LlamaIndex](https://www.llamaindex.ai/), innovation is rapid. Yet, many organizations face the challenge of delivering AI solutions **quickly** and at **scale**.
386
+
Redis is a proven, high-performance database that excels at real-time workloads. With RedisVL, you get a production-ready Python client that makes Redis's vector search, caching, and session management capabilities easily accessible forAI applications.
353
387
354
-
Enter [Redis](https://redis.io) – a cornerstone of the NoSQL world, renowned for its versatile [data structures](https://redis.io/docs/data-types/) and [processing engines](https://redis.io/docs/interact/). Redis excels in real-time workloads like caching, session management, and search. It's also a powerhouse as a vector database for RAG, an LLM cache, and a chat session memory store for conversational AI.
355
-
356
-
The Redis Vector Library bridges the gap between the AI-native developer ecosystem and Redis's robust capabilities. With a lightweight, elegant, and intuitive interface, RedisVL makes it easy to leverage Redis's power. Built on the [Redis Python](https://github.com/redis/redis-py/tree/master) client, `redisvl` transforms Redis's features into a grammar perfectly aligned with the needs of today's AI/ML Engineers and Data Scientists.
388
+
Built on the [Redis Python](https://github.com/redis/redis-py/tree/master) client, RedisVL provides an intuitive interface for vector search, LLM caching, and conversational AI memory - all the core components needed for modern AI workloads.
357
389
358
390
359
391
## 😁 Helpful Links
360
392
361
393
For additional help, check out the following resources:
362
394
- [Getting Started Guide](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html)
- [Redis AI Recipes](https://github.com/redis-developer/redis-ai-resources)
366
-
- [Official Redis Vector API Docs](https://redis.io/docs/interact/search-and-query/advanced-concepts/vectors/)
367
397
368
398
369
399
## 🫱🏼🫲🏽 Contributing
370
-
371
400
Please help us by contributing PRs, opening GitHub issues for bugs or new feature ideas, improving documentation, or increasing test coverage. [Read more about how to contribute!](CONTRIBUTING.md)
0 commit comments