0
0
Agentic AIml~20 mins

Combining retrieval with agent reasoning in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Agentic AI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does retrieval enhance agent reasoning?

Imagine an AI agent that answers questions by searching a large database of documents. How does adding a retrieval step improve the agent's reasoning process?

AIt provides relevant information from external sources, allowing the agent to reason with up-to-date and specific data.
BIt replaces the agent's reasoning entirely, so the agent only returns retrieved documents without processing them.
CIt slows down the agent because retrieval adds unnecessary steps that do not affect reasoning.
DIt limits the agent to only use pre-stored knowledge, preventing it from adapting to new queries.
Attempts:
2 left
💡 Hint

Think about how having access to more information can help an AI make better decisions.

Predict Output
intermediate
2:00remaining
Output of agent reasoning with retrieval

Given the following simplified agent code that retrieves documents and then answers a question, what is the output?

Agentic AI
documents = {"doc1": "The sky is blue.", "doc2": "Grass is green."}

query = "What color is the sky?"

retrieved = [doc for doc in documents.values() if "sky" in doc]

answer = "".join(retrieved) if retrieved else "No info found."

print(answer)
AGrass is green.
BThe sky is blue.
CNo info found.
DThe sky is blue.Grass is green.
Attempts:
2 left
💡 Hint

Look for the document containing the word 'sky'.

Hyperparameter
advanced
2:00remaining
Choosing retrieval size for agent reasoning

When combining retrieval with agent reasoning, what is the effect of increasing the number of retrieved documents (retrieval size) on the agent's performance?

AIncreasing retrieval size can improve accuracy but may increase processing time and introduce irrelevant information.
BIncreasing retrieval size always improves accuracy without any downsides.
CIncreasing retrieval size decreases accuracy because more documents confuse the agent.
DRetrieval size does not affect agent performance at all.
Attempts:
2 left
💡 Hint

Consider the trade-off between more information and processing cost.

Metrics
advanced
2:00remaining
Evaluating combined retrieval and reasoning agents

Which metric best measures how well an agent combines retrieval with reasoning to answer questions accurately?

APrecision of retrieved documents only.
BRecall of retrieved documents only.
CNumber of documents retrieved per query.
DEnd-to-end answer accuracy comparing agent answers to ground truth.
Attempts:
2 left
💡 Hint

Think about what really matters: the final answer quality.

🔧 Debug
expert
3:00remaining
Debugging agent reasoning with retrieval failure

An agent retrieves documents but always returns 'No info found.' even when relevant documents exist. What is the most likely cause?

Agentic AI
documents = {"doc1": "Cats are Mammals.", "doc2": "Dogs are friendly."}

query = "What animals are mammals?"

retrieved = [doc for doc in documents.values() if "mammal" in doc]

answer = "".join(retrieved) if retrieved else "No info found."

print(answer)
AThe join method is incorrect and causes an error.
BThe documents dictionary is empty, so no retrieval is possible.
CThe retrieval condition uses 'mammal' but documents contain 'mammals' (plural), causing no matches.
DThe query variable is not used in retrieval, so retrieval always fails.
Attempts:
2 left
💡 Hint

Check if the retrieval condition matches the exact words in documents.