Nodes/ComfyUI Griptape Nodes/Griptape Embedding Driver: Google
ComfyUI Node

Griptape Embedding Driver: Google

Google's text-embedding-004, one dropdown and one task type away

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Embedding Driver: Google
    • DRIVER
    embedding_modeltext-embedding-004
    task_typeRETRIEVAL_QUERY
    google_api_key_env_varGOOGLE_API_KEY

    Griptape Embedding Driver: Google is the small, tidy one: it produces embeddings from Google's text-embedding-004 model with a single API key, and its most interesting input is a dropdown most people skip. If your team already pays for Google AI / Gemini API access, this is the natural embedding driver - one key, no deployment naming, no region juggling.

    It's a good "middle of the road" choice: a solid managed embedding model without AWS-style setup. The only thing it gives up is choice - the model dropdown has one entry, and the whole driver is built around it.

    How it works

    Configuration node, pack-standard: it builds an EMBEDDING_DRIVER object that downstream RAG and vector-store nodes use to convert text into vectors. Nothing is called until something downstream uses the driver.

    The inputs:

    • embedding_model - text-embedding-004, the only option. Google's current general-purpose embedding model.
    • task_type - this is the one that's easy to ignore and worth understanding. Google's embedding API is task-aware, and the type you pick changes how the model optimizes the vectors: RETRIEVAL_QUERY (default, for the search side), RETRIEVAL_DOCUMENT (for the documents being searched), SEMANTIC_SIMILARITY, CLASSIFICATION, or CLUSTERING. For RAG, the standard move is query-type on your search text and document-type on your corpus - mixing them up degrades retrieval quality silently.
    • google_api_key_env_var - env-var name for GOOGLE_API_KEY, not the key itself. The README points at makersuite.google.com to create one.

    Installing

    Ships in the ComfyUI Griptape Nodes pack:

    • ComfyUI Manager: search "Griptape" → install ComfyUI-Griptape.
    • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/griptape-ai/ComfyUI-Griptape, then restart.

    Pack dependencies: griptape[all], openai, python-dotenv, plus git-hosted extensions. The torch caveat applies pack-wide (reinstall torch with the CUDA index if Griptape's install breaks ComfyUI's build - README troubleshooting).

    Gotchas

    The task_type field is where the quality lives and where people get burned: using RETRIEVAL_QUERY for everything, including the documents you embed, gives you decent-looking but measurably worse retrieval. Also, text-embedding-004 has a token-per-minute quota that free-tier keys hit fast if you embed a large corpus - that's throttling, not a bug. One more thing: this driver is locked to Google's model, so if your workflow needs to swap embedding models on the fly, you'll want a different driver per model rather than hoping this one adapts.

    CategoryGriptape/Agent Drivers/Embedding

    Inputs (3)

    NameTypeDefaultDescription
    embedding_modeloptCOMBOtext-embedding-004Select the embedding model to use.
    task_typeoptCOMBORETRIEVAL_QUERYSelect the task type for the embedding.
    google_api_key_env_varoptSTRINGGOOGLE_API_KEYEnvironment variable for the Google API key. Do not use your actual API key here.

    Outputs (1)

    NameTypeDescription
    DRIVEREMBEDDING_DRIVER