Understanding Thresholds
The threshold determines the minimum similarity score for results:src/thresholds.ts
Threshold Guidelines
| Threshold | Use Case | Results |
|---|---|---|
| 0.7+ | High precision, exact matches | Few, highly relevant |
| 0.5-0.7 | Balanced precision/recall | Moderate, mostly relevant |
| 0.3-0.5 | High recall, broader matches | Many, some tangential |
| < 0.3 | Exploratory, catch-all | Most documents |
Default Threshold
Set a default threshold in configuration:src/default-threshold.ts
Choosing the Right Threshold
For Tool Discovery
src/tool-discovery-threshold.ts
For Document Search
src/document-search-threshold.ts
For Recommendations
src/recommendations-threshold.ts
Adaptive Thresholds
Adjust thresholds based on query characteristics:src/adaptive-threshold.ts
Debugging Threshold Issues
Too Few Results
src/debug-few-results.ts
Too Many Irrelevant Results
src/debug-many-results.ts
Related
Basic Search
Search fundamentals
Filtering
Filter by metadata
Performance
Optimize search