0
0
Agentic AIml~10 mins

Working memory for current task state 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 initialize the working memory as an empty dictionary.

Agentic AI
working_memory = [1]
Drag options to blanks, or click blank then click option'
A0
B[]
CNone
D{}
Attempts:
3 left
💡 Hint
Common Mistakes
Using a list [] instead of a dictionary {}
Setting working memory to None or 0 which cannot store state
2fill in blank
medium

Complete the code to add a key 'current_step' with value 1 to the working memory.

Agentic AI
working_memory[[1]] = 1
Drag options to blanks, or click blank then click option'
A'step'
B'current_step'
C'state'
D'task'
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic keys like 'step' or 'state' that are less clear
Forgetting to use quotes around the key string
3fill in blank
hard

Fix the error in updating the working memory to increment 'current_step' by 1.

Agentic AI
working_memory['current_step'] = working_memory['current_step'] [1] 1
Drag options to blanks, or click blank then click option'
A+
B-
C*
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using subtraction or multiplication instead of addition
Using division which changes the value incorrectly
4fill in blank
hard

Fill both blanks to check if the 'task_complete' flag in working memory is True and print a message.

Agentic AI
if working_memory.get([1], False) [2] True:
    print('Task is complete')
Drag options to blanks, or click blank then click option'
A'task_complete'
B==
C!=
D'complete'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' which checks for inequality
Using wrong key names like 'complete'
5fill in blank
hard

Fill all three blanks to create a function that resets the working memory keys 'current_step' to 0, 'task_complete' to False, and 'error_count' to 0.

Agentic AI
def reset_memory(memory):
    memory[[1]] = 0
    memory[[2]] = False
    memory[[3]] = 0
Drag options to blanks, or click blank then click option'
A'current_step'
B'task_complete'
C'error_count'
D'status'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong key names like 'status'
Assigning wrong values like True instead of False