<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vikrant Sharma on Medium]]></title>
        <description><![CDATA[Stories by Vikrant Sharma on Medium]]></description>
        <link>https://medium.com/@vikrantsharma_tdl?source=rss-01296e941e18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_Cj-JQb_MSwZZFKI1iUojA.jpeg</url>
            <title>Stories by Vikrant Sharma on Medium</title>
            <link>https://medium.com/@vikrantsharma_tdl?source=rss-01296e941e18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 21:12:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vikrantsharma_tdl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Experimenting with GraphRAG for an Insurance Q&A chatbot]]></title>
            <link>https://medium.com/tata-digital/experimenting-with-graphrag-for-an-insurance-q-a-chatbot-aba9090819e2?source=rss-01296e941e18------2</link>
            <guid isPermaLink="false">https://medium.com/p/aba9090819e2</guid>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[graphrag]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Vikrant Sharma]]></dc:creator>
            <pubDate>Fri, 14 Mar 2025 13:52:55 GMT</pubDate>
            <atom:updated>2025-03-14T13:52:55.288Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>With recent advancements in AI, there has been widespread adoption of Retrieval-Augmented Generation (RAG) framework. It utilizes LLM intelligence over an external data source, to provide specific and up-to-date answers. A key challenge is delivering a concise and relevant context to the LLM to ensure accurate responses. RAG also struggles to provide a holistic response as it lacks the overall view of the data source. To overcome this issue, researchers have been trying to extract information in the form of knowledge graph. GraphRAG from Microsoft is one the leading frameworks employing this idea. In this paper, we explore the working of GraphRAG, compare its responses with our own custom/traditional RAG approach for Insurance Q&amp;A, and report its advantages and limitations.</p><h3>Limitations of Traditional RAG</h3><p>Traditional Retrieval-Augmented Generation (RAG) approaches enhance language models by integrating external knowledge retrieval, but face several key limitations:</p><ul><li><strong>Shallow Context Understanding</strong>: They often rely on keyword-based or vector similarity retrieval, overlooking deeper semantic relationships.</li><li><strong>Limited Structural Awareness</strong>: Traditional RAG methods fail to leverage structured connections between documents or concepts, missing valuable relational context.</li><li><strong>Information Fragmentation</strong>: Responses can be inconsistent or incomplete due to isolated retrievals that lack cohesion or broader contextual awareness.</li><li><strong>Scalability Issues</strong>: Efficiency diminishes as the knowledge base grows, causing retrieval accuracy and performance degradation at scale.</li></ul><h3>Introducing GraphRAG</h3><p>GraphRAG is a structured, hierarchical approach to Retrieval Augmented Generation (RAG), as opposed to naïve semantic-search approaches using plain text snippets. The GraphRAG process involves extracting a knowledge graph out of raw text, building a community hierarchy, generating summaries for these communities, and then leveraging these structures when perform RAG-based tasks.</p><h4>GraphRAG Building Process</h4><p>The basic steps of the GraphRAG process are as follows:</p><ul><li>Slice up an input corpus into a series of <strong><em>TextUnits</em></strong>, which act as analyzable units for the rest of the process, and provide fine-grained references in our outputs.</li><li>Extract all entities, relationships, and key claims from the <strong><em>TextUnits </em></strong>using an LLM.</li><li>Perform a hierarchical clustering of the graph using the <strong>Leiden </strong>technique.</li><li>Generate summaries of each community and its constituents from the bottom-up. This aids in holistic understanding of the dataset.</li></ul><h4>GraphRAG Workflow</h4><p>The main idea is create a knowledge graph from the document with the help of LLM. We chunk our document, send those chunks to LLM, prompting it to identify the entities and relationships in it, and return those entities and their relationships. Entities will become the nodes of our graph and relationships will act as the edges between them.</p><p>Whenever we receive a question, we extract all nodes that are related to the question, along with their relationships, and we also extract all the chunks of documents related to these nodes. Once we have this information, we create our LLM prompt. The structure of the prompt will be as follows:</p><ol><li>System Message + Question of the user</li><li>All the nodes with their definitions.</li><li>Relationship Table( how node A is related to node B)</li><li>Text chunks related to the nodes.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*oyv7W4uuOvjNWDU2Hj1Ehg.png" /><figcaption>Visualization of Knowledge Graph of Insurance Policy using Gephi</figcaption></figure><h3>Comparison of Responses Between Traditional RAG and GraphRAG for Insurance Q&amp;A</h3><h3>Example 1</h3><p>Question: “<strong>Is Joint surgery covered in Medicare premier policy?</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*V8o_M0prLCtgkMKuotbJBw.png" /><figcaption>Response of a Traditional RAG Chatbot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*HQpai9jA9GzXdbxgxSyq_g.png" /><figcaption>Response of a GraphRAG-based Chatbot</figcaption></figure><p>GraphRAG-based chatbot provides information about how surgery is related to waiting period and what is the waiting time. It is able to do this because waiting period and joint replacement surgeries have some relationship among them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*T3bfeGDwG1YCdX7iuR3HYg.png" /><figcaption>A subgraph of Knowledge Graph shows a direct connection between Joint Replacement Surgery and treatment with waiting period.</figcaption></figure><h3>Example 2</h3><p>Question: “<strong>What is sum insured?</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*ul59iLHDcUWke0ladqa1Jg.png" /><figcaption>Response of a Traditional RAG Chatbot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*kby4tU4Csoy6hgOLQg8DAQ.png" /><figcaption>Response of a GraphRAG-based Chatbot</figcaption></figure><p>GraphRAG-based chatbot provides information about ranges of sum insured, highlights its dependence on age and deductible amounts. This happens because there is a second order relationship between sum insured and age groups, deductible amounts and insured person.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*mf3wy_3wm6bZbnbAKCOGiw.png" /><figcaption>A subgraph from Knowledge Graph, showing the second order relationship between Sum insured and other nodes such as health insurance premiums, age bands, deductible etc.</figcaption></figure><h3>Example 3</h3><p>Question: “<strong>I live in another state. I had an accident. Will insurance cover my mother’s travel expense?</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*nDmbz7dDbDGiIe3Y4TzMzw.png" /><figcaption>Response of a Tradtional RAG Chatbot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*ViDRMr3OgmOMavxuot0OYg.png" /><figcaption>Response of a GraphRAG-based Chatbot</figcaption></figure><p>Chatbot based on GraphRAG provides more information about restrictions related to compassionate travel like the 20 thousand rupees limit, and it also advises the user to keep the proof of travel expense.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*9ELGN22NknrnJoaHR9dKCg.png" /><figcaption>A subgraph from Knowledge Graph showing how compassionate travel is related to immediate family member, first-class railway ticket, proof of travel etc.</figcaption></figure><h3>Limitations of GraphRAG</h3><p>Building a knowledge graph is an expensive process, because it requires substantial number of calls to the large language model (LLM). Each call identifies the key entities and the relationships between them within the document. The larger and more detailed the document, the more LLM interactions are necessary, which significantly increases the overall cost.</p><p>The token count requirement also increases at runtime, because, along with the main text chunks, some extra details like community summaries, entity descriptions, and relationship tables, are also sent to the LLM, adding to the overall data load.</p><h3>Conclusion</h3><p>A chatbot built on a knowledge graph framework demonstrates significant improvement in the quality and completeness of its responses. By identifying connections between different, but related, pieces of information, it provides enhanced clarity and precision. Compared to traditional RAG approaches, the knowledge graph not only reduces hallucinations and ensures more factual responses but also fills knowledge gaps that similarity searches often miss. This improvement leads to more comprehensive and complete answers, empowering customers to access the right information quickly. As a result, the chatbot supports faster and more confident decision-making, enhancing the overall user experience.</p><p>However, there are some downsides as well. Creating a knowledge graph is an expensive process, as a large number of LLM calls are made to build a knowledge graph. There is about 1.5x increase in the number of prompt tokens observed as compared to traditional RAG. This is due to the inclusion of community summaries, entity definitions and entity relationship table in the final prompt.</p><p>Despite these limitations, the overall performance of a knowledge graph-based chatbot outweighs the extra costs for most use cases.</p><h3>References</h3><ol><li><a href="https://github.com/microsoft/graphrag">https://github.com/microsoft/graphrag</a></li><li><a href="https://microsoft.github.io/graphrag/">https://microsoft.github.io/graphrag/</a></li><li><a href="https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/">https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aba9090819e2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tata-digital/experimenting-with-graphrag-for-an-insurance-q-a-chatbot-aba9090819e2">Experimenting with GraphRAG for an Insurance Q&amp;A chatbot</a> was originally published in <a href="https://medium.com/tata-digital">Tata Digital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>