Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

Reranking with ZeroEntropy

import {
rerankWithScorer as rerank,
ZeroEntropyRelevanceScorer
} from "@mastra/rag";

const results = rerank({
results: searchResults,
query: "deployment configuration",
scorer: new ZeroEntropyRelevanceScorer('zerank-1'),
{
topK: 5,
weights: {
semantic: 0.4,
vector: 0.4,
position: 0.2,
},
},
);

On this page