TagRAG Chat
Chat your way to a better prompt — until ComfyUI restarts, anyway
- assistant_response
- current_prompt
- retrieved_tags
- history_summary
- status
TagRAG Prompt is one shot: idea in, prompt out, done. TagRAG Chat is the iteration loop. Type a message, get an answer, then say "make it more cinematic and add rim lighting" and it actually remembers what came before - and re-runs RAG retrieval on every single turn, so the conversation stays anchored to your CSV tag library instead of drifting into whatever the model happens to know.
This is the node you reach for when you're shaping one prompt through back-and-forth rather than starting from scratch each time. The "prompt enhancer" pattern is mainstream now - local LLM rewrites a rough idea into structured prompt text (the KB's llm-in-comfyui doc traces that whole lineage) - but Chat adds the missing piece: it keeps context between attempts, which is what most enhancer nodes don't do.
How it works
History lives in memory on the node instance, keyed by conversation_id (default default), and history_steps (default 6) bounds how many prior turns get sent to the model so the context window doesn't balloon. Every new message triggers a fresh retrieval: the pack reloads the CSV from the index_ref, pulls matching tags, and sends system + history + your current message (with the tag context block) to the backend. Then the reply gets appended to history for the next turn.
The lifecycle is the thing to internalize: it's all in-memory and nothing is written to disk. Restart ComfyUI, reload the workflow, or let ComfyUI recreate the node instance and your conversation is gone. That's by design. The reset flag (the only required input) clears history deliberately, and always_reset_on_load discards it on every call - handy when a reloaded workflow shouldn't carry stale state from a previous session.
Inputs that matter
- reset - required; flip true to wipe the current conversation.
- message - your next refinement request.
- index_ref - the JSON string from TagRAG Index.
- conversation_id - separates independent chats on the same node.
- history_steps - how many prior turns the model sees (default 6).
- model_path - local GGUF for the default native backend.
- generation_backend -
llama_cpp_python(default) orllama_serverfor a running llama.cpp server atbase_url(http://127.0.0.1:8080).
Outputs
assistant_response (the model's reply), current_prompt (the RAG context block actually sent to the model - great for seeing what influenced the answer), retrieved_tags, history_summary (the stored turns as JSON), and status.
Install
Same story as the rest of the pack. ComfyUI Manager - search comfyui-tag-rag - or:
cd ComfyUI/custom_nodes
git clone https://github.com/FrostySDXL/comfyui-tag-rag
cd comfyui-tag-rag
pip install -r requirements.txt
Restart after installing. The pack downloads no models; you supply a GGUF for generation (model_path) and your own embedding GGUF if you want semantic retrieval. llama-cpp-python in that requirements file is the one dependency that can fail to install on some platforms - the llama-server backend is the fallback for exactly that case. No cloud LLM, no API key, ever.
Where people get burned
- "My conversation disappeared." In-memory, see above. Chat is for shaping a prompt in one sitting, not for keeping a record. If the history vanishing mid-session matters, that's the pre-alpha reality of this node.
ERROR: message is required- you queued it with a blank message.resetalone is fine (it clears history and returns a status), but a chat turn needs text.- Stale history after a workflow reload. Set
always_reset_on_loadif you don't want old turns leaking into fresh runs. - Backend errors - same as the Prompt node:
llama-server request failedmeans checkbase_urland that the model is loaded server-side;model_patherrors mean the GGUF isn't where you pointed.
Honest take: if you only install one RAG node, it's not this one - TagRAG Prompt is the workhorse. Chat is for the fiddly "nudge it closer" sessions, and it's worth having when that's exactly what you're doing.
Inputs (31)
| Name | Type | Default | Description |
|---|---|---|---|
| reset | BOOLEAN | false | — |
| messageopt | STRING | — | |
| index_refopt | STRING | — | |
| always_reset_on_loadopt | BOOLEAN | false | — |
| conversation_idopt | STRING | default | — |
| base_urlopt | STRING | http://127.0.0.1:8080 | — |
| allow_remote_base_urlopt | BOOLEAN | false | — |
| retrieval_modeopt | COMBO | from_index | 4 options: from_index, lexical, semantic, hybrid |
| embedding_backendopt | COMBO | from_index | 3 options: from_index, llama_cpp_python, llama_server |
| embedding_model_pathopt | STRING | — | |
| embedding_n_ctxopt | INT | 2048256–262144 | — |
| embedding_n_gpu_layersopt | INT | -1-1–200 | — |
| embedding_base_urlopt | STRING | — | |
| embedding_modelopt | STRING | — | |
| embedding_endpoint_styleopt | COMBO | from_index | 3 options: from_index, openai_compatible, llama_cpp_legacy |
| generation_backendopt | COMBO | llama_cpp_python | 2 options: llama_cpp_python, llama_server |
| modelopt | STRING | — | |
| model_pathopt | STRING | — | |
| chat_formatopt | STRING | llama-2 | — |
| n_ctxopt | INT | 2048256–262144 | — |
| n_gpu_layersopt | INT | -1-1–200 | — |
| top_kopt | INT | 101–100 | — |
| max_tokensopt | INT | 5121–4096 | — |
| temperatureopt | FLOAT | 0.700–2 | — |
| top_popt | FLOAT | 0.950–1 | — |
| top_k_samplingopt | INT | 400–400 | — |
| repeat_penaltyopt | FLOAT | 1.101–5 | — |
| seedopt | INT | -1-1–2147483647 | — |
| timeout_secondsopt | FLOAT | 301–300 | — |
| system_prompt_overrideopt | STRING | — | |
| history_stepsopt | INT | 61–50 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| assistant_response | STRING | — |
| current_prompt | STRING | — |
| retrieved_tags | STRING | — |
| history_summary | STRING | — |
| status | STRING | — |