Working memory helps an AI keep track of what it is doing right now. It stores important details so the AI can make good decisions step-by-step.
When an AI needs to remember recent actions to plan the next step.
When handling tasks that require multiple steps and context.
When the AI must update its understanding as new information arrives.
When tracking progress in a conversation or interaction.
When managing temporary information that changes during a task.
Syntax
Agentic AI
working_memory = {}
# Store info
working_memory['current_step'] = 'fetch_data'# Update info
working_memory['current_step'] = 'process_data'# Access info
current = working_memory.get('current_step')
Working memory is often a simple dictionary or key-value store.
It holds temporary data that changes as the task progresses.
C. working_memory is None and has no append method
D. working_memory should be a string
Solution
Step 1: Check working_memory type
It is None, which is not a list and has no append method.
Step 2: Understand append usage
append works only on list objects, so calling it on None causes an error.
Final Answer:
working_memory is None and has no append method -> Option C
Quick Check:
NoneType has no append method [OK]
Hint: Check object type before using append [OK]
Common Mistakes:
Assuming append works on None
Thinking current_step is undefined
Believing append needs two arguments
5. An agentic AI uses working memory to track task progress. If the AI must remember the last two steps instead of just one, which data structure and update method best fit this need?
hard
A. Use a set to store steps, adding new steps without order
B. Use a string and overwrite with the latest step only
C. Use a dictionary with step names as keys and overwrite all keys each time
D. Use a list and append new steps, removing oldest when length > 2
Solution
Step 1: Identify need to store last two steps in order
We need a structure that keeps order and can hold multiple items.
Step 2: Evaluate data structures
List supports order and appending; removing oldest keeps size 2. String or set do not keep order or multiple recent steps properly.
Final Answer:
Use a list and append new steps, removing oldest when length > 2 -> Option D
Quick Check:
List + append + remove oldest = last two steps [OK]
Hint: Use list as queue to keep last two steps [OK]
Common Mistakes:
Using string which holds only one step
Using set which loses order
Using dict which overwrites keys
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.