Naive RAG vs. Agentic RAG, clearly explained (with visuals):
Naive RAG has many issues:
- It retrieves once and generates once. If the context isn't enough, it cannot dynamically search for more info.
- It cannot reason through complex queries.
- The system can't modify its strategy based on the problem.
- It retrieves once and generates once. If the context isn't enough, it cannot dynamically search for more info.
- It cannot reason through complex queries.
- The system can't modify its strategy based on the problem.
Agentic RAG attempts to solve this.
The following visual depicts how it differs from naive RAG.
The core idea is to introduce agentic behaviors at each stage of RAG.
The following visual depicts how it differs from naive RAG.
The core idea is to introduce agentic behaviors at each stage of RAG.
Steps 1-2) An agent rewrites the query (removing spelling mistakes, etc.)
Step 3-8) An agent decides if it needs more context.
↳ If not, the rewritten query is sent to the LLM.
↳ If yes, an agent finds the best external source to fetch context, to pass it to the LLM.
Step 3-8) An agent decides if it needs more context.
↳ If not, the rewritten query is sent to the LLM.
↳ If yes, an agent finds the best external source to fetch context, to pass it to the LLM.
Step 9) We get a response.
Step 10-12) An agent checks if the answer is relevant.
↳ If yes, return the response.
↳ If not, go back to Step 1.
This continues for a few iterations until we get a response or the system admits it cannot answer the query.
Step 10-12) An agent checks if the answer is relevant.
↳ If yes, return the response.
↳ If not, go back to Step 1.
This continues for a few iterations until we get a response or the system admits it cannot answer the query.
This makes RAG more robust since agents ensure individual outcomes are aligned with the goal.
That said, the diagram shows one of the many blueprints an agentic RAG system may possess.
You can adapt it according to your specific use case.
That said, the diagram shows one of the many blueprints an agentic RAG system may possess.
You can adapt it according to your specific use case.
If you found it insightful, reshare it with your network.
Find me → @_avichawla
Every day, I share tutorials and insights on DS, ML, LLMs, and RAGs.
Find me → @_avichawla
Every day, I share tutorials and insights on DS, ML, LLMs, and RAGs.
View Tweet
Generated by Thread Navigator
Press ⌘ + S to quick-export
