The Problem with Fixed Top-K
Traditional search returns a fixed number of results:How Adaptive Retrieval Works
Adaptive retrieval analyzes the score distribution of results to find natural cutoff points:CLI Usage
Adaptive retrieval is enabled by default:Tuning Adaptive Behavior
Adaptive Strategies
Five strategies are available for different use cases:Combined (Default)
Balances multiple signals for best overall performance:- Uses both relative and absolute thresholds
- Applies cliff detection as secondary signal
- Best for general-purpose search
Relative
Cuts off at a percentage of the top score:- Default threshold: 50% of top score
- Good for consistent corpora
- Example: Top score 0.92 → cutoff at 0.46
Absolute
Uses a fixed score cutoff:- Cuts at specified minimum score
- Good when you know your quality threshold
- Predictable behavior across queries
Cliff
Detects sharp drops in score distribution:- Looks for score drops > 30% between consecutive results
- Best for distinct topic clusters
- Works well when relevant docs are clearly separated
Elbow
Finds the inflection point in the score curve:- Uses curve analysis to find natural groupings
- Good for gradual score distributions
- Mathematically principled approach
Strategy Comparison
SDK Usage
Python
Node.js
Understanding Results
Adaptive retrieval adds metadata to help you understand decisions:When to Disable Adaptive
Some scenarios work better with fixed top-k:Pagination
When paginating through results:Comparison
When comparing result counts across queries:RAG Context Building
When you need a specific context window:Tuning for Your Data
High-Precision Needs
For applications where false positives are costly:High-Recall Needs
For applications where missing results is costly:Exploratory Search
For browsing and discovery:Performance Considerations
Adaptive retrieval adds minimal overhead:
The algorithm runs on the score array after retrieval, so it doesn’t slow down the actual search.
Combining with Other Features
With Sketch Pre-filtering
With Hybrid Search
With Time Filtering
Best Practices
Start with Defaults
The defaultcombined strategy works well for most cases:
Tune Based on Feedback
If you’re getting too many results:Monitor with JSON Output
Check adaptive decisions to understand behavior:Troubleshooting
”Adaptive returns too few results”
-
Lower
min-relevancy: -
Increase
max-k: -
Try
relativestrategy:
“Adaptive returns too many results”
-
Raise
min-relevancy: -
Use
cliffstrategy: - Consider if your query is too broad
”Results vary unexpectedly between queries”
This is expected - adaptive adjusts to each query’s score distribution. For consistent counts, use:Next Steps
Search & Ask
Complete search command reference
Deduplication
How Memvid prevents duplicate content