Class PostgresTableConfig

java.lang.Object
com.google.genkit.plugins.postgresql.PostgresTableConfig

public class PostgresTableConfig extends Object
Configuration for a PostgreSQL table used for vector storage.

This class configures how documents are stored in a PostgreSQL table with pgvector support.

Example usage:


 PostgresTableConfig config = PostgresTableConfig.builder().tableName("documents")
 		.embedderName("googleai/text-embedding-004").vectorDimension(768).distanceStrategy(DistanceStrategy.COSINE)
 		.build();
 
  • Method Details

    • builder

      public static PostgresTableConfig.Builder builder()
      Creates a new builder for PostgresTableConfig.
    • getTableName

      public String getTableName()
      Gets the table name.
    • getEmbedderName

      public String getEmbedderName()
      Gets the embedder name for generating vectors.
    • getVectorDimension

      public int getVectorDimension()
      Gets the vector dimension.
    • getDistanceStrategy

      public PostgresTableConfig.DistanceStrategy getDistanceStrategy()
      Gets the distance strategy for similarity search.
    • getIdColumn

      public String getIdColumn()
      Gets the ID column name.
    • getContentColumn

      public String getContentColumn()
      Gets the content column name.
    • getEmbeddingColumn

      public String getEmbeddingColumn()
      Gets the embedding column name.
    • getMetadataColumn

      public String getMetadataColumn()
      Gets the metadata column name.
    • isCreateTableIfNotExists

      public boolean isCreateTableIfNotExists()
      Returns whether to create the table if it doesn't exist.
    • isCreateIndexIfNotExists

      public boolean isCreateIndexIfNotExists()
      Returns whether to create the index if it doesn't exist.
    • getIndexLists

      public int getIndexLists()
      Gets the number of lists for IVFFlat index.
    • getAdditionalMetadata

      public Map<String,Object> getAdditionalMetadata()
      Gets additional metadata to add to all indexed documents.