What is Voyage AI?
Voyage AI is a leading provider of embedding models specifically designed for retrieval and Retrieval-Augmented Generation (RAG) applications. Their models consistently rank among the top performers on the MTEB (Massive Text Embedding Benchmark) leaderboard, outperforming models from OpenAI, Cohere, and other providers.
Founded by researchers from Stanford and top AI labs, Voyage AI focuses exclusively on creating best-in-class embedding models that deliver superior retrieval accuracy while maintaining efficient inference speeds.
Available Models
voyage-3
FlagshipThe most powerful general-purpose embedding model. Best-in-class retrieval performance across all domains with 1024 dimensions and 32K context length.
voyage-3-lite
Fast & EfficientOptimized for speed and cost-efficiency while maintaining strong retrieval quality. Perfect for high-volume applications and latency-sensitive use cases.
voyage-code-3
Code SpecialistSpecialized for code retrieval across 20+ programming languages. Optimized for code search, documentation lookup, and technical RAG applications.
voyage-finance-2
Finance DomainFine-tuned for financial documents including SEC filings, earnings reports, financial news, and regulatory documents.
voyage-law-2
Legal DomainOptimized for legal documents including contracts, case law, regulations, and legal research materials.
voyage-multilingual-2
100+ LanguagesBest-in-class multilingual embeddings supporting 100+ languages with strong cross-lingual retrieval capabilities.
Getting Started
# Install the Voyage AI SDK
# pip install voyageai
import voyageai
# Initialize the client
client = voyageai.Client(api_key="your-api-key")
# Generate embeddings for documents
documents = [
"Voyage AI provides state-of-the-art embedding models.",
"RAG applications benefit from high-quality embeddings.",
"Semantic search requires good vector representations."
]
# Embed documents
doc_embeddings = client.embed(
texts=documents,
model="voyage-3",
input_type="document"
)
# Embed a query
query = "What are embedding models used for?"
query_embedding = client.embed(
texts=[query],
model="voyage-3",
input_type="query"
)
# Access the vectors
print(f"Document embeddings shape: {len(doc_embeddings.embeddings)}x{len(doc_embeddings.embeddings[0])}")
print(f"Query embedding shape: 1x{len(query_embedding.embeddings[0])}")
print(f"Total tokens used: {doc_embeddings.total_tokens + query_embedding.total_tokens}")
RAG Integration Example
from langchain_voyageai import VoyageAIEmbeddings
from langchain_community.vectorstores import Chroma
from langchain.text_splitter import RecursiveCharacterTextSplitter
# Initialize Voyage AI embeddings
embeddings = VoyageAIEmbeddings(
voyage_api_key="your-api-key",
model="voyage-3"
)
# Split documents
text_splitter = RecursiveCharacterTextSplitter(
chunk_size=1000,
chunk_overlap=200
)
chunks = text_splitter.split_documents(documents)
# Create vector store with Voyage embeddings
vectorstore = Chroma.from_documents(
documents=chunks,
embedding=embeddings,
persist_directory="./chroma_db"
)
# Retrieve relevant documents
retriever = vectorstore.as_retriever(
search_type="similarity",
search_kwargs={"k": 5}
)
# Query the retriever
docs = retriever.invoke("What is the main topic?")
for doc in docs:
print(doc.page_content[:200])
Key Features
Query-Document Distinction
Separate embedding modes for queries and documents optimize retrieval accuracy by understanding the asymmetric nature of search.
Long Context Support
Up to 32K token context length allows embedding entire documents without chunking, preserving document-level semantics.
Domain-Specific Models
Specialized models for code, finance, and legal domains offer superior performance for industry-specific applications.
Fast Inference
Optimized inference infrastructure ensures low latency for real-time applications and high-throughput batch processing.
Model Comparison
| Model | Dimensions | Context | Best For | Price/1M tokens |
|---|---|---|---|---|
| voyage-3 | 1024 | 32K | General purpose, highest quality | $0.06 |
| voyage-3-lite | 512 | 16K | High volume, cost-sensitive | $0.02 |
| voyage-code-3 | 1024 | 16K | Code search, developer tools | $0.06 |
| voyage-finance-2 | 1024 | 16K | Financial documents | $0.06 |
| voyage-law-2 | 1024 | 16K | Legal documents | $0.06 |
| voyage-multilingual-2 | 1024 | 16K | Multi-language applications | $0.06 |
Common Use Cases
Semantic Search
Build intelligent search systems that understand meaning, not just keywords.
RAG Applications
Power retrieval-augmented generation with accurate context retrieval.
Chatbots & Assistants
Enable knowledge-grounded conversations with relevant context retrieval.
Resources
Related Topics
Test Your Knowledge
Score 8/10 or higher to pass
You need to be logged in to take this quiz.
Login to Continue