0
0
Agentic AIml~10 mins

Combining retrieval with agent reasoning in Agentic AI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize the retrieval agent with a knowledge base.

Agentic AI
agent = RetrievalAgent(knowledge_base=[1])
Drag options to blanks, or click blank then click option'
Aresponse
Bquery
Ckb
Dagent
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'query' instead of the knowledge base variable.
Passing the agent itself as the knowledge base.
2fill in blank
medium

Complete the code to perform a retrieval before reasoning.

Agentic AI
retrieved_docs = agent.retrieve([1])
Drag options to blanks, or click blank then click option'
Aresponse
Bagent
Cknowledge_base
Dquery_text
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the agent object instead of the query string.
Using the knowledge base variable instead of the query.
3fill in blank
hard

Fix the error in the reasoning step by filling the correct method to process retrieved documents.

Agentic AI
answer = agent.[1](retrieved_docs)
Drag options to blanks, or click blank then click option'
Athink
Breason
Cprocess
Dquery
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'query' which is for searching, not reasoning.
Using 'process' or 'think' which are not valid method names.
4fill in blank
hard

Fill both blanks to combine retrieval and reasoning in one step.

Agentic AI
final_answer = agent.[1](agent.[2](query_text))
Drag options to blanks, or click blank then click option'
Areason
Bretrieve
Cquery
Danswer
Attempts:
3 left
💡 Hint
Common Mistakes
Reversing the order of 'reason' and 'retrieve'.
Using 'query' or 'answer' which are not correct method names here.
5fill in blank
hard

Fill all three blanks to create a function that takes a query, retrieves documents, reasons, and returns the answer.

Agentic AI
def answer_query([1]):
    docs = agent.[2]([3])
    return agent.reason(docs)
Drag options to blanks, or click blank then click option'
Aquery_text
Bretrieve
Dresponse
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names for the function input and retrieval argument.
Using 'response' instead of 'query_text' as input.