

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Recursive RAG
incomplete
2: Agentic Search
incomplete
This lesson's interactive features are locked, please to keep using them
Click to play video
As you already (hopefully) know from our Build an AI Agent course, an "agent" is just tool calls in a for loop.
Recursive RAG is like a simple AI agent, and we can make it more "agentic" by giving it more tools to use in its loop. We could even break up our step-by-step RAG pipeline into a set of tools, and allow the LLM to "run" the pipeline in the order it thinks is best for a given query.
while not done:
# Choose tool based on what we learned
tool = pick_next_tool(previous_results)
# Search with that tool
results = tool.search(query)
# Update our knowledge
previous_results.append(results)
The magic is in pick_next_tool() – it looks at what we found and decides what to do next. Imagine we had these tools:
For example, say we ask our RAG agent:
"Find scary bear movies that were in a forest"
Each tool choice is influenced by the previous results, and is chosen for the specific query and results, rather than having the order preprogrammed in advance. That's how a human using a search engine would do it, after all!
One final note: adding a real-time LLM to search does make it a lot slower, and agentic loops? Even more so. Only use this approach when you really need that extra bit of intelligence and flexibility.
We aren't going to build agentic RAG in this course, simply because it's a lot of glue code that, if you complete this course and the AI Agent course, you'll be able to easily plug together yourself. The concept is straightforward enough.