Challenge - 5 Problems
State Mastery in Agentic AI
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why does state management help an AI agent avoid confusion?
Imagine an AI agent that talks to many people and remembers their questions. Why does keeping track of the conversation state help the agent avoid mixing up answers?
Attempts:
2 left
💡 Hint
Think about how remembering past messages helps in a chat.
✗ Incorrect
State management means the agent keeps track of past interactions. This helps it understand context and avoid mixing up different conversations or topics.
❓ Predict Output
intermediate2:00remaining
What is the output of this agent state update code?
Given this simple code that updates an agent's state with user messages, what will be the final state after running it?
Agentic AI
state = {}
messages = ['Hi', 'How are you?', 'Bye']
for i, msg in enumerate(messages):
state[f'message_{i}'] = msg
print(state)Attempts:
2 left
💡 Hint
Look at how keys are created with f-strings and the loop index.
✗ Incorrect
The code creates keys like 'message_0', 'message_1', etc., and assigns each message. So the final dictionary has these keys with the messages as values.
❓ Model Choice
advanced2:00remaining
Which model design best supports state management to prevent agent confusion?
You want to build an AI agent that remembers past user inputs to avoid confusion. Which model design is best for this?
Attempts:
2 left
💡 Hint
Think about models that remember previous inputs in a sequence.
✗ Incorrect
RNNs keep track of past inputs through hidden states, making them suitable for managing conversation state and avoiding confusion.
❓ Metrics
advanced2:00remaining
Which metric best shows if an agent is confused due to poor state management?
You want to measure if your AI agent is mixing up conversations because it forgets context. Which metric helps detect this confusion?
Attempts:
2 left
💡 Hint
Look for a metric that measures correctness in context, not just raw performance.
✗ Incorrect
Conversation accuracy measures if the agent responds correctly given the conversation history, revealing confusion if low.
🔧 Debug
expert3:00remaining
Why does this agent lose track of conversation state?
This code tries to update the agent's state but the agent forgets previous messages. What is the bug?
Agentic AI
def update_state(state, new_msg): state = {"last_message": new_msg} return state state = {} state = update_state(state, 'Hello') state = update_state(state, 'How are you?') print(state)
Attempts:
2 left
💡 Hint
Check how the state dictionary is changed inside the function.
✗ Incorrect
The function replaces the whole state with a new dictionary containing only the last message, discarding earlier messages.