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
@@ -42,202 +42,44 @@ RedisVL provides a client library that enables you to harness the power and flex
42
42
RedisVL has a host of powerful features designed to streamline your vector database operations.
43
43
44
44
1.**Index Management**: RedisVL allows for indices to be created, updated, and deleted with ease. A schema for each index can be defined in yaml or directly in python code and used throughout the lifetime of the index.
45
+
-[Getting Started with SearchIndex](https://www.redisvl.com/user_guide/getting_started_01.html)
46
+
-[``rvl`` Command Line Interface](https://www.redisvl.com/user_guide/cli.html)
45
47
46
-
2.**Embedding Creation**: RedisVL integrates with OpenAI, HuggingFace, and GCP VertexAI to simplify the process of vectorizing unstructured data. *Image support coming soon. Submit a PR for new vectorizers.*
48
+
2.**Embedding Creation**: RedisVLs [Vectorizers](https://www.redisvl.com/user_guide/vectorizers_04.html) integrate with common embedding model services to simplify the process of vectorizing unstructured data.
3.**Vector Search**: RedisVL provides robust search capabilities that enable you to query vectors synchronously and asynchronously. Hybrid queries that utilize tag, geographic, numeric, and other filters like full-text search are also supported.
53
+
3.**Vector Search**: RedisVL provides robust search capabilities that enable you quickly define complex search queries with flexible abstractions.
54
+
-[VectorQuery](https://www.redisvl.com/api/query.html#vectorquery) - Flexible vector queries with filters
55
+
-[RangeQuery](https://www.redisvl.com/api/query.html#rangequery) - Vector search within a defined range
56
+
-[CountQuery](https://www.redisvl.com/api/query.html#countquery) - Count the number of records given attributes
57
+
-[FilterQuery](https://www.redisvl.com/api/query.html#filterquery) - Filter records given attributes
49
58
50
-
4.**Powerful Abstractions**
51
-
-**Semantic Caching**: `LLMCache` is a semantic caching interface built directly into RedisVL. It allows for the caching of generated output from LLMs like GPT-3 and others. As semantic search is used to check the cache, a threshold can be set to determine if the cached result is relevant enough to be returned. If not, the model is called and the result is cached for future use. This can increase the QPS and reduce the cost of using LLM models in production.
59
+
3.**[Hybrid (Filtered) queries](https://www.redisvl.com/user_guide/hybrid_queries_02.html)** that utilize tag, geographic, numeric, and other filters like full-text search are also supported.
52
60
61
+
4.**Semantic Caching**: [`LLMCache`](https://www.redisvl.com/user_guide/llmcache_03.html) is a semantic caching interface built directly into RedisVL. Semantic caching is a popular technique to increase the QPS and reduce the cost of using LLM models in production.
53
62
54
-
## Installation
63
+
5.[**JSON Storage**](https://www.redisvl.com/user_guide/hash_vs_json_05.html): RedisVL supports storing JSON objects, including vectors, in Redis.
55
64
56
-
Please note that this library is still under heavy development, and while you can quickly try RedisVL and deploy it in a production environment, the API may be subject to change at any time.
65
+
## Installation
57
66
58
67
Install `redisvl` using `pip`:
59
68
60
69
```bash
61
70
pip install redisvl
62
71
```
63
72
64
-
This library supports the use of hiredis, so you can also install by running:
65
-
66
-
```bash
67
-
pip install redisvl[hiredis]
68
-
```
69
-
70
-
Then make sure to have [Redis](https://redis.io) accessible with Search & Query features enabled on [Redis Cloud](https://redis.com/try-free) or locally in docker with [Redis Stack](https://redis.io/docs/getting-started/install-stack/docker/):
71
-
72
-
```bash
73
-
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
74
-
```
75
-
76
-
This will also spin up the [Redis Insight GUI](https://redis.com/redis-enterprise/redis-insight/) at `http://localhost:8001`.
77
-
78
-
79
-
80
-
## Example Usage
81
-
82
-
### Index Management
83
-
84
-
Indices can be defined through yaml specification, or json, that correspond directly to the Redis index, field names and arguments in `redis-py`. Take this example `idx.yaml` file:
85
-
86
-
```yaml
87
-
index:
88
-
name: user_index
89
-
prefix: users
90
-
91
-
fields:
92
-
# define tag fields
93
-
tag:
94
-
- name: user
95
-
- name: job
96
-
- name: credit_store
97
-
# define numeric fields
98
-
numeric:
99
-
- name: age
100
-
# define vector fields
101
-
vector:
102
-
- name: user_embedding
103
-
dim: 3
104
-
algorithm: hnsw
105
-
distance_metric: cosine
106
-
```
107
-
108
-
This would correspond to a dataset that looked something like:
109
-
110
-
| user | age | job | credit_score | user_embedding |
RedisVL supports a variety of filter types, including tag, numeric, geographic, and full text search to create *Filter Expressions*. Filter expressions can be used to create hybrid queries which allow you to combine multiple complex data types (i.e. text and vector search) into a single query.
146
-
147
-
```python
148
-
from redisvl.index import SearchIndex
149
-
from redisvl.query import VectorQuery
150
-
from redisvl.query.filter import Tag, Num, Geo, GeoRadius, Text
73
+
For more instructions, see the [installation guide](https://www.redisvl.com/overview/installation.html).
151
74
152
-
# exact tag match
153
-
is_sam = Tag("user") =="Sam"
75
+
## Getting Started
154
76
155
-
# numeric range
156
-
is_over_10 = Num("age") >10
77
+
To get started with RedisVL, check out the
78
+
-[Getting Started Guide](https://www.redisvl.com/user_guide/getting_started_01.html)
The purpose of RedisVL is **NOT** to fully replace your usage of the trusted Redis client libraries. It's simply here to make your life easier getting started and building generative AI applications on top of Redis. With that in mind, the RedisVL query interface and filter expressions can be ported and used with clients like `redis-py`.
179
-
180
-
Take the example filter expression from above:
181
-
```python
182
-
print(str(filter_expression))
183
-
```
184
-
185
-
This prints the RediSearch hybrid filter expression:
The ``LLMCache`` Interface in RedisVL can be used as follows.
214
-
215
-
```python
216
-
from redisvl.llmcache.semantic import SemanticCache
217
-
218
-
cache = SemanticCache(
219
-
redis_url="redis://localhost:6379",
220
-
threshold=0.9, # semantic similarity threshold
221
-
)
222
-
223
-
# check if the cache has a result for a given query
224
-
cache.check("What is the capital of France?")
225
-
[ ]
226
-
227
-
# store a result for a given query
228
-
cache.store("What is the capital of France?", "Paris")
229
-
230
-
# cache will now have the query
231
-
cache.check("What is the capital of France?")
232
-
["Paris"]
233
-
234
-
# cache will still return the result if the query is similar enough
235
-
cache.check("Question -- What really is the capital of France?")
236
-
["Paris"]
237
-
```
238
-
<<<<<<< HEAD
239
-
=======
240
82
241
83
## Contributing
84
+
242
85
Please help us by contributing PRs or opening GitHub issues for desired behaviors or discovered bugs. [Read more about how to contribute to RedisVL!](CONTRIBUTING.md)
0 commit comments