Nodes/ComfyUI Griptape Nodes/Griptape Vector Store Driver: MongoDB Atlas
ComfyUI Node

Griptape Vector Store Driver: MongoDB Atlas

MongoDB Atlas

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Vector Store Driver: MongoDB Atlas
  • embedding_driver
  • DRIVER
host_envMONGODB_HOST
username_envMONGODB_USERNAME
password_envMONGODB_PASSWORD
database_name_envMONGODB_DATABASE_NAME
collection_name_envMONGODB_COLLECTION_NAME
index_name_env_varMONGODB_INDEX_NAME
vector_path_envMONGODB_VECTOR_PATH

If your project already lives in MongoDB Atlas, this driver is the shortest path to adding semantic search - your vectors sit in the same database as everything else, searchable with the same credentials. It's the "one database to rule them all" play, and for a ComfyUI workflow it means the knowledge base your agent queries is the same Atlas cluster your app already writes to. If you're not an Atlas user, though, this is a lot of setup for what the Local driver does in a minute. There's also an "Azure MongoDB" sibling in this pack if you're on the Azure flavor, but this one is the vanilla Atlas path.

How it works

The node assembles a MongoDbAtlasVectorStoreDriver from a stack of environment variable names - seven of them, the most in the pack. They map cleanly onto what you'd find in the Atlas console:

  • host_env (MONGODB_HOST), username_env (MONGODB_USERNAME), password_env (MONGODB_PASSWORD) - the cluster host and credentials.
  • database_name_env (MONGODB_DATABASE_NAME) and collection_name_env (MONGODB_COLLECTION_NAME) - where the vectors live.
  • index_name_env_var (MONGODB_INDEX_NAME) and vector_path_env (MONGODB_VECTOR_PATH) - the Atlas Search index and the document field that holds the embedding.

Under the hood it builds a mongodb+srv://user:pass@host/db connection string and hands it to the driver. Output is DRIVER (VECTOR_STORE_DRIVER), wired through Griptape Structure ConfigCreate AgentGriptape Vector Store: Query.

Where it gets heavy

MongoDB Atlas doesn't make vector search automatic - you must create an Atlas Search index on the collection with the right vector field and dimensions before anything works. This is the driver's real cost: it assumes you've already configured Atlas, and the node won't hold your hand. The vector_path needs to match the document field your embedding writes to, and the dimensions need to match your embedding model. Get those right and it's smooth; get them wrong and every query returns nothing. And the embedding consistency rule applies as ever - same driver for indexing and querying, or retrieval is garbage.

One more thing that quietly trips people: every credential is an env var name, and the node reads all of them, so a single missing MONGODB_HOST produces a driver that connects to nothing. Set them all in ComfyUI's Settings → Griptape section (or your environment) rather than scattering them in the node fields.

Install

Pack install as always - ComfyUI Manager → search "Griptape" → INSTALL, or git clone https://github.com/griptape-ai/ComfyUI-Griptape into custom_nodes, restart. Dependencies come with it, and keep the README's torch fix in mind after install. Your Atlas cluster needs the MongoDB driver support that ships in griptape[all], so if the node throws an import error, updating griptape itself usually resolves it.

CategoryGriptape/Agent Drivers/Vector Store

Inputs (8)

NameTypeDefaultDescription
embedding_driveroptEMBEDDING_DRIVERSelect an embedding driver or leave as default.
host_envoptSTRINGMONGODB_HOSTEnvironment variable for MongoDB host
username_envoptSTRINGMONGODB_USERNAMEEnvironment variable for MongoDB username
password_envoptSTRINGMONGODB_PASSWORDEnvironment variable for MongoDB password
database_name_envoptSTRINGMONGODB_DATABASE_NAMEEnvironment variable for MongoDB database name
collection_name_envoptSTRINGMONGODB_COLLECTION_NAMEEnvironment variable for MongoDB collection name
index_name_env_varoptSTRINGMONGODB_INDEX_NAMEEnvironment variable for MongoDB index name
vector_path_envoptSTRINGMONGODB_VECTOR_PATHEnvironment variable for MongoDB vector path

Outputs (1)

NameTypeDescription
DRIVERVECTOR_STORE_DRIVER