r/LLMDevs • • 2d ago

Discussion Graph rag vs agentic rag

Hi team, just curios, those who are using graph rag why did you choose graph rag over typical rag? Can you give some specific examples from ur scenario

15 Upvotes

10 comments sorted by

5

u/Correct_Rain_9438 2d ago

Mostly two cases: questions that need connecting facts spread across many documents, and broad ones like what the main themes are across a whole corpus. Microsoft's GraphRAG docs say plain vector RAG struggles with both, while specific lookups still suit standard search.

5

u/aiprod 2d ago

We recently benchmarked graph RAG vs. agentic vector RAG vs. naive RAG. A hybrid graph and vector agent had the highest win rate and the lowest hallucination rate. Pure agentic graph RAG was in second place.
Agentic vector RAG alone had pretty high hallucination rate.

I think the benefit of graph RAG is mostly in giving agents the possibility to filter and to follow graph edges after initial retrieval. It’s also a lot better for answering aggregation queries (how many deployments did we do last year?). Pure vector RAG is really bad for this type of query.

5

u/StrawberryNo4687 2d ago

what kind of documents are you dealing with? if the relationships between entities matter more than the raw text similarity, graph makes sense, otherwise simple hybrid search with an agentic routing step is way easier to maintain

3

u/Resident-Story-3082 2d ago

i think Graph RAG makes sense when relationships matter, not just semantic similarity. for example, in research or knowledge base systems where answers require connecting entities across multiple documents

1

u/Adept_Carpet 2d ago

I agree, I might say not just that the relationships matter (there are always relationships and they always matter), but that at least one of the following needs to be true:

  1. There truly are different types of relationships and there is important data associated only with the relationship (is in no way a property of either entity alone). For instance a transportation network that links places together with roads, railways, air travel, ship travel, etc. It's useless to explore the roads between Boston and New York if you're trying to move an oil tanker, a standard cargo pallet can use all of the above, a mix of passengers and cargo can't be carried on rail lines marked freight-only, certain hazardous materials can't fly and can't go through certain tunnels, etc.
  2. You regularly need to query paths with a length greater than (say) 12. If 99.99% of your queries can be answerable by paths of less 4 hops (which is common in real data, especially if you made it something like a data design goal), consider assuming they all can be and then have a slow fallback for the odd ones. In any event, you probably don't want to search a large graph to unlimited depth anyway.

So, while I find it very interesting, graph RAG methods are likely to remain fairly niche. In so many cases where a network is literally present in the data you can get good enough results without it.

1

u/pizzababa21 2d ago

You kinda have to do agentic search with graph rag right? An agent needs to write the query surely?

1

u/sneakoo 2d ago

The deciding question is whether the answer needs a path or a passage. Multi hop questions with stable IDs earn the graph, because traversal returns the chain as evidence. Everything else is cheaper as plain retrieval, and agentic search on a bad index just spends tokens wandering.

1

u/Aide_Sea 2d ago

Honestly the part people skip is keeping the graph in sync. Docs change, entities get renamed, and suddenly you have two nodes for the same customer.. If your data doesn't have stable IDs I'd maybe stay with normal RAG until it hurts.

1

u/frechegoettin 1d ago

agentic rag is cool but it can be slow and expensive. graph is better if you just need to pull together a bunch of related concepts without needing a bunch of separate llm calls.