Interface PostgresVectorStoreConfig

Configuration specific to the Postgres vector store.

interface PostgresVectorStoreConfig {
    type: "postgres";
    connectionString?: string;
    pool?: PgPoolLike;
    adapter?: StorageAdapter;
    poolSize?: number;
    defaultDimension?: number;
    similarityMetric?: "cosine" | "euclidean" | "dotproduct";
    tablePrefix?: string;
    manageSchema?: boolean;
    textSearchConfig?: string;
    iterativeScan?: "strict_order" | "relaxed_order";
    efSearch?: number;
    maxScanTuples?: number;
    id: string;
    customProps?: Record<string, any>;
}

Hierarchy (view full)

Properties

type: "postgres"

The type of the vector store provider (e.g., "pinecone", "weaviate", "in_memory", "lancedb"). This helps in selecting the correct implementation.

connectionString?: string

Postgres connection string. Required unless pool or adapter is given.

pool?: PgPoolLike

A pool the caller owns. The store opens none of its own, and close() leaves this one open.

adapter?: StorageAdapter

Open PostgreSQL adapter owned by the caller; exclusive with pool/connectionString. The store opens no pool of its own and close() leaves the adapter open. With pool or connectionString as well, initialize() throws.

poolSize?: number

Connection pool size when the store opens its own pool.

Default

10
defaultDimension?: number

Default embedding dimensions for new collections.

Default

1536
similarityMetric?: "cosine" | "euclidean" | "dotproduct"

Default similarity metric.

Default

'cosine'
tablePrefix?: string

Table name prefix for multi-tenancy.

Default

''
manageSchema?: boolean

When false the store runs no DDL: no CREATE EXTENSION, no collections table, and createCollection() does nothing. The caller's migrations make the tables from PostgresVectorStore.schemaSql, and the metric is read from similarityMetric.

Default

true
textSearchConfig?: string

Text search configuration of the lexical column and its queries.

Default

'english'
iterativeScan?: "strict_order" | "relaxed_order"

pgvector's iterative index scan (0.8.0 and later) for query() and hybridSearch(): the HNSW scan goes on until a filtered search has its rows. Without it pgvector filters after the scan and can return fewer than top-K.

efSearch?: number

hnsw.ef_search for a search (1 to 1000).

maxScanTuples?: number

hnsw.max_scan_tuples for an iterative scan.

id: string

A unique identifier for this specific provider instance (e.g., "pinecone-main-prod", "weaviate-dev-local"). This ID is used by the VectorStoreManager to retrieve this provider.

customProps?: Record<string, any>

Any other custom properties or configurations specific to this provider instance not covered by standard fields.