Griptape RAG Response: Prompt Module
Turn retrieved chunks into a real LLM response
- prompt_driver
- rulesets
- MODULE
This is the module that makes RAG feel like RAG. Retrieval finds the chunks, but chunks alone aren't an answer - something has to read them and write a response grounded in them. The Response Prompt Module is that something: it takes the retrieved text, hands it to an LLM with your rules, and produces the final answer. If you're building a "chat with my documents" workflow, this is the heart of it.
It's a response-stage module, so it plugs into response_stage_modules on the Griptape RAG Engine, which runs it last. The retrieved chunks arrive here already ranked and filtered, and your answer comes out.
The inputs that matter
prompt_driver- the LLM that writes the answer. Any of the pack's prompt drivers works. If you leave it empty, the module falls back to an OpenAI GPT-4o driver, same silent default as the query translate module: it works without wiring, but it assumesOPENAI_API_KEYexists in your environment and spends tokens against it. Wire in a driver explicitly - an Ollama or Groq driver keeps it free or fast.rulesets- optional Griptape rules (from the pack's rules nodes) that shape the response. This is how you say "answer only from the provided text," "be concise," or "never invent citations." For a beginner, a single "answer strictly from the context, don't speculate" rule does more to improve output quality than any sampling knob in the pack.
How it works
Under the hood it constructs a Griptape PromptResponseRagModule. On each query, the engine passes the retrieved text chunks plus your rules to the configured driver, and the driver generates the answer conditioned on that context. This is the textbook RAG response stage, no surprises.
What it outputs
A MODULE_LIST (it's a list even though you built one module - response stages accept several, and the engine expects lists). Wire it into response_stage_modules on the RAG Engine.
Installing it
Ships in the pack - ComfyUI Manager → Griptape → ComfyUI-Griptape, restart, or
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
Common issues
The fallback-driver surprise is the big one: no prompt_driver wired means you're silently using OpenAI, so either set the driver deliberately or expect the API bill. Second, if answers read like the model ignored your documents, check the rulesets - without a grounding rule, the LLM will happily pad from general knowledge. And remember this module is only one stage: no retrieval module on the engine means nothing reaches this module, and you get a confident answer with nothing behind it. Pack-wide torch/version issues apply as usual.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_driveropt | PROMPT_DRIVER | Prompt driver to use for the module. | |
| rulesetsopt | RULESET | One or more rules to use with RAG. Use these to control the RAG response. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODULE | MODULE_LIST | — |