Embeddings PGVector

Embeddings PGVector

Certified

Store embeddings with pgvector

Uses the PostgreSQL pgvector extension to persist embeddings in the given table. drop=true recreates the table; optional IVF index (useIndex) defaults to false. Ensure pgvector extension is installed and the user can create tables/indexes.

yaml
type: io.kestra.plugin.ai.embeddings.PGVector

Ingest documents into a PGVector embedding store

yaml
id: document_ingestion
namespace: company.ai

tasks:
  - id: ingest
    type: io.kestra.plugin.ai.rag.IngestDocument
    provider:
      type: io.kestra.plugin.ai.provider.GoogleGemini
      modelName: gemini-embedding-001
      apiKey: "{{ secret('GEMINI_API_KEY') }}"
    embeddings:
      type: io.kestra.plugin.ai.embeddings.PGVector
      host: localhost
      port: 5432
      user: "{{ secret('POSTGRES_USER') }}"
      password: "{{ secret('POSTGRES_PASSWORD') }}"
      database: postgres
      table: embeddings
    fromExternalURLs:
      - https://raw.githubusercontent.com/kestra-io/docs/refs/heads/main/content/blogs/release-0-24.md
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-ai --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties

Database name

Name of the PostgreSQL database holding the embeddings table. No default: this property is required.

Database server host

Hostname or IP address of the PostgreSQL server running the pgvector extension. No default: this property is required.

Database password

Password of the database user. Store it as a Kestra secret rather than inline. No default: this property is required.

Database server port

TCP port the PostgreSQL server listens on. No default: this property is required.

Table name

Table that stores the embeddings. No default: this property is required. When drop is requested by the ingestion task, the table is recreated.

Database user

User connecting to the PostgreSQL database. No default: this property is required.

Defaultfalse

Use an IVFFlat index

If true, build an IVFFlat index on the embedding column. IVFFlat divides vectors into lists and searches only the lists closest to the query vector: it builds faster and uses less memory than HNSW, at the cost of a worse speed-recall tradeoff. Defaults to false.