I built this multi-agent system using Semantic Kernel and its new multi-agent functionality. This was actually the first time I'd tried to use Semantic Kernel, having previously used other agent frameworks like Azure OpenAI Assistants and AutoGen. I found Semantic Kernel to be remarkably elegant, and the amount of code I actually had to write to make this work was minimal. However, because the multi-agent framework in Semantic Kernel was brand new, it was challenging to find documentation or sample code (and GitHub Copilot knew nothing about it, having never seen it before). Nonetheless, I was able to put it together in just a couple of hours, and it works remarkably well, making this part of my job much easier.
- Question answerer
- Answer Checker
- Link Checker
- Manager
Each plays a crucial role in ensuring the accuracy and reliability of the system's responses. The process begins with the Question Answerer agent, which attempts to provide an initial answer. This is then scrutinized by the Answer Checker agent. Both the Question Answerer and the Answer Checker agent are grounded in public data sources, as I gave them both the ability to search the web using Bing. The Link Checker agent ensures that any provided links are valid, addressing a common issue of hallucinated links. Finally, the Manager agent oversees the entire operation, making the final decision on the answer's validity.
As you can see in the above video, some questions can provoke an "agent debate," where different agents disagree with each other. When a debate occurs, the Manager agent forces a rewrite cycle. I capped this cycle at a total of 25 agent interactions - although only once have I been able to provoke such a long-running debate. Usually, the agents come to an agreement within one or two turns.