Nodes/ComfyUI Griptape Nodes/Griptape RAG Retrieve: Text Loader Module
ComfyUI Node

Griptape RAG Retrieve: Text Loader Module

Feed your own documents to a ComfyUI agent

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape RAG Retrieve: Text Loader Module
  • vector_store_driver
  • MODULE
loaderTextLoader
namespacedefault
count5
text
input_sourceText Input
file_path
urlhttps://griptape.ai

This is the node that turns a chunk of text, a file, a PDF, or even a website into something your Griptape agent can actually search. If you've ever wanted to ask a ComfyUI agent questions about your own notes, a spec, or a manual instead of just hoping the model knows the answer, this is where RAG (retrieval-augmented generation) starts.

It's not a full node by itself. It's one module in the Griptape RAG engine's "retrieval stage" - the stage that takes a source document, chops it into chunks, stuffs those chunks into a vector store, and returns the ones most relevant to the query. You wire its MODULE output into a Griptape Rag Engine node's retrieval_stage_modules input, then hand that engine to a Griptape Rag Tool, then give the tool to an agent. A bit of plumbing, but it's the whole point of this pack: LLM agent stuff as visual nodes.

How it works

Under the hood it builds a TextLoaderRetrievalRagModule from the Griptape framework. You pick a loader, give it a source, and it loads, chunks, embeds, and retrieves against whatever vector store driver you connect. If you connect no vector store driver at all, the pack falls back to a local vector store backed by a dummy embedding driver - which means retrieval degrades to something closer to keyword matching. For real semantic search, connect a proper vector store + embedding driver from one of the driver config nodes.

The inputs that matter

  • loader - TextLoader, CsvLoader, PdfLoader, or WebLoader. For WebLoader you use the url field (defaults to https://griptape.ai, which is a fun way to discover you forgot to change it).
  • input_source - Text Input (paste into the text port) or File Path. If you pick File Path, the file_path dropdown is a file picker scoped to ComfyUI's input directory, filtered to sensible formats (txt, md, csv, pdf, yaml, json, and friends).
  • namespace - which bucket of the vector store to search. Default "default".
  • count - how many results to return. Default 5. Bump it if your agent keeps coming back under-informed.

Output is a single MODULE of type MODULE_LIST, which the Rag Engine expects for its retrieval stage.

Installing

Grab the whole pack via ComfyUI Manager (search "Griptape") or:

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

Restart ComfyUI. The installer pulls in griptape[all], python-dotenv, and openai - the griptape dependency chain is heavy, so the first install takes a while. For local models you'll also want Ollama running (ollama run llama3).

Common gotchas

The pack installs torch as part of its dependency chain, and on Nvidia that can clobber ComfyUI's torch. If nodes start erroring on import, reinstall torch against your CUDA:

pip uninstall torch
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121

And if you see ImportError: cannot import name 'OllamaPromptDriver', the griptape library didn't update - reinstall the pack from Manager or python -m pip install griptape -U. If you're on StabilityMatrix, the torch fix lives in its Packages → Python Packages panel instead of the terminal.

CategoryGriptape/RAG

Inputs (8)

NameTypeDefaultDescription
loaderCOMBOTextLoaderThe type of text to load. If TextLoader or CsvLoader, it won't use the Text Input Port.
vector_store_driveroptVECTOR_STORE_DRIVER
namespaceoptSTRINGdefaultNamespace of the vector store.
countoptINT5Total number of results to return.
textoptSTRINGText to be loaded.
input_sourceoptCOMBOText InputUse a specified file path or the text input port.
file_pathoptCOMBOFile to be loaded.
urloptSTRINGhttps://griptape.aiURL to be loaded.

Outputs (1)

NameTypeDescription
MODULEMODULE_LIST