vai logo
vai
Use CasesShared SpaceDocs
Get Started
Reranking
Retrieval
Model Selection

Standalone Reranking

Rerank intentionally messy candidate documents against a query, then compare the full reranker to the lite version to show the latency-precision tradeoff.

API key
View Source TapeOpen Docs
Prerequisites

A valid VOYAGE_API_KEY is set in the environment.

Under the hood

See the exact VAI command, the matching Voyage AI layer, and the MongoDB query shape behind the demo.

vai rerank 'how do I connect to MongoDB Atlas?' --documents 'Use the connection string from your Atlas dashboard' 'Python is a popular language' 'Atlas supports vectorSearch aggregation' 'Copy your URI and pass it to MongoClient' 'The weather in San Francisco is mild'

This tape strips away the vector-search stage so the reranker can be understood on its own. That makes the relevance behavior easier to spot than when reranking is buried inside a bigger retrieval stack.

Share or copy this demo

Keep it lightweight. The prepared text stays behind the buttons.

Open canonical URL

Share

Copy

LinkedIn opens the share dialog and copies the prepared text so you can paste it in quickly.

Exact commands

The full walkthrough is included here so anyone can replay the demo exactly as published.

$vai explain two-stage
$echo '=> rerank deliberately out-of-order documents against a query'
$vai rerank 'how do I connect to MongoDB Atlas?' --documents 'Use the connection string from your Atlas dashboard' 'Python is a popular language' 'Atlas supports vectorSearch aggregation' 'Copy your URI and pass it to MongoClient' 'The weather in San Francisco is mild'
$echo '=> unrelated docs scored near zero -- reranker understands meaning'
$echo '=> rerank-2.5-lite: faster. rerank-2.5: more accurate.'
$vai rerank 'how do I connect to MongoDB Atlas?' --documents 'Use the connection string from your Atlas dashboard' 'Copy your URI and pass it to MongoClient' --model rerank-2.5-lite
$echo '=> same ranking, lower latency -- choose based on precision needs'

Related demos

More shareable workflows from the same VAI demo library.

Retrieval
Reranking
Featured
Two-Stage Retrieval With Reranking

Walk through the classic retrieval stack: embed the query, run Atlas vector search, rerank the candidates, then compare the result to a vector-only pass.

Atlas
API key

VAI command

vai query 'how does vector search work?' --db vai_demo --collection knowledge --model voyage-4-lite

Show Under the Hood

Prerequisites

A valid VOYAGE_API_KEY is set in the environment.

View DemoSource
Model Discovery
Benchmarks
Models And Benchmarks

Survey the Voyage model lineup, explain benchmark context, and then measure embedding latency on your own hardware before choosing a production model.

API key

VAI command

vai benchmark embed --input 'What is the best way to index a large document corpus?'

Show Under the Hood

Prerequisites

A valid VOYAGE_API_KEY is set in the environment.