Search again
A simple RAG system searches one time and uses what it finds. But the first query is often the words of the user, and the documents can use different words. Then the results are weak. In agentic RAG, the result of a search decides the next step. A real agent lets the model make that decision. Here, a score rule makes it: if no result is good, the agent searches again with a new query. A limit of searches keeps the cost known. The queries and their results are recorded.
About this lesson
Words to know
- RAG
- Retrieval-augmented generation: find the documents that matter for a question, and give them to the model together with the question.
- query rewrite
- A new search query for the same question, written with different words, after the first query found nothing good.
Why it matters
This is the smallest form of agentic RAG: the result of one search decides the next step. The same pattern, check then decide, is in each step of an agent.
With a year
How it works, a worked example, the exercise with its tests, three hints and the explained solution are in the app, with a year of Algo150 for $29 or ₾49. The first chapter, Model foundations, is free for everyone: start with Vector dot product.