Node Details

  • Name: postgresRecordManager

  • Type: Postgres RecordManager

  • Version: 1.0

  • Category: Record Manager

Parameters

Input Parameters

  1. Host (string, required)

    • The hostname of the PostgreSQL server
  2. Database (string, required)

    • The name of the database to connect to
  3. Port (number, optional)

    • The port number for the PostgreSQL server

    • Default: 5432

  4. Additional Connection Configuration (JSON, optional)

    • Additional configuration options for the PostgreSQL connection
  5. Table Name (string, optional)

    • The name of the table to use for storing records

    • Default: “upsertion_records”

  6. Namespace (string, optional)

    • A namespace for the records

    • If not specified, the chatflowid will be used

  7. Cleanup (options, optional)

    • Specifies the cleanup method for old content

    • Options:

      • None: No cleanup of old content

      • Incremental: Delete previous versions if content has changed

      • Full: Same as incremental, but also deletes records if source document is deleted

    • Default: “none”

  8. SourceId Key (string, optional)

    • Key used to get the true source of the document

    • Default: “source”

Credential Parameters

  • User: PostgreSQL username

  • Password: PostgreSQL password

Functionality

The PostgresRecordManager provides the following main functions:

  1. createSchema(): Creates the necessary table and indexes in the database if they don’t exist.

  2. update(keys, updateOptions): Updates or inserts records for the given keys.

  3. exists(keys): Checks if records exist for the given keys.

  4. listKeys(options): Lists keys based on specified options (before, after, limit, groupIds).

  5. deleteKeys(keys): Deletes records for the given keys.

  6. end(): Terminates the database connection.

Usage

This node is typically used in workflows where you need to keep track of document insertions, updates, or deletions in a vector database. It’s particularly useful for:

  1. Incremental updates to vector stores

  2. Tracking which documents have been processed

  3. Managing document versions

  4. Implementing cleanup strategies for outdated embeddings

By using PostgreSQL as the backend, it provides a robust and scalable solution for managing record metadata in large-scale vector database operations.

Note

Ensure that you have the necessary PostgreSQL credentials and permissions set up before using this node. The node will automatically create the required table and indexes if they don’t exist in the specified database.