Redefine Roles
The Redefine Roles LOP remaps the role column of messages passing through it. Each of the three standard roles (user, assistant, system) can be independently reassigned to any other role, making it easy to swap perspectives, merge role types, or reshape conversation history before it reaches a downstream operator.
Overview
Section titled “Overview”This is a lightweight passthrough operator. It reads an incoming conversation table, applies the role mappings defined on the Redefine Roles parameter page, and writes the result to its output. Messages with roles other than user, assistant, or system pass through unchanged. When Bypass is enabled, the input is copied directly to the output with no modifications.
Input/Output
Section titled “Input/Output”Inputs
Section titled “Inputs”- Conversation Table (Input 1): A table DAT with at least
roleandmessagecolumns. Optional columnsidandtimestampare preserved if present.
Outputs
Section titled “Outputs”- Conversation Table: The same conversation with roles remapped according to the current parameter settings. All other columns are copied through unchanged.
Usage Examples
Section titled “Usage Examples”Swapping User and Assistant Roles
Section titled “Swapping User and Assistant Roles”This is useful when you want to replay a conversation from the opposite perspective, or when handing off between agents that expect different role assignments.
- Place a Redefine Roles LOP in your network.
- Wire a conversation table into its input.
- On the Redefine Roles page, set Set User Role to
assistant. - Set Set Assistant Role to
user. - Leave Set System Role as
system. - The output table now has user and assistant roles swapped.
Collapsing System Messages into Assistant
Section titled “Collapsing System Messages into Assistant”Some models or workflows treat system messages differently. You can fold them into the assistant role so the model sees them as part of its own context.
- On the Redefine Roles page, set Set System Role to
assistant. - Leave Set User Role as
userand Set Assistant Role asassistant. - All original system messages now appear as assistant messages in the output.
Multi-Agent Handoff
Section titled “Multi-Agent Handoff”When passing a conversation from one agent to another, the second agent may need the first agent’s assistant messages to appear as user messages (since they represent instructions to the second agent).
- Wire the output of the first Agent LOP into the Redefine Roles input.
- Set Set Assistant Role to
user. - Wire the Redefine Roles output into the second Agent LOP.
- The second agent now sees the first agent’s responses as user instructions.
Common Use Cases
Section titled “Common Use Cases”- Swapping perspectives for multi-agent pipelines where one agent’s output becomes another’s input.
- Reassigning system messages to assistant or user for models that handle roles differently.
- Preprocessing conversation history before sending it to a Chat or Agent LOP.
- Experimenting with how role assignments affect model behavior.
Parameters
Section titled “Parameters”Redefine Roles
Section titled “Redefine Roles”Changelog
Section titled “Changelog”v1.0.02024-11-06
Initial release