AI Agents Exercises
Fill in the blanks to test your knowledge.
1
Name the loop pattern: observe → think → act → observe
// Core AI agent execution cycle
// Called the loop
2
Identify the stop reason when an LLM wants to call a tool
if response.stop_reason == "":
execute_tool(response)
3
Name the prompting strategy that interleaves reasoning and action steps
# Thought: I need to search for X
# Action: web_search({"query": "X"})
# Observation: ...
# Called prompting
4
Complete a tool definition object with its required fields
tool = {
"": "get_weather",
"description": "Get weather for a city",
"input_schema": { "type": "object", ... }
}
5
Name the type of memory stored in the conversation messages array
# Retained within the current session only
# Called memory
6
Identify the architecture where one agent delegates to specialists
# One agent coordinates multiple specialist agents
# Called pattern
7
Name the mechanism that prevents infinite agent loops
for step in range():
result = agent.step()
if result.done: break
8
Identify what makes a good tool description
// The model reads this to decide when to call the tool
{
name: "search_docs",
: "Search documentation for a given topic. Use when you need to find technical information.",
}