Conversational multi-agent systems allow AI assistants to collaborate, providing feedback, reasoning, and emergent behaviors. The GPT Assistants Playground supports both siloed (separate) and conversational (interactive) assistants, enabling structured and dynamic workflows.

The following example demonstrates how two AI assistants collaborate over a shared thread to debug and verify Python code.
Example Code: agentic_conversation_btree.py
import py_trees
import textwrap
import time
from playground.api import create_thread, create_assistant_action_on_thread, create_assistant_condition_on_thread
root = py_trees.composites.Sequence("RootSequence", memory=True)
bug_file = """
# code not shown
"""
thread = create_thread() #1
debug_code = create_assistant_action_on_thread( #2
thread=thread,
action_name="Debug code",
assistant_name="Python Debugger",
assistant_instructions=textwrap.dedent(f"""
Here is the code with bugs in it:
{bug_file}
Run the code to identify the bugs and fix them.
Be sure to test the code to ensure it runs without errors or throws any exceptions.
"""),
)
root.add_child(debug_code)
verify = create_assistant_condition_on_thread( #3
thread=thread,
condition_name="Verify",
assistant_name="Python Coding Assistant",
assistant_instructions=textwrap.dedent(
"""
Verify the solution fixes the bug and there are no more issues.
Verify that no exceptions are thrown when the code is run.
Reply with SUCCESS if the solution is correct, otherwise return FAILURE.
If you are happy with the solution, save the code to a file called fixed_bug.py.
""",
),
)
root.add_child(verify)
tree = py_trees.trees.BehaviourTree(root)
while True:
tree.tick()
if root.status == py_trees.common.Status.SUCCESS:
break #4
time.sleep(20)Code Breakdown
By leveraging multi-agent conversation, you enable AI assistants to collaborate efficiently, ensuring faster debugging and enhanced automation.