Griptape Replace: Rulesets on Agent
Swap your agent's personality mid-workflow
- agent
- rulesets
- AGENT
Rulesets are how you tell a Griptape agent who it is - the instructions, tone, and constraints it carries into every response. This node lets you replace an agent's rulesets wholesale, mid-graph, instead of building a whole new agent from scratch.
The "Replace" in the name is doing real work. This is not "append a rule to the stack." It rebuilds the agent with whatever rulesets you connect, dropping the old ones entirely. So if one branch of your workflow needs a terse technical writer and another needs a sycophantic marketing voice, you can feed the same base agent through two of these with different rulesets and get two very different personalities out of the same model. Same brain, different job.
It's also how you remove rules - connect an agent and leave rulesets empty, and you get the agent back with a clean slate.
How it works
The node grabs the connected agent's config, conversation memory, task memory, and tools, then constructs a fresh agent using your new rulesets. Everything else carries over. The output is an AGENT you can wire into any Run node - Griptape Run: Agent, a task node, wherever. The node is marked as an output node, so it also stops the graph cleanly when you're done with it.
The inputs
- agent - the agent whose rules you're replacing. If you leave it disconnected, the node falls back to a default agent, which is usually not what you want.
- rulesets - the replacement rulesets. Comes from ruleset-building nodes or the Griptape Retrieve: Cloud Ruleset node. Leave empty to wipe the agent's rules.
Output: one AGENT.
Installing
Part of the ComfyUI-Griptape pack. ComfyUI Manager → search "Griptape" → Install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
Restart ComfyUI after installing. The pack installs griptape[all] plus python-dotenv, and that dependency tree is chunky - budget a few minutes for the first install.
Common gotchas
Because this replaces rather than merges, the classic mistake is connecting a ruleset list you meant to be additive and wondering where your other rules went. Keep a dedicated branch for rules you want to preserve, or use the pack's Combine Rulesets / Rules List nodes to merge before replacing.
Otherwise it's the usual pack-wide suspects: torch version conflicts on Nvidia (reinstall with the cu121 index if imports break) and the stale-griptape error where cannot import name 'OllamaPromptDriver' shows up - fix with python -m pip install griptape -U.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| agentopt | AGENT | The agent to replace the rules for. | |
| rulesetsopt | RULESET | The rulesets to replace the agent's rules with. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| AGENT | AGENT | Text response from the Agent |