0
0
Agentic AIml~20 mins

Memory retrieval strategies in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Memory Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does a key-value memory network retrieve information?

In a key-value memory network, what is the main step used to retrieve the correct value from memory?

AMatching the input query with keys to find the most relevant value
BRandomly selecting a value from memory without using the input
CUsing the last stored value regardless of the query
DSorting all values and returning the first one
Attempts:
2 left
💡 Hint

Think about how the network finds the right information based on the input.

Predict Output
intermediate
2:00remaining
Output of memory attention weights calculation

What is the output of the following code that calculates attention weights over memory keys?

Agentic AI
import numpy as np
query = np.array([1, 0])
keys = np.array([[1, 0], [0, 1], [1, 1]])
scores = keys @ query
weights = np.exp(scores) / np.sum(np.exp(scores))
print(weights)
A[1. 0. 0.]
B[0.33333333 0.33333333 0.33333333]
C[0.5 0.5 0.0]
D[0.42214066 0.1553624 0.42214066]
Attempts:
2 left
💡 Hint

Check how the dot product scores are computed and then converted to probabilities.

Hyperparameter
advanced
2:00remaining
Choosing the right memory size for retrieval accuracy

When increasing the size of an external memory in a retrieval model, which effect is most likely to occur if the memory size is too large without proper regularization?

AThe model may retrieve irrelevant information, reducing accuracy
BThe model will always improve accuracy with larger memory
CThe model will ignore the memory and rely only on input features
DThe model will crash due to memory overflow errors
Attempts:
2 left
💡 Hint

Think about how too much information can confuse retrieval.

🔧 Debug
advanced
2:00remaining
Identify the error in memory retrieval code snippet

What error will the following code raise when trying to retrieve a value from memory?

Agentic AI
memory = {'apple': 'fruit', 'carrot': 'vegetable'}
query = 'banana'
value = memory[query]
print(value)
ATypeError
BKeyError
CValueError
DNo error, prints 'fruit'
Attempts:
2 left
💡 Hint

What happens if you try to access a dictionary key that does not exist?

Model Choice
expert
3:00remaining
Best memory retrieval model for long-term context in dialogue systems

Which model architecture is best suited for retrieving relevant long-term context in a dialogue system with very large memory?

AFeedforward neural network with fixed-size input
BSimple RNN without external memory
CDifferentiable Neural Computer (DNC) with content-based addressing
DConvolutional Neural Network (CNN) for image classification
Attempts:
2 left
💡 Hint

Consider models designed to read and write to external memory with flexible addressing.