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
docs: Update terminology from 'hybrid queries' to 'complex filtering' (#472)
## Summary
This PR updates the documentation terminology to distinguish between:
- **Complex filtering**: Combining multiple filter types (tag, numeric,
geo, text filters) - previously called 'hybrid queries'
- **Hybrid search**: The new FT.HYBRID command that combines text and
vector search (HybridQuery/AggregateHybridQuery classes)
## Changes
- Renamed `docs/user_guide/02_hybrid_queries.ipynb` to
`docs/user_guide/02_complex_filtering.ipynb`
- Updated README.md to use 'complex filtering' terminology instead of
'hybrid queries'
- Updated `docs/user_guide/index.md` table of contents
- Updated notebook content to reflect the new terminology
## Notes
- The `HybridQuery` and `AggregateHybridQuery` classes remain unchanged
as they correctly refer to the FT.HYBRID command which combines text and
vector search
- The `11_advanced_queries.ipynb` notebook correctly documents hybrid
search using the FT.HYBRID command
- This change improves clarity by reserving 'hybrid search' for the
specific FT.HYBRID functionality introduced in Redis 8.4.0
## Testing
- Documentation changes only, no code changes
- Verified all file references are updated consistently
---
Pull Request opened by [Augment Code](https://www.augmentcode.com/) with
guidance from the PR author
---------
Co-authored-by: Cloud Agent <cloud-agent@localhost>
Co-authored-by: Tyler Hutcherson <tyler.hutcherson@redis.com>
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
27
28
+
Perfect for building **RAG pipelines** with real-time retrieval, **AI agents** with memory and semantic routing, and **recommendation systems** with fast search and reranking.
29
+
28
30
<divalign="center">
29
31
30
32
|**🎯 Core Capabilities**|**🚀 AI Extensions**|**🛠️ Dev Utilities**|
31
33
|:---:|:---:|:---:|
32
34
|**[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
35
|**[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*|
5. [Azure Managed Redis](https://azure.microsoft.com/en-us/products/managed-redis): Fully managed Redis Enterprise on Azure
98
+
<details>
99
+
<summary><b>Azure Managed Redis</b> - Fully managed Redis Enterprise on Azure</summary>
77
100
78
-
> Enhance your experience and observability with the free [Redis Insight GUI](https://redis.io/insight/).
101
+
[Azure Managed Redis](https://azure.microsoft.com/en-us/products/managed-redis) provides fully managed Redis Enterprise on Microsoft Azure.
102
+
103
+
</details>
104
+
105
+
> 💡 **Tip**: Enhance your experience and observability with the free [Redis Insight GUI](https://redis.io/insight/).
79
106
80
107
# Overview
81
108
82
109
## Index Management
83
110
84
-
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:
111
+
1.**Design a schema** for your use case that models your dataset with built-in Redis indexable fields (*e.g. text, tags, numerics, geo, and vectors*).
112
+
113
+
<details>
114
+
<summary><b>Load schema from YAML file</b></summary>
85
115
86
116
```yaml
87
117
index:
@@ -115,9 +145,14 @@ Choose from multiple Redis deployment options:
<summary><b>Load schema from Python dictionary</b></summary>
119
152
120
153
```python
154
+
from redisvl.schema import IndexSchema
155
+
121
156
schema = IndexSchema.from_dict({
122
157
"index": {
123
158
"name": "user-idx",
@@ -150,6 +185,10 @@ Choose from multiple Redis deployment options:
150
185
})
151
186
```
152
187
188
+
</details>
189
+
190
+
> 📚 Learn more about [schema design](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#define-an-indexschema) and [schema creation](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.html#example-schema-creation).
191
+
153
192
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
193
155
194
```python
@@ -180,7 +219,23 @@ and [fetch](https://docs.redisvl.com/en/stable/user_guide/01_getting_started.htm
180
219
181
220
## Retrieval
182
221
183
-
Define queries and perform advanced searches over your indices, including the combination of vectors, metadata filters, and more.
222
+
Define queries and perform advanced searches over your indices, including vector search, complex filtering, and hybrid search combining semantic and full-text signals.
@@ -198,33 +253,68 @@ Define queries and perform advanced searches over your indices, including the co
198
253
results = index.query(query)
199
254
```
200
255
201
-
Incorporate complex metadata filters on your queries:
256
+
- [RangeQuery](https://docs.redisvl.com/en/stable/api/query.html#rangequery) - Vector search within a defined range paired with customizable filters
257
+
258
+
### Complex Filtering
259
+
260
+
Build complex filtering queries by combining multiple filter types (tags, numerics, text, geo, timestamps) using logical operators:
202
261
203
262
```python
204
-
from redisvl.query.filter import Tag
263
+
from redisvl.query import VectorQuery
264
+
from redisvl.query.filter import Tag, Num
205
265
206
-
#define a tag match filter
266
+
# Combine multiple filter types
207
267
tag_filter = Tag("user") == "john"
268
+
price_filter = Num("price") >= 100
208
269
209
-
# update query definition
210
-
query.set_filter(tag_filter)
211
-
212
-
# execute query
270
+
# Create complex filtering query with combined filters
271
+
query = VectorQuery(
272
+
vector=[0.16, -0.34, 0.98, 0.23],
273
+
vector_field_name="embedding",
274
+
filter_expression=tag_filter & price_filter,
275
+
num_results=10
276
+
)
213
277
results = index.query(query)
214
278
```
215
279
216
-
- [RangeQuery](https://docs.redisvl.com/en/stable/api/query.html#rangequery) - Vector search within a defined range paired with customizable filters
217
-
- [FilterQuery](https://docs.redisvl.com/en/stable/api/query.html#filterquery) - Standard search using filters and the full-text search
280
+
- [FilterQuery](https://docs.redisvl.com/en/stable/api/query.html#filterquery) - Standard search using filters and full-text search
218
281
- [CountQuery](https://docs.redisvl.com/en/stable/api/query.html#countquery) - Count the number of indexed records given attributes
219
282
- [TextQuery](https://docs.redisvl.com/en/stable/api/query.html#textquery) - Full-text search with support for field weighting and BM25 scoring
220
283
221
-
> Read more about building [advanced Redis queries](https://docs.redisvl.com/en/stable/user_guide/02_hybrid_queries.html).
284
+
> Learn more about building [complex filtering queries](https://docs.redisvl.com/en/stable/user_guide/02_complex_filtering.html).
285
+
286
+
### Hybrid Search
287
+
288
+
Combine semantic (vector) search with full-text (BM25) search signals for improved search quality:
289
+
290
+
- [HybridQuery](https://docs.redisvl.com/en/stable/api/query.html#hybridquery) - Native hybrid search combining text and vector similarity (Redis 8.4.0+):
291
+
292
+
```python
293
+
from redisvl.query import HybridQuery
294
+
295
+
hybrid_query = HybridQuery(
296
+
text="running shoes",
297
+
text_field_name="description",
298
+
vector=[0.1, 0.2, 0.3],
299
+
vector_field_name="embedding",
300
+
combination_method="LINEAR", # or "RRF"
301
+
num_results=10
302
+
)
303
+
results = index.query(hybrid_query)
304
+
```
305
+
306
+
- [AggregateHybridQuery](https://docs.redisvl.com/en/stable/api/query.html#aggregatehybridquery) - Hybrid search using aggregation (compatible with earlier Redis versions)
307
+
308
+
> Learn more about [hybrid search](https://docs.redisvl.com/en/stable/user_guide/11_advanced_queries.html#hybrid-queries-combining-text-and-vector-search).
222
309
223
310
## Dev Utilities
224
311
225
312
### Vectorizers
226
313
227
-
Integrate with popular embedding providers to greatly simplify the process of vectorizing unstructured data for your index and queries:
314
+
Integrate with popular embedding providers to greatly simplify the process of vectorizing unstructured data for your index and queries.
from redisvl.utils.vectorize import CohereTextVectorizer
240
332
@@ -252,22 +344,25 @@ embeddings = co.embed_many(
252
344
)
253
345
```
254
346
255
-
> Learn more about using [vectorizers]((https://docs.redisvl.com/en/stable/user_guide/04_vectorizers.html))in your embedding workflows.
347
+
> Learn more about using [vectorizers](https://docs.redisvl.com/en/stable/user_guide/04_vectorizers.html) in your embedding workflows.
256
348
257
349
### Rerankers
258
350
259
351
[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
260
352
261
353
## Extensions
262
354
263
-
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.
355
+
**RedisVL Extensions** provide production-ready modules implementing best practices and design patterns for working with LLM memory and agents. These extensions encapsulate learnings from our user community and enterprise customers.
264
356
265
-
*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.*
357
+
> 💡 *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.*
266
358
267
359
### Semantic Caching
268
360
269
361
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.
392
+
</details>
393
+
394
+
> Learn more about [semantic caching](https://docs.redisvl.com/en/stable/user_guide/03_llmcache.html) for LLMs.
298
395
299
396
### Embedding Caching
300
397
301
398
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).
from redisvl.extensions.cache.embeddings import EmbeddingsCache
305
405
from redisvl.utils.vectorize import HFTextVectorizer
@@ -328,12 +428,17 @@ cached_embedding = vectorizer.embed("What is machine learning?")
328
428
>>> Cache hit! Retrieved from Redis in <1ms
329
429
```
330
430
431
+
</details>
432
+
331
433
> Learn more about [embedding caching](https://docs.redisvl.com/en/stable/user_guide/10_embeddings_cache.html) for improved performance.
332
434
333
435
### LLM Memory
334
436
335
437
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).
336
438
439
+
<details>
440
+
<summary><b>Example: Message History Usage</b></summary>
441
+
337
442
```python
338
443
from redisvl.extensions.message_history import SemanticMessageHistory
339
444
@@ -351,43 +456,31 @@ history.add_messages([
351
456
{"role": "user", "content": "what is the weather going to be today?"},
352
457
{"role": "llm", "content": "I don't know", "metadata": {"model": "gpt-4"}}
0 commit comments