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

7
11
12
+
---
13
+
14
+
**Stop guessing. Start measuring.** 📊
15
+
16
+
Transform your retrieval system from *"looks good to me"* to *"proven to perform"* with systematic benchmarking and Bayesian optimization.
17
+
8
18
</div>
9
19
10
-
#Retrieval Optimizer
20
+
## ✨ What is Redis Retrieval Optimizer?
11
21
12
-
The **Redis Retrieval Optimizer** is a framework for systematically measuring and improving retrieval performance for vector and hybrid search. The framework helps you select the best combination of embedding model, index type, and query settings for your specific use case.
22
+
The **Retrieval Optimizer** is a powerful framework that takes the guesswork out of building high-performance search systems. Whether you're working with vector search, hybrid retrieval, or traditional text search, this tool helps you **scientifically measure and optimize** your search performance.
13
23
14
-
To use the Retrieval Optimizer, you start with a labeled data set consisting of a corpus of texts, a set of natural language questions, and a collection of labels. You also define a set of search methods and embedding models to test against.
24
+
### 🎯 Why You Need This
15
25
16
-
The Retrieval Optimizer then lets you evaluate critical tradeoffs between **cost, speed, and latency**, helping you understand how different embedding models, retrieval strategies, and index configurations impact overall system performance. The tool's **Bayesian optimization** mode lets you fine-tune these index configurations. Ultimately, the tools let you implement **metrics-driven development** for your search applications — ensuring that decisions are grounded in data, not assumptions.
26
+
-**🔬 Evidence-Based Decisions**: Replace assumptions with hard data about what actually works for your use case
27
+
-**⚡ Performance Optimization**: Find the perfect balance between speed, accuracy, and cost
28
+
-**🤖 Smart Automation**: Use Bayesian optimization to intelligently explore the configuration space
29
+
-**📈 Comprehensive Metrics**: Track everything from latency to relevance with industry-standard evaluation metrics
30
+
-**🔧 Easy Integration**: Works with your existing Redis setup and popular embedding models
| Embedding model comparison |[00_comparison.ipynb](https://github.com/redis-applied-ai/redis-retrieval-optimizer/blob/main/docs/examples/comparison/00_comparison.ipynb)|
32
73
33
-
# Quick start
74
+
---
75
+
76
+
## 🚀 Quick Start
34
77
35
78
The Retrieval Optimizer supports two *study* types: **Grid** and **Bayesian Optimization**. Each is suited to a different stage of building a high-quality search system.
36
79
@@ -44,7 +87,7 @@ Once you've identified a solid starting point, use Bayesian optimization to **fi
44
87
45
88
## Running a Grid study
46
89
47
-
#### Define study config
90
+
#### Study config
48
91
```yaml
49
92
# paths to necessary data files
50
93
corpus: "data/nfcorpus_corpus.json"
@@ -105,7 +148,7 @@ metrics = run_grid_study(
105
148
## Running a Bayesian optimization
106
149
Selects the next best configuration to try based on a heuristic. This is good when it would take a very long time to test all possible configurations.
The Retrieval Optimizer includes threshold optimization capabilities for RedisVL's **Semantic Cache** and **Semantic Router**. This feature helps you automatically tune distance thresholds to maximize performance metrics like F1 score, precision, or recall.
281
+
282
+
### Cache Threshold Optimization
283
+
284
+
Optimize thresholds for semantic caches to improve cache hit rates and relevance:
285
+
286
+
```python
287
+
from redis_retrieval_optimizer.threshold_optimization import CacheThresholdOptimizer
288
+
from redisvl.extensions.cache.llm import SemanticCache
For complete documentation and examples, see [docs/examples/threshold_optimization](docs/examples/threshold_optimization/).
383
+
384
+
## 🔧 Custom Processors and Search Methods
236
385
237
386
The Retrieval Optimizer is designed to be flexible and extensible. You can define your own **corpus processors** and **search methods** to support different data formats and retrieval techniques. This is especially useful when working with domain-specific data or testing out experimental search strategies.
To run a retrieval study, you need three key datasets: **queries**, **corpus**, and **qrels**. The framework is flexible—data can be in any shape as long as you provide custom processors to interpret it. But if you're just getting started, here's the expected format and some working examples to guide you.
372
521
373
522
---
374
523
375
524
### Corpus
376
525
377
-
This is the full set of documents you'll be searching against. It’s what gets indexed into Redis. The default assumption is that each document has a `text` field to search or embed, but you can customize this using a corpus processor.
526
+
This is the full set of documents you'll be searching against. It's what gets indexed into Redis. The default assumption is that each document has a `text` field to search or embed, but you can customize this using a corpus processor.
378
527
379
528
**General structure**:
380
529
@@ -423,7 +572,7 @@ These are the search inputs you'll evaluate against the corpus. Each query consi
423
572
}
424
573
```
425
574
426
-
> 💡 Using custom query metadata? That’s fine—just make sure your custom search method knows how to interpret it.
575
+
> 💡 Using custom query metadata? That's fine—just make sure your custom search method knows how to interpret it.
427
576
428
577
---
429
578
@@ -461,7 +610,8 @@ Qrels define the relevance of documents to each query. They are required for eva
461
610
462
611
> 🔍 Note: Relevance scores can be binary (`1` or `0`) for classification metrics or ranked (`2`, `1`, etc.) for ranking metrics like NDCG.
463
612
464
-
# Contributing
613
+
## 🤝 Contributing
614
+
465
615
We love contributors if you have an addition follow this process:
0 commit comments