Skip to content

Commit ee7c35f

Browse files
committed
docs: update README
1 parent 7f4dc4f commit ee7c35f

File tree

1 file changed

+77
-19
lines changed

1 file changed

+77
-19
lines changed

README.md

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ Redis Vector Library (RedisVL) is the production-ready Python client for AI appl
3838

3939
### **Built for Modern AI Workloads**
4040

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
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
4343
- **Recommendation Systems** → Fast retrieval and reranking
4444

45-
4645
# 💪 Getting Started
4746

4847
## Installation
@@ -52,29 +51,38 @@ Install `redisvl` into your Python (>=3.9) environment using `pip`:
5251
```bash
5352
pip install redisvl
5453
```
54+
5555
> For more detailed instructions, visit the [installation guide](https://docs.redisvl.com/en/stable/overview/installation.html).
5656
5757
## Redis
5858

5959
Choose from multiple Redis deployment options:
6060

61-
6261
1. [Redis Cloud](https://redis.io/try-free): Managed cloud database (free tier available)
6362
2. [Redis Stack](https://redis.io/docs/getting-started/install-stack/docker/): Docker image for development
63+
6464
```bash
6565
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
6666
```
67+
6768
3. [Redis Enterprise](https://redis.io/enterprise/): Commercial, self-hosted database
68-
4. [Azure Managed Redis](https://azure.microsoft.com/en-us/products/managed-redis): Fully managed Redis Enterprise on Azure
69+
4. [Redis Sentinel](https://redis.io/docs/management/sentinel/): High availability with automatic failover
6970

70-
> Enhance your experience and observability with the free [Redis Insight GUI](https://redis.io/insight/).
71+
```python
72+
# Connect via Sentinel
73+
redis_url="redis+sentinel://sentinel1:26379,sentinel2:26379/mymaster"
74+
```
7175

76+
5. [Azure Managed Redis](https://azure.microsoft.com/en-us/products/managed-redis): Fully managed Redis Enterprise on Azure
7277

73-
# Overview
78+
> Enhance your experience and observability with the free [Redis Insight GUI](https://redis.io/insight/).
7479

80+
# Overview
7581

7682
## Index Management
83+
7784
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:
85+
7886
```yaml
7987
index:
8088
name: user-idx
@@ -86,6 +94,12 @@ Choose from multiple Redis deployment options:
8694
type: tag
8795
- name: credit_score
8896
type: tag
97+
- name: job_title
98+
type: text
99+
attrs:
100+
sortable: true
101+
no_index: false # Index for search (default)
102+
unf: false # Normalize case for sorting (default)
89103
- name: embedding
90104
type: vector
91105
attrs:
@@ -94,12 +108,15 @@ Choose from multiple Redis deployment options:
94108
distance_metric: cosine
95109
datatype: float32
96110
```
111+
97112
```python
98113
from redisvl.schema import IndexSchema
99114
100115
schema = IndexSchema.from_yaml("schemas/schema.yaml")
101116
```
117+
102118
Or load directly from a Python dictionary:
119+
103120
```python
104121
schema = IndexSchema.from_dict({
105122
"index": {
@@ -110,6 +127,15 @@ Choose from multiple Redis deployment options:
110127
"fields": [
111128
{"name": "user", "type": "tag"},
112129
{"name": "credit_score", "type": "tag"},
130+
{
131+
"name": "job_title",
132+
"type": "text",
133+
"attrs": {
134+
"sortable": True,
135+
"no_index": False, # Index for search
136+
"unf": False # Normalize case for sorting
137+
}
138+
},
113139
{
114140
"name": "embedding",
115141
"type": "vector",
@@ -125,6 +151,7 @@ Choose from multiple Redis deployment options:
125151
```
126152

127153
2. [Create a SearchIndex](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#create-a-searchindex) class with an input schema to perform admin and search operations on your index in Redis:
154+
128155
```python
129156
from redis import Redis
130157
from redisvl.index import SearchIndex
@@ -135,10 +162,12 @@ Choose from multiple Redis deployment options:
135162
# Create the index in Redis
136163
index.create()
137164
```
165+
138166
> An async-compatible index class also available: [AsyncSearchIndex](https://docs.redisvl.com/en/stable/api/searchindex.html#redisvl.index.AsyncSearchIndex).
139167

140168
3. [Load](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#load-data-to-searchindex)
141169
and [fetch](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#fetch-an-object-from-redis) data to/from your Redis instance:
170+
142171
```python
143172
data = {"user": "john", "credit_score": "high", "embedding": [0.23, 0.49, -0.18, 0.95]}
144173
@@ -168,6 +197,7 @@ Define queries and perform advanced searches over your indices, including the co
168197
```
169198

170199
Incorporate complex metadata filters on your queries:
200+
171201
```python
172202
from redisvl.query.filter import Tag
173203
@@ -184,14 +214,16 @@ Define queries and perform advanced searches over your indices, including the co
184214
- [RangeQuery](https://docs.redisvl.com/en/stable/api/query.html#rangequery) - Vector search within a defined range paired with customizable filters
185215
- [FilterQuery](https://docs.redisvl.com/en/stable/api/query.html#filterquery) - Standard search using filters and the full-text search
186216
- [CountQuery](https://docs.redisvl.com/en/stable/api/query.html#countquery) - Count the number of indexed records given attributes
217+
- [TextQuery](https://docs.redisvl.com/en/stable/api/query.html#textquery) - Full-text search with support for field weighting and BM25 scoring
187218

188219
> Read more about building [advanced Redis queries](https://docs.redisvl.com/en/stable/user_guide/02_hybrid_queries.html).
189220

190-
191221
## Dev Utilities
192222

193223
### Vectorizers
224+
194225
Integrate with popular embedding providers to greatly simplify the process of vectorizing unstructured data for your index and queries:
226+
195227
- [AzureOpenAI](https://docs.redisvl.com/en/stable/api/vectorizer.html#azureopenaitextvectorizer)
196228
- [Cohere](https://docs.redisvl.com/en/stable/api/vectorizer.html#coheretextvectorizer)
197229
- [Custom](https://docs.redisvl.com/en/stable/api/vectorizer.html#customtextvectorizer)
@@ -220,17 +252,18 @@ embeddings = co.embed_many(
220252

221253
> Learn more about using [vectorizers]((https://docs.redisvl.com/en/stable/user_guide/04_vectorizers.html)) in your embedding workflows.
222254

223-
224255
### Rerankers
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
226256

257+
[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
227258

228259
## Extensions
260+
229261
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.
230262

231-
*Have an idea for another extension? Open a PR or reach out to us at applied.ai@redis.com. We're always open to feedback.*
263+
*Have an idea for another extension? Open a PR or reach out to us at <applied.ai@redis.com>. We're always open to feedback.*
232264
233265
### Semantic Caching
266+
234267
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).
235268
236269
```python
@@ -254,13 +287,15 @@ llmcache.store(
254287
response = llmcache.check(prompt="What is France's capital city?")
255288
print(response[0]["response"])
256289
```
290+
257291
```stdout
258292
>>> Paris
259293
```
260294
261295
> Learn more about [semantic caching]((https://docs.redisvl.com/en/stable/user_guide/03_llmcache.html)) for LLMs.
262296
263297
### Embedding Caching
298+
264299
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).
265300
266301
```python
@@ -286,6 +321,7 @@ embedding = vectorizer.embed("What is machine learning?")
286321
# Subsequent calls retrieve from cache (much faster!)
287322
cached_embedding = vectorizer.embed("What is machine learning?")
288323
```
324+
289325
```stdout
290326
>>> Cache hit! Retrieved from Redis in <1ms
291327
```
@@ -305,31 +341,49 @@ history = SemanticMessageHistory(
305341
distance_threshold=0.7
306342
)
307343
344+
# Supports roles: system, user, llm, tool
345+
# Optional metadata field for additional context
308346
history.add_messages([
309347
{"role": "user", "content": "hello, how are you?"},
310-
{"role": "assistant", "content": "I'm doing fine, thanks."},
348+
{"role": "llm", "content": "I'm doing fine, thanks."},
311349
{"role": "user", "content": "what is the weather going to be today?"},
312-
{"role": "assistant", "content": "I don't know"}
350+
{"role": "llm", "content": "I don't know", "metadata": {"model": "gpt-4"}}
313351
])
314352
```
353+
315354
Get recent chat history:
355+
316356
```python
317357
history.get_recent(top_k=1)
318358
```
359+
319360
```stdout
320-
>>> [{"role": "assistant", "content": "I don't know"}]
361+
>>> [{"role": "llm", "content": "I don't know", "metadata": {"model": "gpt-4"}}]
321362
```
363+
322364
Get relevant chat history (powered by vector search):
365+
323366
```python
324367
history.get_relevant("weather", top_k=1)
325368
```
369+
326370
```stdout
327371
>>> [{"role": "user", "content": "what is the weather going to be today?"}]
328372
```
329-
> Learn more about [LLM memory]((https://docs.redisvl.com/en/stable/user_guide/07_message_history.html)).
330373
374+
Filter messages by role:
375+
376+
```python
377+
# Get only user messages
378+
history.get_recent(role="user")
379+
# Or multiple roles
380+
history.get_recent(role=["user", "system"])
381+
```
382+
383+
> Learn more about [LLM memory]((https://docs.redisvl.com/en/stable/user_guide/07_message_history.html)).
331384
332385
### Semantic Routing
386+
333387
Build fast decision models that run directly in Redis and route user queries to the nearest "route" or "topic".
334388
335389
```python
@@ -360,12 +414,15 @@ router = SemanticRouter(
360414
361415
router("Hi, good morning")
362416
```
417+
363418
```stdout
364419
>>> RouteMatch(name='greeting', distance=0.273891836405)
365420
```
421+
366422
> Learn more about [semantic routing](https://docs.redisvl.com/en/stable/user_guide/08_semantic_router.html).
367423
368424
## Command Line Interface
425+
369426
Create, destroy, and manage Redis index configurations from a purpose-built CLI interface: `rvl`.
370427
371428
```bash
@@ -387,17 +444,18 @@ Redis is a proven, high-performance database that excels at real-time workloads.
387444

388445
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.
389446

390-
391447
## 😁 Helpful Links
392448

393449
For additional help, check out the following resources:
394-
- [Getting Started Guide](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html)
395-
- [API Reference](https://docs.redisvl.com/en/stable/api/index.html)
396-
- [Redis AI Recipes](https://github.com/redis-developer/redis-ai-resources)
397450

451+
- [Getting Started Guide](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html)
452+
- [API Reference](https://docs.redisvl.com/en/stable/api/index.html)
453+
- [Redis AI Recipes](https://github.com/redis-developer/redis-ai-resources)
398454

399455
## 🫱🏼‍🫲🏽 Contributing
456+
400457
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)
401458

402459
## 🚧 Maintenance
460+
403461
This project is supported by [Redis, Inc](https://redis.io) on a good faith effort basis. To report bugs, request features, or receive assistance, please [file an issue](https://github.com/redis/redis-vl-python/issues).

0 commit comments

Comments
 (0)