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 is the ultimate Python client designed for AI-native applications harnessing the power of [Redis](https://redis.io).
26
+
Redis Vector Library (RedisVL) is the production-ready Python client for AI applications built on Redis. **Lightning-fast vector search meets enterprise-grade reliability.**
35
27
36
-
[redisvl](https://pypi.org/project/redisvl/) is your go-to client for:
28
+
<divalign="center">
37
29
38
-
- Lightning-fast information retrieval & vector similarity search
39
-
- Real-time RAG pipelines
40
-
- Agentic memory structures
41
-
- Smart recommendation engines
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*|
36
+
37
+
</div>
38
+
39
+
### **Built for Modern AI Workloads**
40
+
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:
@@ -222,19 +224,13 @@ embeddings = co.embed_many(
222
224
### Rerankers
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
-
### Threshold Optimization
226
-
[Optimize distance thresholds for cache and router](https://docs.redisvl.com/en/stable/user_guide/09_threshold_optimization.html) with the utility `ThresholdOptimizer` classes.
227
-
228
-
**Note:** only available for`python > 3.9`.
229
227
230
-
231
-
232
-
## 💫 Extensions
228
+
## Extensions
233
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.
234
230
235
231
*Have an idea for another extension? Open a PR or reach out to us at [email protected]. We're always open to feedback.*
236
232
237
-
### LLM Semantic Caching
233
+
### Semantic Caching
238
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.
266
262
267
-
### 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
269
+
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
+
```
268
292
269
-
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).
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).
270
298
271
299
```python
272
300
from redisvl.extensions.message_history import SemanticMessageHistory
>>> [{"role": "user", "content": "what is the weather going to be today?"}]
300
328
```
301
-
> 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)).
302
330
303
331
304
-
### LLM Semantic Routing
332
+
### Semantic Routing
305
333
Build fast decision models that run directly in Redis and route user queries to the nearest "route" or "topic".
306
334
307
335
```python
@@ -337,7 +365,7 @@ router("Hi, good morning")
337
365
```
338
366
> Learn more about [semantic routing](https://docs.redisvl.com/en/stable/user_guide/08_semantic_router.html).
339
367
340
-
## 🖥️ Command Line Interface
368
+
## Command Line Interface
341
369
Create, destroy, and manage Redis index configurations from a purpose-built CLI interface: `rvl`.
342
370
343
371
```bash
@@ -355,25 +383,20 @@ Commands:
355
383
356
384
## 🚀 Why RedisVL?
357
385
358
-
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.
359
387
360
-
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.
361
-
362
-
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.
363
389
364
390
365
391
## 😁 Helpful Links
366
392
367
393
For additional help, check out the following resources:
368
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)
372
-
- [Official Redis Vector API Docs](https://redis.io/docs/interact/search-and-query/advanced-concepts/vectors/)
373
397
374
398
375
399
## 🫱🏼🫲🏽 Contributing
376
-
377
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