Class: PGVectorStore
Provides support for writing and querying vector data in Postgres. Note: Can't be used with data created using the Python version of the vector store (https://docs.llamaindex.ai/en/stable/examples/vector_stores/postgres.html)
Implements
Constructors
new PGVectorStore()
new PGVectorStore(
config
?):PGVectorStore
Constructs a new instance of the PGVectorStore
If the connectionString
is not provided the following env variables are
used to connect to the DB:
PGHOST=your database host
PGUSER=your database user
PGPASSWORD=your database password
PGDATABASE=your database name
PGPORT=your database port
Parameters
• config?
The configuration settings for the instance.
• config.connectionString?: string
The connection string (optional).
• config.dimensions?: number
The dimensions of the embedding model.
• config.schemaName?: string
The name of the schema (optional). Defaults to PGVECTOR_SCHEMA.
• config.tableName?: string
The name of the table (optional). Defaults to PGVECTOR_TABLE.
Returns
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:47
Properties
collection
private
collection:string
=""
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:22
connectionString
private
connectionString:undefined
|string
=undefined
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:25
db?
private
optional
db:Client
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:28
dimensions
private
dimensions:number
=1536
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:26
schemaName
private
schemaName:string
=PGVECTOR_SCHEMA
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:23
storesText
storesText:
boolean
=true
Implementation of
Source
packages/core/src/storage/vectorStore/PGVectorStore.ts:20