Skip to content

Commit e80d4f1

Browse files
committed
Updated units and knowledge check
1 parent 1bd2ce0 commit e80d4f1

File tree

5 files changed

+79
-170
lines changed

5 files changed

+79
-170
lines changed

learn-pr/wwl-data-ai/orchestrate-sk-multi-agent-solution/6-knowledge-check.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,36 @@ durationInMinutes: 3
1212
content: |
1313
quiz:
1414
questions:
15-
- content: ""
15+
- content: "Which of the following options best describes an agent in the Semantic Kernel Agent Framework?"
16+
choices:
17+
- content: "A human-controlled interface for interacting with AI models"
18+
isCorrect: false
19+
explanation: "Incorrect. Agents in the framework are not human-controlled; they are autonomous systems designed to process input and complete tasks."
20+
- content: "A storage system used to manage user data"
21+
isCorrect: false
22+
explanation: "Incorrect. Agents do not function as data storage systems; they perform tasks based on user interaction and intent."
23+
- content: "An autonomous system that interacts with users and performs specific tasks based on user input and intent"
24+
isCorrect: true
25+
explanation: "Correct. In the Semantic Kernel Agent Framework, agents are autonomous systems that interact with users, interpret input, and perform tasks tailored to the user's needs."
26+
- content: "How does the Semantic Kernel Agent Framework select the right agent for a task?"
1627
choices:
17-
- content: ""
18-
isCorrect: true
19-
explanation: ""
20-
- content: ""
21-
isCorrect: false
22-
explanation: ""
23-
- content: ""
24-
isCorrect: false
25-
explanation: ""
26-
- content: ""
27-
choices:
28-
- content: ""
29-
isCorrect: true
30-
explanation: ""
31-
- content: ""
32-
isCorrect: false
33-
explanation: ""
34-
- content: ""
35-
isCorrect: false
36-
explanation: ""
37-
- content: ""
38-
choices:
39-
- content: ""
40-
isCorrect: true
41-
explanation: ""
42-
- content: ""
43-
isCorrect: false
44-
explanation: ""
45-
- content: ""
46-
isCorrect: false
47-
explanation: ""
48-
28+
- content: "By random selection"
29+
isCorrect: false
30+
explanation: "Incorrect. Agent selection is not random; it is based on analyzing user intent and routing according to specific rules."
31+
- content: "Based on the user's intent and predefined rules"
32+
isCorrect: true
33+
explanation: "Correct. The framework uses intent recognition and predefined rules to route queries to the most relevant agent."
34+
- content: "By the agent's physical location"
35+
isCorrect: false
36+
explanation: "Incorrect. Agent selection is not based on physical location but on task relevance and expertise."
37+
- content: "What is the role of the Termination Strategy in the Semantic Kernel Agent Framework?"
38+
choices:
39+
- content: "It determines when a conversation or task should end"
40+
isCorrect: true
41+
explanation: "Correct. The Termination Strategy ensures conversations or tasks are properly concluded, preventing unnecessary messages or prolonged interactions."
42+
- content: "It defines the flow of conversation"
43+
isCorrect: false
44+
explanation: "Incorrect. The flow of conversation is managed by the selection strategy, not the termination strategy."
45+
- content: "It decides which agent takes the next turn"
46+
isCorrect: false
47+
explanation: "Incorrect. The next agent to respond is determined by the selection strategy, not the termination strategy."

learn-pr/wwl-data-ai/orchestrate-sk-multi-agent-solution/includes/3-agent-collaboration-components.md

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
NOTES: After thinking on this longer, I wonder if we split out each section here into its own unit and expand a bit - give examples of the prebuilt selection and termination strategies. Then we can drop the code heavy unit (currently 4) and save the coding for the lab
2-
3-
41
A key part of the Semantic Kernel Agent Framework is a system designed to facilitate intelligent, multi-agent interactions. Agent collaboration, called `AgentGroupChat`, has critical components to consider that aren't necessary with single agents or non-agentic Semantic Kernel applications.
52

