Agent group chats in Semantic Kernel allow you to orchestrate conversations between multiple AI agents, each with its own role and instructions. This enables you to create complex workflows and automate tasks that require collaboration between different AI personalities.
An agent group chat is initiated by creating an AgentGroupChat
instance and adding participating agents. You can then provide an initial message to start the conversation. The chat then proceeds according to the configured SelectionStrategy
and TerminationStrategy
.
The SelectionStrategy
determines which agent gets to respond next in the conversation. This can be a simple round-robin approach or a more sophisticated strategy based on the conversation history and the agents' roles.
Semantic Kernel provides two built-in selection strategies:
The TerminationStrategy
defines the conditions under which the chat ends. This could be after a certain number of turns, when a specific goal is achieved, or when a particular agent provides a certain response.
Semantic Kernel offers these built-in termination strategies: