๐งชTDD Challengeยทadvancedยทโฑ๏ธ 40โ55mยทโญ 225 XP
M-046Build a RAG-Powered Knowledge Agent
Description
Nebula Corp wants an intelligent knowledge assistant that combines RAG retrieval with agent capabilities. The agent should: receive a user question, search a document collection for relevant context, and if the retrieved context is insufficient, reformulate the query and search again. This is the 'agentic RAG' pattern โ the agent decides when retrieval is good enough and when to retry. The retrieval and LLM pieces exist, but the agent loop that ties them together is missing.
Test Cases (3)
Retrieves and answers
Agent should retrieve context and answer
Input:knowledgeAgent('What are the pricing plans?')
Expected:CONTAINS:Pro
Reformulates on insufficient context
Agent should retry with reformulated query
Input:knowledgeAgent('Can I get my money back if I cancel?')
Expected:CONTAINS:refund
Stops when context is sufficient
Agent should not over-retrieve
Input:knowledgeAgent('What are the pricing plans?')
Expected:CONTAINS:sources
Related Lessons
Click Run / Check to validate your solution