63
Each of these sections discusses an example multi-agent solution, where we have two agents:
@@ -56,45 +53,4 @@ prompt=f"""
5653
"""
5754
```
5855

59-
If your preferred interaction should always have a certain agent respond first, that can be specified in your selection strategy as seen in the prompt above.
60-
61-
Multi-turn conversations have responses returned asynchronously, so the conversation can develop naturally. However, the agents need to know when to stop a conversation, which is determined by the **termination strategy**
62-
63-
## Termination strategy
64-
65-
A termination strategy ensures that conversations or tasks conclude appropriately, preventing unnecessary messages to the user, limiting resource usage, and improving user experience.
66-
67-
For example, once the _ReviewingDirectorAgent_ has reviewed and approved our scrubbing brush slogan from the _CopywriterAgent_, us humans know the conversation should be over. However, if we don't define when to terminate the conversation, the _CopywriterAgent_ is going to keep submitting slogans unnecessarily.
68-
69-
### Why use a termination strategy?
70-
71-
- **Efficiency**: It prevents endless loops or prolonged interactions, saving computational resources.
72-
- **User satisfaction**: Users receive concise and relevant responses, avoiding frustration from overly long conversations.
73-
- **Goal completion**: The use of an agent is to complete a task. By terminating appropriately. it confirms when a task or conversation has achieved its intended purpose.
74-
75-
### How does the framework implement termination strategies?
76-
77-
Similar to how the selection strategy is specified, developers can specify a termination strategy or use one of the predefined strategies. Termination strategies can also define a maximum number of iterations a conversation should be limited to.
78-
79-
Termination strategies can be created by a prompt, such as:
80-
81-
```python
82-
prompt="""
83-
Determine if the copy has been approved. If so, respond with a single word: yes
84-
85-
History:
86-
{{$history}}
87-
"""
88-
```
89-
90-
You can also specify which agent should determine that termination, which in our case would be _ReviewingDirectorAgent_. The agents to determine termination are also defined in the `AgentGroupChat`.
91-
92-
If it makes more sense for a given scenario, developers can also define termination functions explicitly in code. For example, we could define a termination function that checks the most recent history entry for just the word "yes". There are other use-case specific considerations if that route is chosen, such as very explicit agent instructions for approval, but it is an option.
93-
94-
### Conversation state
95-
96-
When a conversation is considered complete and terminates, the `AgentGroupChat` state is updated to _completed_. However, you may want to use the group chat instance again, in which you will need to reset the completion state to `False`.
97-
98-
In the case of a conversation hitting the maximum number of iterations allowed, the conversation will end but will not be marked as _completed_. In this case, you are able to extend the conversation without resetting the conversation state.
99-
100-
By understanding these components, you can better utilize the Semantic Kernel Agent Framework to build intelligent multi-agent systems.
56+
If your preferred interaction should always have a certain agent respond first, that can be specified in your selection strategy as seen in the prompt above.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Multi-turn conversations have responses returned asynchronously, so the conversation can develop naturally. However, the agents need to know when to stop a conversation, which is determined by the **termination strategy**
2+
3+
This unit uses the example multi-agent solution where we have two agents:
4+
5+
- A copywriter agent who writes online content, called _CopywriterAgent_.
6+
- A creative director only reviewing the proposals, called _ReviewingDirectorAgent_.
7+
8+
## Termination strategy
9+
10+
A termination strategy ensures that conversations or tasks conclude appropriately, preventing unnecessary messages to the user, limiting resource usage, and improving user experience.
11+
12+
For example, once the _ReviewingDirectorAgent_ has reviewed and approved our scrubbing brush slogan from the _CopywriterAgent_, us humans know the conversation should be over. However, if we don't define when to terminate the conversation, the _CopywriterAgent_ is going to keep submitting slogans unnecessarily.
13+
14+
### Why use a termination strategy?
15+
16+
- **Efficiency**: It prevents endless loops or prolonged interactions, saving computational resources.
17+
- **User satisfaction**: Users receive concise and relevant responses, avoiding frustration from overly long conversations.
18+
- **Goal completion**: The use of an agent is to complete a task. By terminating appropriately. it confirms when a task or conversation has achieved its intended purpose.
19+
20+
### How does the framework implement termination strategies?
21+
22+
Similar to how the selection strategy is specified, developers can specify a termination strategy or use one of the predefined strategies. Termination strategies can also define a maximum number of iterations a conversation should be limited to.
23+
24+
Termination strategies can be created by a prompt, such as:
25+
26+
```python
27+
prompt="""
28+
Determine if the copy has been approved. If so, respond with a single word: yes
29+
30+
History:
31+
{{$history}}
32+
"""
33+
```
34+
35+
You can also specify which agent should determine that termination, which in our case would be _ReviewingDirectorAgent_. The agents to determine termination are also defined in the `AgentGroupChat`.
36+
37+
If it makes more sense for a given scenario, developers can also define termination functions explicitly in code. For example, we could define a termination function that checks the most recent history entry for just the word "yes". There are other use-case specific considerations if that route is chosen, such as very explicit agent instructions for approval, but it is an option.
38+
39+
### Conversation state
40+
41+
Whether you use `AgentGroupChat` for a single-turn or multi-turn conversation, the state is updated to _completed_ once it meets the termination criteria. However, you may want to use the group chat instance again. To keep using the same chat instance, you'll need to reset the completion state to `False`. Without a state reset, the `AgentGroupChat` won't accept new interactions.
42+
43+
In the case of a conversation hitting the maximum number of iterations allowed, the conversation will end but will not be marked as _completed_. In this case, you can extend the conversation without resetting the conversation state.
44+
45+
By understanding these components, you can better utilize the Semantic Kernel Agent Framework to build intelligent multi-agent systems.

learn-pr/wwl-data-ai/orchestrate-sk-multi-agent-solution/includes/4-design-agent-collaboration.md

Lines changed: 0 additions & 91 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
In this module, you learned how to use the Semantic Kernel Agent Framework to create and manage multiple AI agents that work together to complete tasks. You saw how to define agents with different functions, connect them using AgentGroup, and automatically route user requests to the right agent. You also explored how agents can communicate with each other in a conversation, making AI interactions more dynamic and intelligent. With these skills, you can build flexible and scalable AI systems that handle a variety of tasks efficiently.
1+
In this module, you learned how the Semantic Kernel Agent Framework enables developers to build collaborative AI agents. You learned about agent selection, multi-agent collaboration, and termination strategies to understand how agents interact, process input, and determine conversation flow. You also learned how selection and termination strategies ensure efficiency and goal completion in agent-driven workflows. By applying these concepts and skills, you can leverage the Semantic Kernel Agent Framework to create dynamic, adaptable AI solutions that enhance user interactions and automate complex tasks.

0 commit comments

Comments
 (0)