Type something to search...
How Agentic RAG solves problem with current RAG limitations

How Agentic RAG solves problem with current RAG limitations

In this volume 4 of coffee break concept, we will understand how AgenticRAG helps solve limitations of traditional RAG.

RAG Framework

The RAG (Retrieval Augmented Generation) framework operates in a specific sequence:

Document -> Chunks-> Vector DB -> Chunk Retrieval (Top K) -> LLM

However, this sequence encounters obstacles when dealing with certain types of queries.

Problem 1: Summarization

Consider a query like “Summarize the document”.

  • The conventional RAG approach retrieves the top K chunks and summarizes them.
  • But wouldn’t it be more comprehensive if it retrieved all chunks of the document and summarized them?

Problem 2: Comparing Documents

  • When tasked with comparing Document A and Document B, the basic RAG retrieves random chunks and attempts to compare these top K chunks.
  • This doesn’t paint an accurate picture as it doesn’t represent the full scope of the documents.

Problem 3: Structured Data Analysis

Consider a question like “When is the next leave?”.

  • The first step is to retrieve the region to which the employee belongs from a structured table.
  • Based on the region, the next leave for that region is extracted from the leave policy document.
  • This process isn’t as straight forward with the current RAG framework.

Problem 4: The Multi-part Question

Consider a question like “Identify common leave across all regions?”.

  • Imagine you have a leave policy document of a company present in 120 countries.
  • Since you are passing the top K contexts, the maximum number of regions that can be compared is limited to K, where K is the number of chunks passed to LLM.

Look into our AgenticRAG with LlamaIndex Course with 5 real-time case studies.

Course link: https://www.masteringllm.com/course/agentic-retrieval-augmented-generation-agenticrag

Agentic RAG

Agentic RAG can solve this 4 problems by replacing via custom agents.

  • Agents will interact with multiple systems.
  • RAG is now one part of this system which agents can use.

  • Agents uses LLMs to automate the reasoning and tool selection
  • RAG is just another tool which Agent may decides to use.

Routing Agent

  • Routing agents are simple agents which routes the queries.
  • An agent can route query in one or multiple tools.
  • Remember our question “Summarize the document” or a question if we want to combine “Summarization + Sematic search” can be solved using below example routing

Query Planning Agent

  • Query planning agent breaks down the queries into sub-queries.
  • Each of the sub-queries can be executed against RAG pipeline.

Tools For Agents

  • LLMs can have multiple tools like calling an API, infer parameters for API.
  • RAG is now a tool which LLM might use.

Summary

  • RAG has limitations when represented with complex questions.
  • Few of the use cases like summarization, comparison etc. can’t be solve with just RAG.
  • Agentic RAG can help overcome limitation of RAG.
  • Agentic RAG treats RAG as a tool which it can use for semantic search.
  • Agents equipped with routing, query planning and tools can out perform traditional RAG applications.

Related Posts

10 Creative Ways to Use ChatGPT Search The Web Feature

10 Creative Ways to Use ChatGPT Search The Web Feature

For example, prompts and outputs Did you know you can use the “search the web” feature of ChatGPT for many tasks other than your basic web search? For those who don't know, ChatGPT’s new

Read More
📚 10 Must-Learn Skills to Stay Ahead in AI and Tech 🚀

📚 10 Must-Learn Skills to Stay Ahead in AI and Tech 🚀

In an industry as dynamic as AI and tech, staying ahead means constantly upgrading your skills. Whether you’re aiming to dive deep into AI model performance, master data analysis, or transform trad

Read More
10 Powerful Perplexity AI Prompts to Automate Your Marketing Tasks

10 Powerful Perplexity AI Prompts to Automate Your Marketing Tasks

In today’s fast-paced digital world, marketers are always looking for smarter ways to streamline their efforts. Imagine having a personal assistant who can create audience profiles, suggest mar

Read More
10+ Top ChatGPT Prompts for UI/UX Designers

10+ Top ChatGPT Prompts for UI/UX Designers

AI technologies, such as machine learning, natural language processing, and data analytics, are redefining traditional design methodologies. From automating repetitive tasks to enabling personal

Read More
100 AI Tools to Finish Months of Work in Minutes

100 AI Tools to Finish Months of Work in Minutes

The rapid advancements in artificial intelligence (AI) have transformed how businesses operate, allowing people to complete tasks that once took weeks or months in mere minutes. From content creat

Read More
17 Mindblowing GitHub Repositories You Never Knew Existed

17 Mindblowing GitHub Repositories You Never Knew Existed

Github Hidden Gems!! Repositories To Bookmark Right Away Learning to code is relatively easy, but mastering the art of writing better code is much tougher. GitHub serves as a treasur

Read More