# Reranking with ZeroEntropy
[EN] Source: https://mastra.ai/examples/rag/rerank/reranking-with-zeroentropy

```typescript
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,
    },
  },
);
```

## Links

- [rerank() reference](/reference/rag/rerankWithScorer)
- [Retrieval docs](/docs/rag/retrieval)


---
title: "Example: Upsert Embeddings | RAG"
description: Examples of using Mastra to store embeddings in various vector databases for similarity search.
---

import GithubLink from "@site/src/components/GithubLink";
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";