Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@
"icon": "share-nodes"
},
"documentation/hql/keyword_search",
{
"group": "Rerankers",
"expanded": false,
"pages": [
"documentation/hql/rerankers/overview"
],
"icon": "arrows-up-down"
},
Comment on lines +107 to +114
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Only includes overview page but PR contains rerank-mmr.mdx and rerank-rrf.mdx files that aren't referenced here

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs.json
Line: 107:114

Comment:
**style:** Only includes overview page but PR contains rerank-mmr.mdx and rerank-rrf.mdx files that aren't referenced here

How can I resolve this? If you propose a fix, please make it concise.

{
"group": "Traversals",
"expanded": false,
Expand Down
110 changes: 110 additions & 0 deletions documentation/hql/rerankers/overview copy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: This appears to be a duplicate file - the filename includes 'copy' which suggests it may be unintentional. Consider removing this file if documentation/hql/rerankers/overview.mdx contains the same content.

Prompt To Fix With AI
This is a comment left during a code review.
Path: documentation/hql/rerankers/overview copy.mdx
Line: 1:1

Comment:
**style:** This appears to be a duplicate file - the filename includes 'copy' which suggests it may be unintentional. Consider removing this file if documentation/hql/rerankers/overview.mdx contains the same content.

How can I resolve this? If you propose a fix, please make it concise.

title: "Rerankers Overview"

Check warning on line 2 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L2

Did you really mean 'Rerankers'?
description: "Improve search result quality by reordering results after initial retrieval."
icon: "arrows-up-down"
---

## What are Rerankers?

Check warning on line 7 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L7

Did you really mean 'Rerankers'?

Rerankers are powerful post-processing operations that improve the quality and diversity of search results by reordering them after the initial retrieval phase. They enable you to:

Check warning on line 9 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L9

Did you really mean 'Rerankers'?

- Combine results from multiple search strategies (hybrid search)
- Reduce redundancy by diversifying results
- Optimize the relevance-diversity trade-off
- Improve the overall user experience of your search application

## When to Use Rerankers

Check warning on line 16 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L16

Did you really mean 'Rerankers'?

Apply rerankers in your query pipeline when you need to:

Check warning on line 18 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L18

Did you really mean 'rerankers'?

- **Merge multiple search methods**: Combine vector search with BM25 keyword search, or merge results from multiple vector searches
- **Diversify results**: Eliminate near-duplicate content and show varied perspectives
- **Optimize ranking**: Fine-tune the balance between relevance and variety based on your use case
- **Improve search quality**: Leverage sophisticated ranking algorithms without changing your underlying search infrastructure

## Available Rerankers

Check warning on line 25 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L25

Did you really mean 'Rerankers'?

HelixQL provides two powerful reranking strategies:

Check warning on line 27 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L27

Did you really mean 'reranking'?

### RerankRRF (Reciprocal Rank Fusion)

A technique for combining multiple ranked lists without requiring score calibration. Perfect for hybrid search scenarios where you want to merge results from different search methods.

```rust
::RerankRRF() // Uses default k=60
::RerankRRF(k: 30.0) // Custom k parameter
```

[Learn more about RerankRRF →](/documentation/hql/rerankers/rerank-rrf)

### RerankMMR (Maximal Marginal Relevance)

A diversification technique that balances relevance with diversity to reduce redundancy. Ideal when you want to show varied results instead of similar or duplicate content.

```rust
::RerankMMR(lambda: 0.7) // Default cosine distance
::RerankMMR(lambda: 0.5, distance: "euclidean") // Custom distance metric
```

[Learn more about RerankMMR →](/documentation/hql/rerankers/rerank-mmr)

## Basic Usage Pattern

RRF Usage:
```rust focus=3
QUERY SearchDocuments(query_vec: [F64]) =>
results <- SearchV<Document>(query_vec, 100)
::RerankRRF() // Apply reranking
::RANGE(0, 10) // Get top 10 results
RETURN results
```

MMR Usage:

```rust focus=3
QUERY SearchDocuments(query_vec: [F64]) =>
results <- SearchV<Document>(query_vec, 100)
::RerankMMR(lambda: 0.7) // Apply reranking
::RANGE(0, 10) // Get top 10 results
RETURN results
```

## Chaining Rerankers

Check warning on line 72 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L72

Did you really mean 'Rerankers'?

You can chain multiple rerankers together for complex result optimization:

Check warning on line 74 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L74

Did you really mean 'rerankers'?

```rust focus={3-4}
QUERY AdvancedSearch(query_vec: [F64]) =>
results <- SearchV<Document>(query_vec, 150)
::RerankRRF(k: 60) // First: combine multiple rankings
::RerankMMR(lambda: 0.6) // Then: diversify results
::RANGE(0, 10)
RETURN results
```

## Best Practices

1. **Retrieve more results initially**: Fetch 100-200 candidates to give rerankers sufficient options to work with

Check warning on line 87 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L87

Did you really mean 'rerankers'?
2. **Apply rerankers before RANGE**: Rerank first, then limit the number of results returned

Check warning on line 88 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L88

Did you really mean 'rerankers'?

Check warning on line 88 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L88

Did you really mean 'Rerank'?
3. **Choose the right reranker**: Use RRF for combining searches, MMR for diversification

Check warning on line 89 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L89

Did you really mean 'reranker'?
4. **Test with your data**: Experiment with different parameters to find what works best for your use case

## Common Patterns

```rust
// Pattern 1: Simple diversification
SearchV<Document>(vec, 100)::RerankMMR(lambda: 0.7)::RANGE(0, 10)

// Pattern 2: Hybrid search fusion
SearchV<Document>(vec, 100)::RerankRRF()::RANGE(0, 10)

// Pattern 3: Fusion + diversification
SearchV<Document>(vec, 150)::RerankRRF()::RerankMMR(lambda: 0.6)::RANGE(0, 10)
```

## Next Steps

Explore the detailed documentation for each reranker:

Check warning on line 107 in documentation/hql/rerankers/overview copy.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview copy.mdx#L107

Did you really mean 'reranker'?

- [RerankRRF (Reciprocal Rank Fusion)](/documentation/hql/rerankers/rerank-rrf)
- [RerankMMR (Maximal Marginal Relevance)](/documentation/hql/rerankers/rerank-mmr)
99 changes: 99 additions & 0 deletions documentation/hql/rerankers/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: "Rerankers Overview"

Check warning on line 2 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L2

Did you really mean 'Rerankers'?
description: "Improve search result quality by reordering results after initial retrieval."
icon: "arrows-up-down"
---

## What are Rerankers?

Check warning on line 7 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L7

Did you really mean 'Rerankers'?

Rerankers are powerful post-processing operations that improve the quality and diversity of search results by reordering them after the initial retrieval phase. They enable you to:

Check warning on line 9 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L9

Did you really mean 'Rerankers'?

- Combine results from multiple search strategies (hybrid search)
- Reduce redundancy by diversifying results
- Optimize the relevance-diversity trade-off
- Improve the overall user experience of your search application

## When to Use Rerankers

Check warning on line 16 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L16

Did you really mean 'Rerankers'?

Apply rerankers in your query pipeline when you need to:

Check warning on line 18 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L18

Did you really mean 'rerankers'?

- **Merge multiple search methods**: Combine vector search with BM25 keyword search, or merge results from multiple vector searches
- **Diversify results**: Eliminate near-duplicate content and show varied perspectives
- **Optimize ranking**: Fine-tune the balance between relevance and variety based on your use case
- **Improve search quality**: Leverage sophisticated ranking algorithms without changing your underlying search infrastructure

## Available Rerankers

Check warning on line 25 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L25

Did you really mean 'Rerankers'?

HelixQL provides two powerful reranking strategies:

Check warning on line 27 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L27

Did you really mean 'reranking'?

### RerankRRF (Reciprocal Rank Fusion)

A technique for combining multiple ranked lists without requiring score calibration. Perfect for hybrid search scenarios where you want to merge results from different search methods.

```rust
::RerankRRF // Uses default k=60
::RerankRRF(k: 30.0) // Custom k parameter
```

### RerankMMR (Maximal Marginal Relevance)

A diversification technique that balances relevance with diversity to reduce redundancy. Ideal when you want to show varied results instead of similar or duplicate content.

```rust
::RerankMMR(lambda: 0.7)
```


## Basic Usage Pattern

RRF Usage:
```rust focus=3
QUERY SearchDocuments(query_vec: [F64]) =>
results <- SearchV<Document>(query_vec, 100)
::RerankRRF // Apply reranking
::RANGE(0, 10) // Get top 10 results
RETURN results
```

MMR Usage:

```rust focus=3
QUERY SearchDocuments(query_vec: [F64]) =>
results <- SearchV<Document>(query_vec, 100)
::RerankMMR(lambda: 0.7) // Apply reranking
::RANGE(0, 10) // Get top 10 results
RETURN results
```

## Chaining Rerankers

Check warning on line 68 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L68

Did you really mean 'Rerankers'?

You can chain multiple rerankers together for complex result optimization:

Check warning on line 70 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L70

Did you really mean 'rerankers'?

```rust focus={3-4}
QUERY AdvancedSearch(query_vec: [F64]) =>
results <- SearchV<Document>(query_vec, 150)
::RerankRRF(k: 60) // First: combine multiple rankings
::RerankMMR(lambda: 0.6) // Then: diversify results
::RANGE(0, 10)
RETURN results
```

## Best Practices

1. **Retrieve more results initially**: Fetch 100-200 candidates to give rerankers sufficient options to work with

Check warning on line 83 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L83

Did you really mean 'rerankers'?
2. **Apply rerankers before RANGE**: Rerank first, then limit the number of results returned

Check warning on line 84 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L84

Did you really mean 'rerankers'?

Check warning on line 84 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L84

Did you really mean 'Rerank'?
3. **Choose the right reranker**: Use RRF for combining searches, MMR for diversification

Check warning on line 85 in documentation/hql/rerankers/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (helix) - vale-spellcheck

documentation/hql/rerankers/overview.mdx#L85

Did you really mean 'reranker'?
4. **Test with your data**: Experiment with different parameters to find what works best for your use case

## Common Patterns

```rust
// Pattern 1: Simple diversification
SearchV<Document>(vec, 100)::RerankMMR(lambda: 0.7)::RANGE(0, 10)

// Pattern 2: Hybrid search fusion
SearchV<Document>(vec, 100)::RerankRRF::RANGE(0, 10)

// Pattern 3: Fusion + diversification
SearchV<Document>(vec, 150)::RerankRRF::RerankMMR(lambda: 0.6)::RANGE(0, 10)
```
Loading