0
0
Agentic AIml~10 mins

Single agent vs multi-agent systems in Agentic AI - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a single agent that takes an action.

Agentic AI
class Agent:
    def act(self, state):
        return [1]
Drag options to blanks, or click blank then click option'
ANone
Bstate
C'move_forward'
Dself
Attempts:
3 left
💡 Hint
Common Mistakes
Returning the state instead of an action.
Returning None or self which are not valid actions.
2fill in blank
medium

Complete the code to initialize a multi-agent system with two agents.

Agentic AI
class MultiAgentSystem:
    def __init__(self):
        self.agents = [[1], Agent()]
Drag options to blanks, or click blank then click option'
AAgent()
BAgent
Cagents
Dself
Attempts:
3 left
💡 Hint
Common Mistakes
Using the class name without parentheses.
Using undefined variables.
3fill in blank
hard

Fix the error in the method that collects actions from all agents.

Agentic AI
def get_actions(self, state):
    return [agent.[1](state) for agent in self.agents]
Drag options to blanks, or click blank then click option'
Amove
Brun
Caction
Dact
Attempts:
3 left
💡 Hint
Common Mistakes
Using method names that do not exist like 'move' or 'run'.
4fill in blank
hard

Fill both blanks to create a dictionary of agent actions keyed by agent id.

Agentic AI
def actions_dict(self, state):
    return {agent.[1]: agent.[2](state) for agent in self.agents}
Drag options to blanks, or click blank then click option'
Aid
Bact
Cname
Dstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using name instead of id.
Using state instead of calling act.
5fill in blank
hard

Fill all three blanks to implement a step where all agents act and results are collected.

Agentic AI
def step(self, state):
    results = {agent.[1]: agent.[2](state) for agent in self.agents}
    return results if results else [3]
Drag options to blanks, or click blank then click option'
Aid
Bact
C{}
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Returning None instead of an empty dictionary.
Using wrong attribute or method names.