0
0
Agentic AIml~10 mins

Memory retrieval strategies 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 retrieve a memory by its unique key.

Agentic AI
retrieved_memory = memory_store.[1]('user_123')
Drag options to blanks, or click blank then click option'
Aget
Bappend
Cupdate
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'append' which is for lists, not dictionaries.
Using 'remove' which deletes data instead of retrieving.
Using 'update' which changes data instead of fetching.
2fill in blank
medium

Complete the code to check if a memory key exists before retrieval.

Agentic AI
if '[1]' in memory_store:
    data = memory_store['[1]']
Drag options to blanks, or click blank then click option'
Auser_456
Bmemory
Cdata
Dkey
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names instead of the actual key string.
Forgetting to check key existence before access.
3fill in blank
hard

Fix the error in the code to retrieve the most recent memory entry.

Agentic AI
recent_memory = memory_list.[1]()
Drag options to blanks, or click blank then click option'
Aappend
Bpop
Csort
Dclear
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'append' which adds items instead of retrieving.
Using 'sort' which rearranges the list but does not retrieve an item.
Using 'clear' which empties the list.
4fill in blank
hard

Fill both blanks to filter memories with scores above 80.

Agentic AI
high_scores = {mem: score for mem, score in memory_scores.items() if score [1] [2]
Drag options to blanks, or click blank then click option'
A>
B80
C<
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' which filters lower scores.
Using '==' which filters only exact matches.
5fill in blank
hard

Fill all three blanks to create a dictionary of memories with length greater than 5.

Agentic AI
filtered_memories = { [1]: [2] for [3] in memories if len(memories[[3]]) > 5 }
Drag options to blanks, or click blank then click option'
Amem
Bmemories[mem]
Dmemory
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Using the key as the value instead of accessing the dictionary.