Skip to main content
Learn how to configure similarity thresholds for optimal search results.

Understanding Thresholds

The threshold determines the minimum similarity score for results:
src/thresholds.ts

Threshold Guidelines

Default Threshold

Set a default threshold in configuration:
src/default-threshold.ts

Choosing the Right Threshold

For Tool Discovery

src/tool-discovery-threshold.ts
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
Start with a lower threshold (0.3-0.4) and increase it if you’re getting too many irrelevant results. It’s easier to filter down than to miss relevant documents.

Basic Search

Search fundamentals

Filtering

Filter by metadata

Performance

Optimize search