Posted in

How-to avoid to many responses from Copilot Studio connected agents

In my previous blog post I looked at Multi-Agent solution using Copilot Studio. That design worked fine but most of the time you would get answers from the connected agents first, and then a consolidated answer from the main agent, the orchestrator. That’s not very user-friendly. What we want is to collect the responses from the connected agents and then have the orchestrator agent generate a consolidated response.

My scenario was like this:

Main agent
├─➤ Agent A → speaks
├─➤ Agent B → speaks
├─➤ Agent C → speaks
└─➤ Main agent summarizes

So I ended up with one answer from each connected agent, and then a consolidated answer from the main agent, the orchestrator.
I tried using a topic, and calling the agent from there, but that gave the same result.

I then created an Agent Flow for each agent, called the Agent Flow from a topic. Within the Agent Flow I used the “Execute Agent and wait” action to call the agent, wait for a response, send the response back to the agent. 

I can then store the response in a global variable within the topic and have the orchestrator agent create a consolidated answer from all the connected agents.
I have tested making Agent Flows for a couple of the connected agents, and this design seems to be working.

So I will end up with something like this:

Main Agent (Orchestrator)
├─ Topic > Call Flow: Agent_Policy_Analysis
├─ Topic > Call Flow: Agent_Legal_Interpretation
├─ Topic > Call Flow: Agent_Product_Knowledge
├─ Topic > Call Flow: Agent_Risk_Assessment
├─ Topic > Call Flow: Agent_Pricing_Rules

One consolidated summary to the user.

It’s not super fast but it gives one consolidated answer to the user instead of 5-6 answers. So a bit more user friendly.

4 thoughts on “How-to avoid to many responses from Copilot Studio connected agents

  1. Hi Arild

    Thank you for the solution. But can you please elaborate the above steps more because most of the time flow is getting time out and throwing an error. It will be easy for us to implement the step-by-step process.

      1. Error getting is : “Action ‘Respond_to_the_agent’ failed: The execution of template action ‘Respond_to_the_agent’ is failed: the client application timed out waiting for a response from service. This means that workflow took longer to respond than the alloted timeout value. The connection maintained between the client application and service will be closed and client application will get an HTTP status code 504 Gateway Timeout.”

        1. Hi, there is a 100 second timeout limit for your flow to respond to the agent. So the error means that your flow is taking more then a 100 seconds to reach the Respond to agent node. It’s probably your connected agent that uses more than 100 seconds to do it’s thing.
          If your connected agent needs more than 100 second to respond you could try moving the Respond to the agent node above the Execute Agent and wait node. That way the Agent flow will no timeout. Your Execute and wait action will continue to execute, and then try adding the Execute agent node below that with the conversation ID of the original conversation from your main agent. You would need to send the conversation Id in as a parameter from when you originally call the Agent Flow. Hope this made sense 🙂 I have not tried this so I have no idea if it will actually work.
          There is also a new function in preview, if you look at the When an agent calls the flow node there is a switch the for Express mode, that is supposed to speed up your flow, I guess it will not help for your case since it probably the connected agent that uses more that 100 seconds to respond

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US