TOOL WIKI · DATA & RETRIEVAL

Voyage AI

Provides embedding and reranking models for retrieval applications.

Download example files Code + setup + checks in a ZIP
Jump to a section 10 sections

EXAMPLE USE CASE

Rank policy snippets using query/document embeddings

A policy assistant needs usable source text or relevant evidence before a generation model can answer a question reliably.

Input
A question, two candidate texts and one configured embedding model.
Expected output
Similarity scores with the matching source snippets in ranked order.
  • Success check: The query/document embedding roles are explicit and use the same model.
  • Try a failure: Mixing dimensions or embedding models must fail before distance comparisons.

Example scope: Actual hosted embeddings with explicit query/document roles.

Official reference · Voyage AI

WHAT IT ISEmbedding and retrieval models
WHERE IT FITSData & retrieval
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
inputprocessresultcheckoutputSource materialFiles or textVoyage AIEmbedding and retrieval modelsPrepared recordsText, chunks, or vectorsRetrieval storageIndex + metadataQuery pipelineScoped evidence lookupEvaluationInspect source fidelity
  1. Preserve provenance, input format, and access-control metadata.

  2. Choosing a model layer for semantic search over a specific corpus. Benchmark retrieval with your content and language distribution.

  3. Validate the component-specific output, including failed or empty records.

  4. Store derived data with source version and deletion information.

  5. Use compatible query processing and tenant-scoped filtering.

  6. Check extraction quality, retrieval recall, and answer grounding separately.

    Result or stopping point
Voyage AI

Choosing a model layer for semantic search over a specific corpus. Benchmark retrieval with your content and language distribution.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

When to consider it

  • Choosing a model layer for semantic search over a specific corpus.

A design decision to make

  • Benchmark retrieval with your content and language distribution.

Prerequisites and setup

  • A Voyage API key and an enabled text embedding model. Two embedding requests are made when you run the sample.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install voyageai
export VOYAGE_API_KEY="YOUR_KEY"
export VOYAGE_MODEL="YOUR_ENABLED_EMBEDDING_MODEL"

Try a small integration

embed.py

Python · embed.py
import os
import math
import voyageai

client = voyageai.Client(api_key=os.environ["VOYAGE_API_KEY"])
documents = ["Returns are accepted within 30 days.","Shipping normally takes five days."]
model = os.environ["VOYAGE_MODEL"]
vectors = client.embed(documents,model=model,input_type="document").embeddings
query = client.embed(["What is the return deadline?"],model=model,input_type="query").embeddings[0]
def cosine(a,b):
    assert len(a) == len(b)
    return sum(x*y for x,y in zip(a,b))/(math.sqrt(sum(x*x for x in a))*math.sqrt(sum(y*y for y in b)))
print(sorted([(cosine(query,v),documents[i]) for i,v in enumerate(vectors)],reverse=True))

Run and check the result

Shell
python embed.py
  • The query/document embedding roles are explicit and use the same model.
  • Inspect vector dimensions before creating the database column/index.

Common failures

  • A successful parse job does not prove table/reading-order accuracy; compare output with the original page.
  • Enforce file-size, duration and memory limits. Treat extracted text as untrusted content rather than instructions.

Production decisions

  • Preserve document ID, version, page/section, access scope and parser/model configuration alongside each chunk or vector.
  • Evaluate extraction and retrieval separately. Test tables, scans, empty documents, duplicates, malformed input and source deletion.

Keep exploring

Retrieval that can ask a better questionA context pipeline for a long-running agent

Explore the same layer

UnstructuredDoclingLlamaParseSentence Transformers

Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.