Skip to main content
Load data to embed directly from a column in the source table. This is the most common loading method for embedding textual content stored in your database.

Samples

Load from a text column

SELECT ai.create_vectorizer(
    'blog_posts'::regclass,
    loading => ai.loading_column('content'),
    embedding => ai.embedding_openai('text-embedding-3-small', 768),
    chunking => ai.chunking_character_text_splitter(512)
);

Load from multiple tables

-- For products table
SELECT ai.create_vectorizer(
    'products'::regclass,
    loading => ai.loading_column('description'),
    embedding => ai.embedding_openai('text-embedding-3-small', 768)
);

-- For reviews table
SELECT ai.create_vectorizer(
    'reviews'::regclass,
    loading => ai.loading_column('review_text'),
    embedding => ai.embedding_openai('text-embedding-3-small', 768)
);

Arguments

NameTypeDefaultRequiredDescription
column_nameTEXT-Name of the column containing the data to load

Returns

A JSON configuration object for use in create_vectorizer().