> ## Documentation Index
> Fetch the complete documentation index at: https://supermemory.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Reranking

> Reranked search results in supermemory

Reranking is a feature that allows you to rerank search results based on the query.

<img src="https://mintcdn.com/supermemory/nafXZdsbm5CLncox/images/rerank.png?fit=max&auto=format&n=nafXZdsbm5CLncox&q=85&s=9bc650e2cfadf51d8bf0d4a06eeaf03d" alt="Reranking" width="1304" height="380" data-path="images/rerank.png" />

### Usage

In supermemory, you can enable answer rewriting by setting the `rerank` parameter to `true` in the search API.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.supermemory.ai/v3/search?q=What+is+the+capital+of+France?&rerank=true \
    --request GET \
    --header 'Authorization: Bearer SUPERMEMORY_API_KEY'
  ```

  ```typescript theme={null}
  await client.search.create({
    q: "What is the capital of France?",
    rerank: true,
  });
  ```

  ```python theme={null}
  client.search.create(
      q="What is the capital of France?",
      rerank=True
  )
  ```
</CodeGroup>

### Notes and limitations

* We currently use `bge-reranker-base` model for reranking.
* There is no additional costs associated with reranking.
* While reranking makes the quality much better, it also **incurs additional latency**.
* All other features like filtering, hybrid search, recency bias, etc. work with reranked results as well.
