Nodes/ComfyUI Griptape Nodes/Griptape Tool: Extraction
ComfyUI Node

Griptape Tool: Extraction

Turning messy agent output into clean CSV or JSON

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Tool: Extraction
  • prompt_driver
  • TOOL
extraction_typejson
column_names
template_schema

The Extraction tool is what you reach for when you want the agent to do the reading, but you want the data, not a paragraph. Give it an instruction like "pull out every name, age and email from what I just told you," and it returns structured output - CSV or JSON - instead of a wall of prose. If you're building pipelines that feed agent results into spreadsheets, dashboards, or other nodes, this is the tool that makes that possible.

Here's the thing that trips people up: this tool doesn't extract from a file or a URL you give it. It extracts from the agent's task memory - the conversation and context the agent has accumulated up to that point. That's why it plugs into agent flows rather than standing alone. And a small confession from the source code: the pack's own description for this node is a copy-paste of the Prompt Summary tool's description ("Summarizes information found in Task Memory"). It's wrong. This is an extraction tool. Don't let the mislabeled description confuse you - the behavior is CSV/JSON extraction, full stop.

How it works

The node builds an ExtractionTool backed by either a CSV or JSON extraction engine. You pick the format and provide the schema for what to pull; the tool then runs the model over the task memory and returns structured rows or objects. A fun detail: the node appends the rule "Raw output please" to keep the model from prettying up the answer into prose.

The inputs that matter

  • extraction_type - csv or json, default json. This decides which engine gets built.
  • column_names - for CSV. A comma-separated list like name, age. Required-ish: with no columns the CSV engine has nothing to extract.
  • template_schema - for JSON. A schema template like {"name": str, "age": int} that tells the model the shape to return.
  • prompt_driver - optional, and the one gotcha to watch. If you leave it empty, the node silently falls back to OpenAiChatPromptDriver with gpt-4o-mini - which means you need an OpenAI key set, or extraction will fail. Plug in your own PROMPT_DRIVER (e.g. an Ollama driver) to extract locally.

Note there's no off_prompt on this node - the subclass removes it - so the extraction runs in the agent's context by design.

One output, TOOL (TOOL_LIST), feeds an agent.

Install

Same pack, same story:

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

or ComfyUI Manager → search "Griptape" → install → restart.

Where people get burned

Two things, both from the defaults. First, forgetting the prompt_driver and assuming it runs locally - it defaults to OpenAI, so either wire in a local driver or have a key ready. Second, expecting the extracted data to show up on the tool node itself. It won't; the tool returns data into the agent's flow. If you want the structured result out of the graph, you'll typically pair this with the agent's response handling and a text/pass-through node that surfaces what the agent produced. Also give the schema real thought - vague schemas produce vague extraction. {"name": str, "age": int} works far better than an empty template.

CategoryGriptape/Agent Tools

Inputs (4)

NameTypeDefaultDescription
prompt_driveroptPROMPT_DRIVER
extraction_typeoptCOMBOjson2 options: csv, json
column_namesoptSTRINGComma separated list of column names to extract. Example: name, age
template_schemaoptSTRINGSchema template for the json extraction. Example: {"name": str, "age": int}

Outputs (1)

NameTypeDescription
TOOLTOOL_LIST