AI PGVector

AI 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
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.