Bird
Raised Fist0
Agentic AIml~10 mins

AGI implications for agent design in Agentic AI - Interactive Code Practice

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

Complete the code to define an AGI agent's basic decision function.

Agentic AI
def decide_action(state):
    return [1]
Drag options to blanks, or click blank then click option'
Arandom.choice(actions)
Bchoose_best_action(state)
Cprint(state)
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a random action instead of the best one.
Returning None instead of an action.
2fill in blank
medium

Complete the code to update the agent's knowledge after receiving new information.

Agentic AI
def update_knowledge(agent, info):
    agent.knowledge_base.[1](info)
Drag options to blanks, or click blank then click option'
Aclear
Bremove
Cappend
Dignore
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove or clear which deletes data.
Ignoring new information.
3fill in blank
hard

Fix the error in the agent's reward calculation function.

Agentic AI
def calculate_reward(state, action):
    reward = state.get('value', 0) [1] action.cost
    return reward
Drag options to blanks, or click blank then click option'
A-
B+
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Adding cost instead of subtracting.
Multiplying or dividing which changes scale incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps states to their rewards if reward is positive.

Agentic AI
rewards = {state: [1] for state, action in actions.items() if [2] > 0}
Drag options to blanks, or click blank then click option'
Acalculate_reward(state, action)
Bstate.value
Daction.cost
Attempts:
3 left
💡 Hint
Common Mistakes
Using state.value or action.cost directly instead of reward.
Not filtering positive rewards.
5fill in blank
hard

Fill all three blanks to define an AGI agent's learning step with state, action, and reward updates.

Agentic AI
def learning_step(agent, state, action):
    reward = [1](state, action)
    agent.memory.[2]((state, action, reward))
    agent.policy = [3](agent.memory)
Drag options to blanks, or click blank then click option'
Acalculate_reward
Bappend
Cupdate_policy
Dpredict
Attempts:
3 left
💡 Hint
Common Mistakes
Using predict instead of update_policy.
Not storing experience in memory.
Skipping reward calculation.