When I was working on Puppy’s RAG (retrieval-augmented generation) engine, Microsoft GraphRAG was attracting a lot of attention.1 When a user asks a question, a RAG engine finds relevant source passages and gives them to a language model to ground its answer. I wondered what additional questions a graph could answer if ordinary RAG could already find answers in documents. I looked at Microsoft’s GraphRAG docs,2 JarsonCai’s discussion of costs and applicability on Zhihu,3 and a knowledge-base comparison using GPT-4o mini.4
While researching local DeepSeek deployment I found two knowledge-base projects on its official integration list. RAGFlow retrieves passages and cites them in answers. PingCAP’s AutoFlow applies GraphRAG to document Q&A.5 I put these notes together so readers new to RAG could see what the graph contributes. Try answering a question from Microsoft’s paper:
“What are the main themes in the dataset?”6
What are the main themes of this collection? That sounds simpler than looking up an obscure fact, but on which page would you look for the answer? Five highly relevant articles about the same thing tell you nothing about the sixth. An important idea behind Microsoft GraphRAG is to index the whole collection for reading in groups before anyone asks a question.7
Why do a few passages suffice for some questions about the same incident reports?
I made up these four postmortem excerpts for illustration. I refer to them as A through D. When we get to the paper and tutorials, I describe the material their experiments actually used.
| Excerpt | What the report says |
|---|---|
| A · March | The login service timed out calling the session cache. Login recovered after the on-call engineer rolled back the cache client. |
| B · May | The login service again timed out calling the session cache. Retry requests filled the connection pool. Limiting retries restored login. |
| C · August | The payment service timed out calling the risk-control API. Automatic retries exhausted worker threads. The team capped retries. |
| D · November | Search index updates stalled. The indexing job’s credentials had expired, and updating them restored the job. |
“How was the March login incident fixed?” The last sentence of A suffices. Ordinary retrieval-augmented generation (RAG) splits this into two steps: retrieve evidence from external sources and let a language model compose an answer from the question and evidence. A common approach pre-splits long documents into passages and encodes each as a sequence of numbers, an embedding vector. At query time, encode the question and send several closest passages to the model. This is vector retrieval. Taking the first k results is top-k. Retain document names, dates and locations so readers can verify that it was the cache client that was rolled back.6
Now ask: “Which dependencies were involved in login incidents, and how did each recover?” This needs at least A and B. Here the dependency is the session cache called by the login service. The same pair of services experienced two timeouts and two different fixes. If chunking leaves “cache client” in one passage and puts “recovered after rollback” in the next, retrieving only the latter may yield an incomplete answer.
For “Which failure patterns recurred this year?”, the passages to compare are B and C. Their services, months and exhausted resources differ, but the pattern is the same. After an initial timeout, automatic retries occupied the remaining connections or worker threads. I call this “retry amplification” below. A also mentions a timeout but gives no evidence of retry amplification. D concerns credentials. The question calls for reading across the collection and synthesizing themes. Raising k gives the model more material. The ranking alone cannot tell how representative the most similar passages are of the whole year.
What does GraphRAG turn the source documents into before a query?
To bring together clues scattered across documents, GraphRAG prepares an index in advance. It extracts objects such as services or people, connects related objects into a knowledge graph and calls a tightly connected group of objects a “community.” The model then writes a report for each community.68
Figure 1. Points are objects mentioned in the text and lines are their relationships. The graph algorithm partitions communities by connectivity and the language model summarizes each group. The grouping and themes shown are illustrative.6
- Split the source into passages that retain context. A real postmortem may include a summary, an investigation and follow-up actions. The model reads one passage at a time. Short passages can separate a subject from its action, while long passages can cause it to miss an entity. The original passages remain useful, especially when checking which incident a sentence describes.
- Extract entities and relationships and merge duplicate descriptions. An entity is an identifiable object such as “login service” or “session cache.” A connection between two entities is an edge. A and B both support “login service calls session cache.” The model can associate both descriptions with the same pair of entities. Keeping only “calls” loses the distinct remedies. Rewriting “call timed out” as “cache went down” goes beyond the evidence. Graph relationships need evidence too.
- Partition communities by connectivity. Entities as points and relationships as lines form a graph. The paper uses Leiden to find relatively densely connected groups, or communities. Large groups can be subdivided. Connectivity allows passages from different months that repeatedly mention the same services to feed the same report. Boundaries depend on the actual extracted nodes and edges. The four excerpts explain the mechanism and do not predetermine how many communities the algorithm finds.
- Generate a report per community. The model reads a group’s entity and relationship descriptions, titles the theme, then writes a summary and findings. For example, the upper-left group in figure 1 could be titled “Login service cache timeouts” and explain how each incident recovered. GraphRAG calls this a community report. Large higher-level communities can use subcommunity reports to condense the material. The same collection thus has detailed reports and broader overviews. Reports are ready before queries and reusable across questions. Compression costs detail: “multiple services timed out” can no longer distinguish A’s rollback from B’s retry cap.
The division of labor matters. A language model extracts who is related to whom, a graph algorithm partitions communities, and a language model names each community and writes its findings. Even if every node belongs to a community, a fact omitted during extraction may disappear from every report.
How does an edge retain its evidence in index files?
Consider how Microsoft GraphRAG v1.2.0 stores the March and May references. Configuration determines how documents are split, and each passage retains its source document ID. A model extracts entities and relationships from each chunk. The program then normalizes capitalization, cleans whitespace and control characters, and merges records. In both excerpts in figure 2, the caller is the login service and the callee is the session cache.9
“Cleaning” has limits here. Cross-chunk aggregation groups entities by name and type, and relationships by identical source and target. The merge adds extracted weights and saves the IDs of passages mentioning the relationship. Weight and provenance are different fields. Use provenance to verify an incident. Final entity records are also deduplicated by name. For example, Login and LOGIN may be combined. Merely normalizing case and whitespace cannot tell whether “login service” and “authentication center” refer to the same system. Distinct services with the same name also deserve a source check.9
Figure 2. What supports the claim that login called the session cache? [A, B] in the top table points to the two original sentences below, one from March and one from May.10
Start with one row in the upper table. source and target name the entities at the two ends, here login service and session cache. The third column, text_unit_ids, holds passage IDs. Follow A or B to read the original sentence below. If one sentence is insufficient, document_ids on the passage points to the full postmortem. A community report can also be traced back: its community ID leads to member entities and relationships, and relationships lead back to passages.10
If incident-specific remedies are frequent queries, each can also be stored independently. I later encountered an example while researching LangGraph. The graph in LangGraph arranges the order of program execution, whereas this knowledge graph records objects in documents and their relationships. 一意AI增效家 used Neo4j for a PDF about materials preparation. They called each short statement extracted by the model an “atomic fact,” gave it its own node, retained the text passages and linked adjacent passages in reading order.11
In our postmortems both A and B mention the session cache, but “the cache client was rolled back in March” and “retries were capped in May” can be separate facts. A recovery question can retrieve the particular remedy and verify it in its passage. Microsoft’s example followed one relationship to two postmortems. Here we can also single out one intervention. That offers another way to find event-level detail. Recurring annual patterns still require cross-event comparison.
What do Local Search and Global Search read at query time?
Local Search starts from entities. For a question about login service dependencies involved in failures, the system finds entities semantically close to the query, then collects connected relationships, source passages and relevant community reports. Context is finite, so candidates still require filtering and ranking. Ideally the answer lists “session cache” as a dependency, cites A for “March client rollback” and B for “May retry limit.” If the entity name matches the wrong system, even mutually consistent retrieved material can be about something else.12
How does it find an entry point when the user’s wording differs from the entity name? JarsonCai’s code illustrates one implementation. It reads entities, relationships, passages and community reports from Parquet (a tabular file format), storing embeddings of entity descriptions in the Milvus vector database. It embeds the query and compares it with the descriptions. For “which cache was accessed when users could not log in?”, similarity retrieval may find the entity “login service.” Its relationship leads to “session cache.” Passages A and B explain how each incident recovered. JarsonCai’s example uses Neo4j for visualization. The local query can read the relationship table directly.3
Global Search starts with community reports. “What failure patterns recurred all year?” has no obvious starting entity. The paper first selects a report level. A coarse level covers more ground, while a finer one preserves more local clues. Shuffle reports from the chosen level, batch them and ask every batch the same question. Two steps follow:136
- Map: answer by batch. Index-time community reports describe what their material contains. Here the model picks findings useful for this particular question and scores relevance. If separate reports retained B and C, one batch might identify login retries filling the connection pool and another payment retries exhausting workers.
- Reduce: combine the answers. Drop unhelpful results, rank the remaining points by score and combine as many as fit in context. The two findings can become “retry amplification after downstream timeouts” with evidence for both. D can appear in the annual overview as a credential incident, but calling it recurring requires another occurrence.
Local Search can follow entities to specific passages. Global Search lets separate communities contribute clues. If the question changes from “what patterns exist?” to “exactly how often did this happen?”, return to incident-level details, normalize event IDs, deduplicate reports about the same incident and count. A high Map score indicates usefulness for the question. Frequency still requires counting events.
Is retrieving a relationship enough to answer the original question?
A graph database tutorial by 二师兄说 AI asks whether knowing someone’s employer establishes their job. The author used LLMGraphTransformer to extract people, companies and relationships from a novel and store them in Neo4j. Asked what Mr Dursley did, the program generated Cypher (Neo4j’s graph query language), followed “Mr Dursley → works at → company,” and returned only the employer name, Grunnings. That answers where he worked, but a director and another employee would return the same company. Retrieving source text from document nodes instead let the model answer that he was a director and the company made drills. The author notes “由于没有将文本分割成块,查询会返回整个文档。” (“Because the text was not split into chunks, the query returns the entire document.”)14 Even with the correct person and company, fetching only the company name cannot establish the role. Likewise, identifying the session cache dependency still leaves us needing the intervention record to explain recovery.
Why build a graph if the source can be read in batches?
Microsoft’s paper compared two global Q&A methods: reading raw text in batches, or applying the same query procedure to community reports. Splitting all original text into batches, asking each the same question and combining their answers already avoids omissions from reading only the most similar passages. With only our four excerpts, everything fits at once and a graph adds a detour. Its value must be assessed when source material is extensive and different questions recur.6
The authors generated 125 collection-wide questions for each of two corpora, podcast transcripts and news articles. A judge model compared two answers to the same question, assessing breadth of coverage (comprehensiveness) and diversity of perspectives. On both corpora, reports at every community level beat ordinary vector retrieval on both criteria. The difference narrowed against reading all raw text in batches. For example, on podcasts, mid-level community reports beat batched raw text 57% of the time on both comprehensiveness and diversity. A win rate measures the judge’s paired preference. These open-ended questions did not have individual factual answer keys.15
How much material does a global question require from the same podcast transcripts, and how much from prewritten community reports? The table reproduces podcast figures from table 3 of the paper’s first version. A token measures text length for the model. Each row is a different way to read the same podcasts. A query selects one level, so do not add the four levels together.15
| Query material | Number of passages or reports | Total material length (tokens) |
|---|---|---|
| Source passages | 1,669 | 1,014,611 |
| C0 community reports (coarsest) | 34 | 26,657 |
| C1 community reports | 367 | 225,756 |
| C2 community reports | 969 | 565,720 |
| C3 community reports (finest) | 1,310 | 746,100 |
At C0, query material is only about 2.6% of the original passage length. At C2 it rises to about 56%. This saving concerns reading material. Total cost also includes pre-query calls to extract entities, merge descriptions and write reports, plus query-time calls to produce batch answers and the final response.
User latency also depends on which calls must occur in order. In our example, Local Search can produce an answer with one generation after retrieving A and B. In Global Search, login and payment batches can run concurrently, but reduction must wait for the batch answers. More concurrency can shorten the first wait. Generating the final answer still takes time. This is why different questions on the same index may feel faster or slower.313
For a postmortem library used for a single year-end summary, directly batching raw text is a competitive starting point. If someone asks a different question every week, reports can be reused. Frequent corrections raise maintenance costs. If a review overturns B’s claim that retries filled the pool, check affected relationships and reports for stale conclusions. Otherwise answers can repeat an outdated summary after the source has been fixed. JarsonCai suggests “将知识库拆分成不同的域可以在一定程度上降低成本。” (“Splitting the knowledge base into domains can reduce costs to some extent.”)3 Separate login and payment indexes let a correction to B update only the login domain. The annual question then needs to query both domains or it will still miss C.
Which retrieval problems justify that cost?
While working on document Q&A I also examined how ChatPDF chunks text and restores neighboring passages, then Chroma’s chunking comparison and the ChunkRAG paper. In our example, first ask what the answer missed: did chunking split a sentence, did retrieval include too much irrelevant text, or did it miss another relevant postmortem?1617
| Problem in the answer | What to try first | How to tell whether it helped |
|---|---|---|
| Retrieved “recovered after rollback” but not what was rolled back | Compare fixed-length, paragraph and semantic boundaries, retaining neighboring sentences.16 | For the March question, check that the returned text contains both “cache client” and “rollback.” |
| A was retrieved but ranks behind several similar timeout records | Rerank candidate passages. Or follow ChunkRAG in asking a model to assess each chunk and discard low-relevance passages.1817 | Check whether A reaches the final model context. If A was absent from the candidate set, investigate earlier retrieval. |
| Questions about one service’s dependencies retrieve only one month | Try GraphRAG’s entity entry point and retain associated source text.12 | Check that A and B are both retrieved and their interventions remain distinct. |
| Individual facts are accurate but the annual summary always misses another service group | Compare batched source summarization with global search over community reports.15 | Look for B and C together supporting retry amplification while excluding A and D. Record indexing and per-query costs. |
A fluent answer can still miss the question. How do we tell?
二师兄说 AI ran Q&A over Wikipedia material about the French Revolution and had a model score three aspects separately. Here is one question alongside the averages across all 14. Each scale has a maximum of 5.19
| What the judge checked | 14-question mean | July 14 question |
|---|---|---|
| Does the supplied material support the answer’s claims? | 4.93 | 4 |
| Does the answer address the question? | 4.57 | 2 |
| Is the answer coherent? | 5 | 5 |
Question, paraphrased: What radical measure did the National Assembly take on July 14, 1789, symbolizing the start of the French Revolution? Model answer, paraphrased: The storming of the Bastille that day symbolized the beginning of the Revolution.
Why 5 for coherence but only 2 for relevance? The passage says the storming of the Bastille prompted subsequent measures by the Assembly. The question attributes the day’s action to the Assembly. The answer gives an event and date but neither challenges the premise nor states what measure the Assembly took. An average alone can easily hide this kind of error.19
One question remains: did graph traversal find the crucial evidence, or would plain text retrieval do as well? The tutorial demonstrates document search combining keyword and vector similarity. During batch evaluation the code uses another name, graph_chain, without showing its corresponding Q&A pipeline. Each question runs twice, once to save the answer and once for source passages. We therefore cannot confirm which passages supported the specific answer in the table. Only one set of results was published, without a document-only baseline.19
That comparison is easier to see with the postmortems. Hold questions, model, chunks and model context allowance fixed. Retrieve only passages in round one. In round two allow entities and relationships to bring in additional passages. Save each answer alongside the IDs it actually read. If round one finds only login incident B and round two also finds payment incident C, inspect which relationship brought C into the answer. That isolates the value of adding source text along relationships. For the annual overview, also compare batched source text with community reports.
Back to the opening question: when is a graph worthwhile? If the system cannot answer “what was rolled back in March?”, I would fix chunking and retrieval first so it finds A’s sentence. If it handles individual incidents but always tells the annual story through login alone, try both methods on the same materials: batched source reading and GraphRAG reading batched community reports. Check which finds both B and C and explains why A is not retry amplification. If both answer correctly, ask how often this collection will be queried and updated. At comparable quality, the graph is worth maintaining when the query work it saves outweighs construction and updates.
References
Footnotes
-
Synced (Panda W, editor). (2024, July 15). Microsoft’s Open-Source GraphRAG Takes Off: Is Generative AI Entering the Knowledge Graph Era? NetEase. Original NetEase link · Sina Finance reprint crediting NetEase News. ↩
-
Microsoft. (n.d.). Welcome to GraphRAG. GraphRAG documentation. Documentation homepage. ↩
-
JarsonCai. (2025, September 22, edited). Exploring GraphRAG: Principles, Integration, Cost and Applicability. Zhihu column. Implementation examples in “Visualization” and “GraphRAG Integration Methods.” Domain update quotation from the “Index Cost” paragraph in “GraphRAG Cost and Inference Efficiency.” Original. ↩ ↩2 ↩3 ↩4
-
m0_59164520. (n.d.). Comparing a GraphRAG and GPT-4o mini Knowledge Base with Mainstream RAG. CSDN. Experiment and answer comparison. ↩
-
DeepSeek. (2025, February). Awesome DeepSeek Integration. GitHub. The list at the time also included Chatbox, ChatGPT Next Web, Coco AI, Dify and Deepseek.Asp.Client. See chat clients and search tools, application development tools and RAGFlow and AutoFlow entries and repositories. ↩
-
Edge, D., Trinh, H., Cheng, N., Bradley, J., Chao, A., Mody, A., Truitt, S., & Larson, J. (2024, April 24). From local to global: A graph RAG approach to query-focused summarization (Version 1). arXiv. Quotation in the first abstract paragraph, indexing and querying in sections 2.1–2.6. ↩ ↩2 ↩3 ↩4 ↩5 ↩6
-
Edge, D., Trinh, H., Truitt, S., & Larson, J. (2024, July 2). GraphRAG: New tool for complex data discovery now on GitHub. Microsoft Research. Open-source announcement and global question example. ↩
-
Microsoft. (n.d.). Default dataflow. GraphRAG documentation. Data flow for entities, relationships, communities and reports. ↩
-
Microsoft. (2025). GraphRAG (v1.2.0) [Source code]. GitHub. Chunkwise extraction and name normalization, Cleaning function, Cross-chunk grouping and weight aggregation, Merging descriptions and deduplication. ↩ ↩2
-
Microsoft. (2025). GraphRAG (v1.2.0) [Source code]. GitHub. Output table fields and relationships, Parquet I/O, Embedded fields, Default vector storage configuration. ↩ ↩2
-
一意AI增效家. (2025, April 13). Connecting an Agent to a Knowledge Graph for Autonomous Retrieval with LangGraph, Day 1. 53AI. See part III, “Knowledge Graph Key Nodes and Fact Modeling” for code defining nodes, extracting atomic facts and linking adjacent chunks. ↩
-
Microsoft. (n.d.). Local search. GraphRAG documentation. Local search data flow. ↩ ↩2
-
Microsoft. (n.d.). Global search. GraphRAG documentation. Global search data flow. ↩ ↩2
-
二师兄说 AI. (2024, May 27, edited). Getting Started with LangGraph (2): Graph Databases. Zhihu column. See “Implementation with LangChain and LLMGraphTransformer”. Quotation follows the output for
Who is Dudley?. The next two queries both ask about Mr Dursley’s occupation. ↩ -
Edge, D., et al. (2024, April 24). From local to global (Version 1, §§3.1–3.6, Fig. 4 & Table 3). arXiv. Results and context volumes by level. ↩ ↩2 ↩3
-
Smith, B., & Troynikov, A. (2024, July 3). Evaluating chunking strategies for retrieval. Chroma Research. Chunking strategies and retrieval experiments. ↩ ↩2
-
Aggarwal, R., Singh, I. S., Allahverdiyev, I., Taha, M., Akalin, A., & Zhu, K. (2024, October 25). ChunkRAG: Novel LLM-chunk filtering method for RAG systems (Version 1). arXiv. Chunkwise relevance filtering. ↩ ↩2
-
shibing624. (n.d.). ChatPDF. GitHub. Embeddings and reranking in local document Q&A. ↩
-
二师兄说 AI. (2024, June 3). Getting Started with LangGraph (3): Implementing and Evaluating a GraphRAG Application. Zhihu column. See “Implementing GraphRAG” and “Using Evaluation Metrics”. For retrieval and batch calls see the accompanying notebook, and for individual scores see the results table, rows 2–15. Row 9 is the July 14 example discussed above. ↩ ↩2 ↩3