Skip to content

PostgreSQL (pgvector)

<dependency>
<groupId>com.google.genkit</groupId>
<artifactId>genkit-plugin-postgresql</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
  • PostgreSQL 12+ with the pgvector extension installed
  • Java 21+
import com.google.genkit.plugins.postgresql.PostgreSQLPlugin;
Genkit genkit = Genkit.builder()
.plugin(PostgreSQLPlugin.create(
"jdbc:postgresql://localhost:5432/mydb",
"user", "password"))
.build();
  • Cosine, L2, and inner product similarity search
  • Automatic schema management
  • Connection pooling
  • Batch indexing
  • Metadata support

See the postgresql sample.