Griptape RAG Retrieve: Text Loader Module
Feed your own documents to a ComfyUI agent
- vector_store_driver
- MODULE
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, orWebLoader. For WebLoader you use the url field (defaults tohttps://griptape.ai, which is a fun way to discover you forgot to change it). - input_source -
Text Input(paste into the text port) orFile 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| loader | COMBO | TextLoader | The type of text to load. If TextLoader or CsvLoader, it won't use the Text Input Port. |
| vector_store_driveropt | VECTOR_STORE_DRIVER | — | |
| namespaceopt | STRING | default | Namespace of the vector store. |
| countopt | INT | 5 | Total number of results to return. |
| textopt | STRING | Text to be loaded. | |
| input_sourceopt | COMBO | Text Input | Use a specified file path or the text input port. |
| file_pathopt | COMBO | File to be loaded. | |
| urlopt | STRING | https://griptape.ai | URL to be loaded. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODULE | MODULE_LIST | — |