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

# rerank-2

> Voyage AI's rerank-2 is a multilingual reranker with a 16,000-token context. Call Voyage AI's API to rerank the results you query from a Pinecone index.

[Back to all models](https://docs.pinecone.io/models/overview.md)

![Voyage AI](https://cdn.sanity.io/images/vr8gru94/production/f2bce9e78e611fb34bf845928f6ede4cc377a8a5-100x100.png)

# rerank-2

Voyage AI
Reranking
Bring your own vectors

Specifications

<dl />

## When to use it

Generalist reranker optimized for quality with multilingual support. See [blog post](https://blog.voyageai.com/2024/09/30/rerank-2/) for details. Visit the [Voyage documentation](https://docs.voyageai.com/docs/reranker) for an overview of all Voyage embedding models and rerankers.

## Quickstart

### Installation

```python theme={null}
!pip install -qU voyageai pinecone
```

### Rerank

```python theme={null}
import voyageai

# These are the documents returned from a search using Pinecone
documents = [
		"Apple is a popular fruit known for its sweetness and crisp texture.",
		"The tech company Apple is known for its innovative products like the iPhone.",
		"Many people enjoy eating apples as a healthy snack.",
		"Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.",
		"An apple a day keeps the doctor away, as the saying goes."
]

query = "Tell me about the tech company known as Apple"

co = voyageai.Client(api_key=VOYAGE_API_KEY)
reranked_docs = vo.rerank(
    query=query,
    documents=documents,
    model="rerank-2",
    top_k=3
)

```

## Good to know

To generate vectors, use Voyage AI's Python client with a Voyage AI API key. [Register](https://dash.voyageai.com/) to get one.
