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/)
Extends
Implements
Constructors
new PGVectorStore()
new PGVectorStore(
config
):PGVectorStore
Parameters
• config: PGVectorStoreConfig
Returns
Overrides
Defined in
packages/llamaindex/src/vector-store/PGVectorStore.ts:165
Properties
embedModel
embedModel:
BaseEmbedding
Inherited from
Defined in
packages/llamaindex/src/vector-store/types.ts:104
storesText
storesText:
boolean
=true
Implementation of
VectorStoreNoEmbedModel
.storesText
Defined in
packages/llamaindex/src/vector-store/PGVectorStore.ts:154
Methods
add()
add(
embeddingResults
):Promise
<string
[]>
Adds vector record(s) to the table. NOTE: Uses the collection property controlled by setCollection/getCollection.
Parameters
• embeddingResults: BaseNode
<Metadata
>[]
The Nodes to be inserted, optionally including metadata tuples.
Returns
Promise
<string
[]>
A list of zero or more id values for the created records.
Implementation of
Defined in
packages/llamaindex/src/vector-store/PGVectorStore.ts:319
clearCollection()
clearCollection():
Promise
<any
[]>
Delete all vector records for the specified collection. NOTE: Uses the collection property controlled by setCollection/getCollection.
Returns
Promise
<any
[]>
The result of the delete query.
Defined in
packages/llamaindex/src/vector-store/PGVectorStore.ts:284
client()
client():
Promise
<IsomorphicDB
>
Connects to the database specified in environment vars. This method also checks and creates the vector extension, the destination table and indexes if not found.
Returns
Promise
<IsomorphicDB
>
A connection to the database, or the error encountered while connecting/setting up.
Implementation of
VectorStoreNoEmbedModel
.client
Defined in
packages/llamaindex/src/vector-store/PGVectorStore.ts:275
delete()
delete(
refDocId
,deleteKwargs
?):Promise
<void
>
Deletes a single record from the database by id. NOTE: Uses the collection property controlled by setCollection/getCollection.