Nodes/ComfyUI Griptape Nodes/Griptape RAG: Engine
ComfyUI Node

Griptape RAG: Engine

The RAG conductor — assemble retrieval, reranking, and answering in one node

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape RAG: Engine
  • query_stage_modules
  • retrieval_stage_modules
  • rerank_module
  • response_stage_modules
  • RAG_ENGINE

RAG - retrieval-augmented generation - is how you get an LLM to answer questions about your documents instead of just generating from memory. The RAG Engine node is the conductor for all of it: one node that takes a set of Griptape RAG modules, wires them into a pipeline, and hands out a ready-to-use RAG_ENGINE that a structure or task can query. If you've ever wanted ComfyUI to "read the manual and answer questions from it," this is the orchestration layer.

Here's the thing that confuses people on first contact: this node has no inputs of its own. Its four optional inputs are all module lists - other Griptape nodes you assemble into it:

  • query_stage_modules - modules that modify the user's question before retrieval (like the Translate Module).
  • retrieval_stage_modules - the modules that actually find relevant chunks in your documents or vector store.
  • rerank_module - one optional module that re-sorts retrieved chunks so the best material rises to the top.
  • response_stage_modules - modules that turn the retrieved chunks into a final answer (prompt, footnote, or raw-chunks modules).

How it works

Under the hood the node builds a Griptape RagEngine from whatever stages you provided. Each non-empty stage gets its own stage object (QueryRagStage, RetrievalRagStage, ResponseRagStage), with the rerank module attached to retrieval. Wire nothing in and you get a bare engine that does nothing; wire in a retrieval module plus a response module and you have a working "ask questions of my documents" pipeline. The stages are also sequential by design: query stage first, retrieval second, response last.

What you actually build

A minimal working RAG setup in this pack needs two things this engine can't see alone: a retrieval module (text-loader or vector-store based - the retrieval module nodes are siblings of this one in the pack's RAG menu) and a response module (Prompt Response or Footnote Prompt Response). Plug those into the matching inputs, optionally add a rerank module and a prompt driver, and the RAG_ENGINE output becomes the knowledge brain of an agent or a query task.

The honest warning: this node is the glue, not the payload. If you wire only the engine into a workflow with no modules, you'll get a pipeline that silently returns nothing. Assemble all the stages or the magic doesn't happen - which is the most common "why is it broken" moment with this node.

Installing it

Pack install: ComfyUI Manager → GriptapeComfyUI-Griptape, restart, or

cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape

Dependencies (griptape[all], python-dotenv) install automatically.

Common issues

The empty-engine trap above is #1 - a RAG engine with no modules is a no-op. Second: mixing module types wrong, like feeding a response module into query_stage_modules; the stages expect specific kinds and miswiring just produces weird results. And the pack-wide pains: griptape[all] can clobber ComfyUI's torch (reinstall with the cu121 wheels), and stale griptape versions show up as import errors - python -m pip install griptape -U and restart.

CategoryGriptape/RAG

Inputs (4)

NameTypeDefaultDescription
query_stage_modulesoptMODULE_LIST(Optional) Used for modifying user queries. For example, translating the query to another language.
retrieval_stage_modulesoptMODULE_LISTModules Used for retrieving relevant documents and re-ranking results.
rerank_moduleoptMODULE(Optional) Module used for re-ranking results.
response_stage_modulesoptMODULE_LISTModules used to append metadata, rulesets, generate responses, or adding footnotes.

Outputs (1)

NameTypeDescription
RAG_ENGINERAG_ENGINE