Enable vectorization for a table definition

You can extend a table definition to be searchable via semantic similarity, using vector search. This allows you to use the table as a knowledge source in an AI agent.

Vector search can be a useful technical approach to provide your AI agent with context. However, it may not always be the best suited one.

Do use vectorization when you want to search a large body of unstructured data.

Do not use vectorization to search structured data. If you have a table that contains structured data (for example, sales orders, containing data about customer, product, dates, etc.), use an AI tool of type Table Definition.

Prerequisites

  • You are using PostgreSQL or Microsoft SQL Server as your database and have installed and enabled the pgvector extension (PostgreSQL) or the experimental vector feature (Microsoft SQL Server).

  • You have set up an embedding model with output type vector in the Model tool.

Enable vectorization

  1. Open the Table Definition tool and open the table you want to vectorize.

  2. Go to the Properties tab and enter edit mode.

  3. Select Vector Store.

    Result: A dialog opens to configure the vectorization.

  4. Select Enable Vectorization of this table.

    Result: A custom column named rowVector is added to the table, and a custom routine is hooked to CREATE/UPDATE operations to perform the vectorization automatically.

  5. In Vectorizer, select an AI model that performs the vectorization. Only models with output type vector are available.

  6. In Columns to vectorize, select the columns that contain text you want to make searchable. Typically these are your free-text columns.

  7. In Result template, define how a matching row is rendered when returned to an agent as a knowledge result.

Example

You have created a table that contains the text of instruction manuals, chunked into overlapping segments of 1024 characters. The table has the following fields:

  • filename: The name of the instruction manual

  • productName: The name of the product

  • pageNr: The page the chunk is found on

  • chunkIdx: The index of the chunk

  • chunkTxt: The text of the chunk

Configure vectorization as follows:

  • Columns to vectorize: productName, chunkTxt

  • Result template:

    === {filename} / Instruction manual for {productName}
    Found on page nr. {pageNr}
    {chunkTxt}

The semantic representation captures both product name and chunk content. When the agent returns a result, it has enough metadata to point the user to the correct file and page.

Add an index on the vector column

If the embedding model has a fixed vector dimension set, and you are using PostgreSQL with pgvector, you can add an index on the rowVector column. This enables fast, approximate semantic search using the HNSW index type internally.

Using an index provides a significant speedup for similarity search, but requires caution when combined with WHERE clauses — filtering is applied after the approximate search.

Refer to the pgvector documentation for more details. To combine WHERE clauses and a vector index, consider enabling an iterative scan by running SET hnsw.iterative_scan = strict_order in your database.