How to Create a Multi-Agent Flow with Superinterface

Setting up a multi-agent flow allows multiple assistants to work together, creating efficient and cohesive results. With Superinterface, you can easily build, configure, and link assistants to handle different parts of a task, all in just a few steps.
In this guide, we’ll set up a flow where multiple assistants work together to create a polished email. Our master assistant, "Email Generator," will coordinate the process, while subordinating assistants handle tasks like crafting subject lines and CTAs. Let’s get started.
Create a Multi-Agent Flow for an Email Generator

Step One: Create Your Subordinating Assistants

Before setting up the flow, you’ll need to create the subordinating assistants that will handle specific parts of the task. These assistants will be responsible for generating individual components, which the master assistant will bring together.
Create each subordinating assistant just like you would any other assistant. For detailed instructions on how to set one up, refer to our Create Assistant guide.
In our case, we are creating:
Email Subject Generator: Focused on crafting catchy subject lines.
CTA Generator: Specialized in generating compelling calls-to-action.
Once these subordinating assistants are set up with their own specific instructions, they’ll be ready to work alongside the master assistant.

Step Two: Set Up and Link the Master Assistant to Subordinating Assistants

Now, let’s set up the master assistant, which will coordinate everything, and connect it to the subordinating assistants for smooth collaboration.
    Create the master assistant: Go to the Assistants page, click "New Assistant," and name it something that reflects its role. We’ll use "Email Generator" as an example.
    Open the "Functions" tab: In the master assistant’s settings, click "New Function" to start linking up the subordinating assistants.
    Select "Super Interface Assistant" as the function type: This will allow the master assistant to call a subordinating one.
    Choose the appropriate subordinating assistant: For example, select "Email Subject Generator" to create subject lines.
    Rename the function if needed: Make sure the function name reflects its purpose. In our example, we’ll call it "CreateEmailSubject."
    Add a description: Include a brief explanation, such as "Generate an email subject." This step is important as it lets the master assistant know what to expect from calling this funciton.
    Click "Save": The function is now set up, and your master assistant can interact with the subordinating assistants. Repeat these steps to link other subordinating assistants, like the "CTA Generator."
With these functions in place, your master assistant is now fully equipped to coordinate tasks and bring together inputs from multiple assistants.

Step Three: Configure the Master Assistant’s Instructions

Ensure the master assistant knows when and how to use the subordinating assistants:
    Go back to the master assistant’s general settings.
    Update the instructions: Specify which subordinating assistants should the the master assistant call and when by specifying it in the instructions. For example, add "First call the CreateEmailSubject function before generating the rest of the email."
    Save your changes: This ensures everything is configured properly.

Testing the Multi-Agent Flow

Now let’s see if everything works together:
    Initiate a task with the master assistant: Request an email to be generated. For example, you could prompt, "I want an email for my surfboard shop's Valentine's Day sale."
    Monitor the interaction: Verify that the master assistant correctly calls the subordinating assistants, and they produce the expected output.
    Review and refine: Check the final result to ensure the process runs smoothly. Adjust any instructions or settings as needed.

Ready to Publish?

And there you have it! You’ve successfully set up a multi-agent flow that allows your assistants to collaborate seamlessly. If you're satisfied with your setup, it's time to add your assistant to your website.
Simply click Publish to integrate it with your site. For a detailed guide on how to publish, go to Publish Interface.