# pinecone-rerank-v0

````
### Installation

```python theme={null}
pip install -U pinecone
```

### Rerank

```python theme={null}
from pinecone import Pinecone

pc = Pinecone("API-KEY")

query = "Tell me about Apple's products"
results = pc.inference.rerank(
    model="pinecone-rerank-v0",
    query=query,
    documents=[
"Apple is a popular fruit known for its sweetness and crisp texture.",	
"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.",
    ],
    top_n=3,
    return_documents=True,
    parameters= {
        "truncate": "END"
    }
)

print(query)
for r in results.data:
  print(r.score, r.document.text)

```
````

Lorem Ipsum

## Related pages

- [Account management](./account-management-index.md)
- [Admin](./admin-2-index.md)
- [Admin](./admin-index.md)
- [APIs](./apis-index.md)
- [Architecture](./architecture-index.md)
- [Assistants](./assistants-index.md)
- [Bring Your Own Cloud](./bring-your-own-cloud-index.md)
- [Build an assistant](./build-an-assistant-index.md)
- [Build an integration](./build-an-integration-index.md)
- [Changelog](./changelog-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
