Skip to main content
Use a Voyage AI model to generate retrieval-optimized embeddings for your vectorizer.

Purpose

  • Define which Voyage AI model to use
  • Specify the dimensionality of the embeddings
  • Configure the model’s truncation behavior and API key name
  • Configure the input type (query vs document)

Samples

Basic Voyage AI embedding

SELECT ai.create_vectorizer(
    'blog_posts'::regclass,
    loading => ai.loading_column('content'),
    embedding => ai.embedding_voyageai('voyage-3-lite', 512),
    chunking => ai.chunking_character_text_splitter(512)
);

With custom API key name

SELECT ai.create_vectorizer(
    'documents'::regclass,
    loading => ai.loading_column('content'),
    embedding => ai.embedding_voyageai(
        'voyage-3',
        1024,
        api_key_name => 'MY_VOYAGE_API_KEY'
    ),
    chunking => ai.chunking_character_text_splitter(512)
);

With input type

SELECT ai.create_vectorizer(
    'search_content'::regclass,
    loading => ai.loading_column('text'),
    embedding => ai.embedding_voyageai(
        'voyage-3',
        1024,
        input_type => 'document'
    ),
    chunking => ai.chunking_character_text_splitter(512)
);

Arguments

NameTypeDefaultRequiredDescription
modeltext-Name of the Voyage AI model to use (e.g., voyage-3-lite, voyage-3)
dimensionsint-Number of dimensions for the embedding vectors
input_typetext'document'Type of input text: null, 'query', or 'document'
api_key_nametextVOYAGE_API_KEYName of the environment variable containing the Voyage AI API key

Returns

A JSON configuration object for use in create_vectorizer().