ByteChef LogoByteChef

PGVector

PGVector is an open-source PostgreSQL extension for vector similarity search.

Categories: Artificial Intelligence

Type: pgVector/v1


Connections

Version: 1

custom

Properties

NameLabelTypeDescriptionRequired
urlURLSTRINGThe JDBC URL of the PostgreSQL instance (e.g. jdbc:postgresql://localhost:5432/postgres).true
usernameUsernameSTRINGThe username for this connection.true
passwordPasswordSTRINGThe password for this connection.true
schemaNameSchema NameSTRINGThe name of the PostgreSQL schema that contains the vector store table.true
tableNameTable NameSTRINGThe name of the table to use for storing vectors.true
dimensionsDimensionsINTEGERThe number of dimensions in the embedding vector.true
distanceTypeDistance TypeSTRING
Options COSINE_DISTANCE, EUCLIDEAN_DISTANCE, NEGATIVE_INNER_PRODUCT
The distance function to use for similarity search.true
indexTypeIndex TypeSTRING
Options HNSW, IVFFLAT, NONE
The index algorithm to use for approximate nearest neighbor search.true
initializeSchemaInitialize SchemaBOOLEAN
Options true, false
Whether to initialize the schema on startup.true
maxDocumentBatchSizeMax Document Batch SizeINTEGERThe maximum number of documents to process in a single batch.true

Actions

Delete Documents

Name: delete

Delete documents from the vector store by metadata

Properties

NameLabelTypeDescriptionRequired
metadataFilterMetadata FilterARRAY
Items [{}]
List of metadata key-value pairs to filter by. Entries within a group are ANDed; groups are ORed.false

Example JSON Structure

{
  "label" : "Delete Documents",
  "name" : "delete",
  "parameters" : {
    "metadataFilter" : [ { } ]
  },
  "type" : "pgVector/v1/delete"
}

Output

This action does not produce any output.

Load Documents

Name: load

Loads documents into the vector store using LLM embeddings.

Properties

NameLabelTypeDescriptionRequired
metadataFilterMetadata FilterARRAY
Items [{}]
List of metadata key-value pairs to filter by. Entries within a group are ANDed; groups are ORed.false

Example JSON Structure

{
  "label" : "Load Documents",
  "name" : "load",
  "parameters" : {
    "metadataFilter" : [ { } ]
  },
  "type" : "pgVector/v1/load"
}

Output

This action does not produce any output.

Search Documents

Name: search

Query documents from the vector store using LLM embeddings.

Properties

NameLabelTypeDescriptionRequired
queryQuerySTRINGThe query to be executed.true
metadataFilterMetadata FilterARRAY
Items [{}]
List of metadata key-value pairs to filter by. Entries within a group are ANDed; groups are ORed.false
topKTop KINTEGERThe top 'k' similar results to return.false
similarityThresholdSimilarity ThresholdNUMBERSimilarity threshold score to filter the search response by. Only documents with similarity score equal or greater than the threshold will be returned. A threshold value of 0 means any similarity is accepted. A threshold value of 1 means an exact match is required.false

Example JSON Structure

{
  "label" : "Search Documents",
  "name" : "search",
  "parameters" : {
    "query" : "",
    "metadataFilter" : [ { } ],
    "topK" : 1,
    "similarityThreshold" : 0.0
  },
  "type" : "pgVector/v1/search"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Update Documents

Name: update

Updates documents in the vector store by deleting existing ones matching the metadata filter and loading new ones using LLM embeddings.

Properties

NameLabelTypeDescriptionRequired
metadataFilterMetadata FilterARRAY
Items [{}]
List of metadata key-value pairs to filter by. Entries within a group are ANDed; groups are ORed.false

Example JSON Structure

{
  "label" : "Update Documents",
  "name" : "update",
  "parameters" : {
    "metadataFilter" : [ { } ]
  },
  "type" : "pgVector/v1/update"
}

Output

This action does not produce any output.

How is this guide?

Last updated on

On this page