0
0
Agentic AIml~20 mins

Why memory makes agents useful in Agentic AI - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Memory Mastery in Agents
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why does memory improve an agent's decision-making?

Imagine an agent that interacts with an environment over time. Why is having memory important for this agent?

AMemory makes the agent slower by storing unnecessary information.
BMemory lets the agent ignore past events and focus only on the current input.
CMemory reduces the agent's ability to learn from new data.
DMemory allows the agent to recall past experiences to make better future decisions.
Attempts:
2 left
💡 Hint

Think about how remembering past events can help in making choices.

Predict Output
intermediate
1:30remaining
Output of agent with and without memory

Consider two simple agents processing a sequence of inputs. One agent remembers the sum of all previous inputs; the other does not. What is the output of the memory agent after processing inputs [1, 2, 3]?

Agentic AI
inputs = [1, 2, 3]

class MemoryAgent:
    def __init__(self):
        self.total = 0
    def process(self, x):
        self.total += x
        return self.total

agent = MemoryAgent()
outputs = [agent.process(x) for x in inputs]
print(outputs)
A[1, 3, 6]
B[1, 2, 3]
C[0, 1, 3]
D[3, 3, 3]
Attempts:
2 left
💡 Hint

Think about how the total changes after each input.

Model Choice
advanced
2:00remaining
Choosing a model architecture for memory in agents

You want to build an agent that remembers long sequences of past events to make decisions. Which model architecture is best suited for this task?

AFeedforward Neural Network without recurrence
BConvolutional Neural Network (CNN) designed for images
CRecurrent Neural Network (RNN) or Long Short-Term Memory (LSTM)
DK-Nearest Neighbors (KNN) without sequence handling
Attempts:
2 left
💡 Hint

Consider which models can handle sequences and remember past inputs.

Metrics
advanced
2:00remaining
Evaluating agent performance with and without memory

You train two agents on a task requiring remembering past states. Agent A has memory; Agent B does not. Which metric difference best shows the benefit of memory?

AAgent A and Agent B have the same accuracy but different training times.
BAgent A has higher accuracy and lower loss than Agent B on sequential test data.
CAgent B has higher accuracy because it ignores past noise.
DAgent B has lower loss but worse accuracy than Agent A.
Attempts:
2 left
💡 Hint

Think about how memory helps with tasks involving sequences.

🔧 Debug
expert
2:30remaining
Debugging an agent's memory update bug

An agent is supposed to update its memory by adding the current input to the stored state. However, the memory never changes from zero. What is the likely bug in this code?

Agentic AI
class Agent:
    def __init__(self):
        self.memory = 0
    def update(self, x):
        self.memory + x

agent = Agent()
agent.update(5)
print(agent.memory)
AThe update method does not assign the sum back to self.memory.
BThe update method should subtract x instead of adding.
CThe memory variable is not initialized in __init__.
DThe print statement is outside the class and cannot access memory.
Attempts:
2 left
💡 Hint

Check if the memory variable changes after calling update.