
Voyage AI Rerank Tutorial: Fix RAG That Finds the Right Chunk but Ranks It Too Low
Also available in Hindi: यह लेख हिंदी में पढ़ें
A common RAG failure: the chunk with the answer is retrieved, but at position 7, and your app only sends the top 3 to the model. A reranker fixes this without re-indexing anything. Voyage AI's rerank models read the question and each candidate together and score how relevant each one is.
Why a reranker helps
Embedding search encodes the query and documents separately, which is fast but rough. Voyage's rerankers are cross-encoders: they process each query-document pair jointly, so scores are more accurate. The usual pattern is two stages: search wide, then rerank a short list.
Add rerank-3 to your search
Create a key in the API keys section of the Voyage dashboard, then:
pip install -U voyageai
export VOYAGE_API_KEY="your-key"
import voyageai
vo = voyageai.Client() # reads VOYAGE_API_KEY
query = "Can I get a refund if my order arrives late?"
candidates = my_vector_search(query, k=50) # your existing search
docs = [c["text"] for c in candidates]
res = vo.rerank(query, docs, model="rerank-3", top_k=5)
for r in res.results:
print(round(r.relevance_score, 3), candidates[r.index]["source"])
best_chunks = [candidates[r.index] for r in res.results]
results come back sorted by relevance_score, highest first. Use r.index to map each result back to your own chunk, so you keep page URLs and other metadata. Then put only best_chunks into the prompt.
Which model, and what it costs
Voyage released rerank-3 and rerank-3-lite on 30 September 2026. Voyage recommends rerank-3 for most apps; the lite model is for latency-sensitive ones. Both keep the 32K context and instruction-following of rerank-2.5, and Voyage says scores are calibrated to match rerank-2.5, so tuned thresholds keep working. You can add an instruction to the query, such as asking it to prefer official policy pages.
Billing counts query tokens × documents plus all document tokens. Reranking 50 chunks of 400 tokens with a 20-token query is about 21,000 tokens, roughly $0.001 on rerank-3 by our arithmetic. Watch one default: truncation=True silently cuts over-long inputs. Set it to False if you would rather get an error.
Related reads: Pinecone keyword plus semantic search, Qdrant hybrid search and Chroma for local RAG, or visit the Voyage AI tool page.
Sources
- Rerankers, Pricing and API key and Python client, Voyage AI docs
- rerank-3 and rerank-3-lite, Voyage AI blog
- Voyage Rerank 3 on AI Gateway, Vercel changelog (independent)
FAQ
Do I need Voyage embeddings to use the reranker?
No. It takes plain text candidates, so they can come from any vector database or BM25 search.
How many candidates should I rerank?
Voyage's own tests reranked up to 100 candidates and kept the top 10. Up to 1,000 are allowed per request.
Is there a free tier?
Yes. The pricing page lists 200 million free tokens per account for rerank-3 and rerank-3-lite.
Should I switch from rerank-2.5?
Voyage recommends it: same price, no code changes, better quality in its tests.