Nodes/ComfyUI Griptape Nodes/Griptape Vector Store Driver: PGVector
ComfyUI Node

Griptape Vector Store Driver: PGVector

The self-hosted vector store for people who already run Postgres

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Vector Store Driver: PGVector
  • embedding_driver
  • DRIVER
table_namegriptape_vectors
host_envPOSTGRES_HOST
user_envPOSTGRES_USER
pass_envPOSTGRES_PASSWORD
port_envPOSTGRES_PORT
name_envPOSTGRES_DB

This is the driver for people who already run Postgres and think adding a vector database is absurd when they have a perfectly good one. The pgvector extension turns Postgres into a vector store without a second system to manage, and this node is how a Griptape agent reaches it. It's the most "infrastructure you already own" option in the pack - if you're self-hosting and your docs are already in Postgres, this is likely the right call. If you don't have Postgres running, though, the Local driver is a far better starting point than standing up a database just to test RAG.

How it works

The node builds a PgVectorVectorStoreDriver with a connection string assembled from environment variable names, plus one field typed directly:

  • table_name (default griptape_vectors) - the one input not read from env. The table the driver stores vectors in. If it doesn't exist, the driver creates it - a small but real convenience versus the other drivers.
  • host_env (POSTGRES_HOST), user_env (POSTGRES_USER), pass_env (POSTGRES_PASSWORD), port_env (POSTGRES_PORT), name_env (POSTGRES_DB) - the connection bits, all as env var names.

Under the hood it composes postgresql://user:pass@host:port/db and hands it to the driver. Output is DRIVER (VECTOR_STORE_DRIVER), wired through Griptape Structure ConfigCreate AgentGriptape Vector Store: Query.

The non-negotiables

Two things are on you before this node does anything useful. First, the pgvector extension has to actually exist in your Postgres - CREATE EXTENSION IF NOT EXISTS vector; in the target database. The driver can create the table, but it can't install the extension. Second, the embedding dimension story that haunts every driver in this pack applies here with extra teeth: once the table is created with a column sized to your embedding model, changing models means dealing with schema, not just config. Pick your embedding driver first and don't churn on it. And keep that same embedding driver wired into both Add Text and Query - mismatched embedders produce a store that "works" and returns noise.

One honest note on effort: of all the drivers, this one has the most moving parts outside the node - a Postgres server, the extension, the right privileges for the user in your env vars. It's the right tool when Postgres is already your home base, not the one to reach for on a whim.

Install

Pack install is the usual drill: ComfyUI Manager → search "Griptape" → INSTALL, or git clone https://github.com/griptape-ai/ComfyUI-Griptape into custom_nodes, restart. Dependencies (griptape[all], python-dotenv) install with it, and if ComfyUI starts erroring post-install, the README's torch fix is the standard remedy. Your Postgres side needs pgvector installed on the server and the extension enabled in the database - that's the part no node in this pack will do for you.

CategoryGriptape/Agent Drivers/Vector Store

Inputs (7)

NameTypeDefaultDescription
embedding_driveroptEMBEDDING_DRIVERSelect an embedding driver or leave as default.
table_nameoptSTRINGgriptape_vectorsName of the table to store vectors
host_envoptSTRINGPOSTGRES_HOSTEnvironment variable name for the PostgreSQL host
user_envoptSTRINGPOSTGRES_USEREnvironment variable name for the PostgreSQL user
pass_envoptSTRINGPOSTGRES_PASSWORDEnvironment variable name for the PostgreSQL password
port_envoptSTRINGPOSTGRES_PORTEnvironment variable name for the PostgreSQL port
name_envoptSTRINGPOSTGRES_DBEnvironment variable name for the PostgreSQL database name

Outputs (1)

NameTypeDescription
DRIVERVECTOR_STORE_DRIVER