匿名
未登录
登录
医学百科
搜索
查看“GraphRAG”的源代码
来自医学百科
名字空间
页面
更多
更多
语言
页面选项
Read
查看源代码
历史
←
GraphRAG
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看和复制此页面的源代码。
<div style="padding: 0 4%; line-height: 1.8; color: #1e293b; font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', Arial, sans-serif; background-color: #ffffff; max-width: 1200px; margin: auto;"> <div style="margin-bottom: 30px; border-bottom: 1.2px solid #e2e8f0; padding-bottom: 25px;"> <p style="font-size: 1.1em; margin: 10px 0; color: #334155; text-align: justify;"> <strong>GraphRAG</strong>(Graph Retrieval-Augmented Generation,<strong>图谱增强检索生成</strong>)是一种结合了<strong>[[知识图谱]]</strong>(Knowledge Graph)结构化优势与<strong>[[大语言模型]]</strong>(LLM)生成能力的下一代 RAG 技术。传统的 RAG(Naive RAG)依赖于向量相似度检索,这在处理简单的“事实查询”时有效,但在面对需要<strong>[[多跳推理]]</strong>(Multi-hop Reasoning)或这就需要理解数据间复杂关系的医学问题时往往失效。GraphRAG 通过将文本转化为图谱结构,利用图的遍历能力检索出“实体”及其“关系”,从而让 AI 具备了逻辑推理能力和全局视角,极大地降低了医疗 AI 的<strong>[[幻觉]]</strong>风险。 </p> </div> <div class="medical-infobox mw-collapsible mw-collapsed" style="width: 100%; max-width: 320px; margin: 0 auto 35px auto; border: 1.2px solid #bae6fd; border-radius: 12px; background-color: #ffffff; box-shadow: 0 8px 20px rgba(0,0,0,0.05); overflow: hidden;"> <div style="padding: 15px; color: #1e40af; background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); text-align: center; cursor: pointer;"> <div style="font-size: 1.2em; font-weight: bold; letter-spacing: 1.2px;">GraphRAG</div> <div style="font-size: 0.7em; opacity: 0.85; margin-top: 4px; white-space: nowrap;">(点击展开)</div> </div> <div class="mw-collapsible-content"> <div style="padding: 25px; text-align: center; background-color: #f8fafc;"> <div style="display: inline-block; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.04);"> [[Image:GraphRAG_Concept_Icon.png|100px|图谱+大模型]] </div> <div style="font-size: 0.8em; color: #64748b; margin-top: 12px; font-weight: 600;">结构化知识驱动的生成</div> </div> <table style="width: 100%; border-spacing: 0; border-collapse: collapse; font-size: 0.85em;"> <tr> <th style="text-align: left; padding: 6px 12px; background-color: #f1f5f9; color: #475569; border-bottom: 1px solid #e2e8f0; width: 40%;">核心组件</th> <td style="padding: 6px 12px; border-bottom: 1px solid #e2e8f0; color: #0f172a;">KG (知识图谱) + LLM</td> </tr> <tr> <th style="text-align: left; padding: 6px 12px; background-color: #f1f5f9; color: #475569; border-bottom: 1px solid #e2e8f0;">检索方式</th> <td style="padding: 6px 12px; border-bottom: 1px solid #e2e8f0; color: #1e40af;">图遍历 (Graph Traversal)</td> </tr> <tr> <th style="text-align: left; padding: 6px 12px; background-color: #f1f5f9; color: #475569; border-bottom: 1px solid #e2e8f0;">主要优势</th> <td style="padding: 6px 12px; border-bottom: 1px solid #e2e8f0; color: #0f172a;">多跳推理, 全局概括</td> </tr> <tr> <th style="text-align: left; padding: 6px 12px; background-color: #f1f5f9; color: #475569; border-bottom: 1px solid #e2e8f0;">关键技术</th> <td style="padding: 6px 12px; border-bottom: 1px solid #e2e8f0; color: #0f172a;">社区发现 (Leiden算法)</td> </tr> <tr> <th style="text-align: left; padding: 6px 12px; background-color: #f1f5f9; color: #475569; border-bottom: 1px solid #e2e8f0;">首发机构</th> <td style="padding: 6px 12px; border-bottom: 1px solid #e2e8f0; color: #1e40af;">[[Microsoft Research]]</td> </tr> <tr> <th style="text-align: left; padding: 6px 12px; background-color: #f1f5f9; color: #475569;">核心标签</th> <td style="padding: 6px 12px; color: #1e40af;">[[可解释性]], [[逻辑推理]]</td> </tr> </table> </div> </div> <h2 style="background: #f1f5f9; color: #0f172a; padding: 10px 18px; border-radius: 0 6px 6px 0; font-size: 1.25em; margin-top: 40px; border-left: 6px solid #0f172a; font-weight: bold;">技术背景:为什么医学需要 GraphRAG?</h2> <p style="margin: 15px 0; text-align: justify;"> 在医学领域,单纯的 <strong>[[Vector RAG]]</strong>(向量检索)存在致命缺陷:它只能检索到“字面相似”的片段,而无法理解“逻辑关联”。 <br><strong>场景示例:</strong> 用户问“除了二甲双胍,还有哪些药能治疗2型糖尿病但不会导致低血糖?” <br>• <strong>Vector RAG:</strong> 可能会检索到含有“二甲双胍”和“低血糖”关键词的文档片段,然后拼凑出一个可能包含错误的答案。 <br>• <strong>GraphRAG:</strong> 会在知识图谱中先找到[二甲双胍]节点,沿[治疗]边找到[2型糖尿病],再查找该疾病的其他[治疗药物]节点,并过滤掉[副作用]包含[低血糖]的药物。这是基于逻辑的精确检索。 </p> [[Image:GraphRAG_Workflow_Diagram]] <h2 style="background: #f1f5f9; color: #0f172a; padding: 10px 18px; border-radius: 0 6px 6px 0; font-size: 1.25em; margin-top: 40px; border-left: 6px solid #0f172a; font-weight: bold;">核心机制:Indexing & Querying</h2> <div style="margin-bottom: 25px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; background-color: #ffffff;"> <h3 style="margin-top: 0; color: #1e40af; font-size: 1.1em; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px;">1. Indexing (图谱构建与索引)</h3> <p style="text-align: justify; color: #334155;"> GraphRAG 首先利用 LLM 从非结构化文本(如医学指南、百科)中自动提取实体(Entities)和关系(Relationships),构建知识图谱。 <br><strong>特色技术:</strong> 微软提出的 GraphRAG 方法引入了<strong>[[社区发现]]</strong>(Community Detection)。它将紧密相关的节点(如所有关于“肺癌化疗”的节点)聚类成一个社区,并预先生成该社区的摘要。这使得 AI 能够回答“肺癌化疗有哪些常见方案?”这种宏观问题。 </p> </div> <div style="margin-bottom: 25px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; background-color: #f8fafc;"> <h3 style="margin-top: 0; color: #b91c1c; font-size: 1.1em; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px;">2. Querying (图谱增强检索)</h3> <p style="text-align: justify; color: #334155;"> 当用户提问时,系统不仅进行关键词匹配,还在图谱上进行<strong>[[多跳游走]]</strong>(Multi-hop Traversal)。 <br>例如:查询“Drug A 对 Gene B 突变患者的风险”,系统会沿路径检索:Drug A -> Target C -> Pathway D -> Gene B。它将这条完整的<strong>“证据链”</strong>作为上下文喂给 LLM,从而生成有理有据的回答。 </p> </div> <h2 style="background: #f1f5f9; color: #0f172a; padding: 10px 18px; border-radius: 0 6px 6px 0; font-size: 1.25em; margin-top: 40px; border-left: 6px solid #0f172a; font-weight: bold;">横向测评:Vector RAG vs GraphRAG</h2> <p style="margin: 15px 0; text-align: justify;"> GraphRAG 是对 Vector RAG 的降维打击,特别是在复杂专业领域。 </p> <div style="overflow-x: auto; margin: 30px auto; max-width: 100%;"> <table style="width: 100%; border-collapse: collapse; border: 1.2px solid #cbd5e1; font-size: 0.9em; text-align: left;"> <tr style="background-color: #f1f5f9; border-bottom: 2px solid #0f172a;"> <th style="padding: 12px; border: 1px solid #cbd5e1; color: #0f172a; width: 25%;">维度</th> <th style="padding: 12px; border: 1px solid #cbd5e1; color: #475569;">Vector RAG (传统)</th> <th style="padding: 12px; border: 1px solid #cbd5e1; color: #1e40af;">GraphRAG (进阶)</th> </tr> <tr> <td style="padding: 10px; border: 1px solid #cbd5e1; font-weight: 600; background-color: #ffffff;">数据表示</td> <td style="padding: 8px; border: 1px solid #cbd5e1;">切片文本块 (Chunks) 的向量。数据是碎片的。</td> <td style="padding: 8px; border: 1px solid #cbd5e1;">结构化的实体与关系 (Knowledge Graph)。数据是关联的。</td> </tr> <tr> <td style="padding: 10px; border: 1px solid #cbd5e1; font-weight: 600; background-color: #f8fafc;">推理能力</td> <td style="padding: 8px; border: 1px solid #cbd5e1;"><strong>弱。</strong> 仅靠语义相似度,难以处理跨文档的逻辑连接。</td> <td style="padding: 8px; border: 1px solid #cbd5e1;"><strong>强。</strong> 支持<strong>[[多跳推理]]</strong>,能发现隐性关系(A->B->C)。</td> </tr> <tr> <td style="padding: 10px; border: 1px solid #cbd5e1; font-weight: 600; background-color: #ffffff;">全局理解</td> <td style="padding: 8px; border: 1px solid #cbd5e1;"><strong>差。</strong> 难以回答“总结全部文档中提到的副作用”这类全集问题。</td> <td style="padding: 8px; border: 1px solid #cbd5e1;"><strong>优。</strong> 利用图谱社区摘要,擅长回答宏观概括性问题。</td> </tr> <tr> <td style="padding: 10px; border: 1px solid #cbd5e1; font-weight: 600; background-color: #f8fafc;">构建成本</td> <td style="padding: 8px; border: 1px solid #cbd5e1;">低。只需 Embedding 模型。</td> <td style="padding: 8px; border: 1px solid #cbd5e1;">高。需要构建高质量图谱,涉及 NER 和关系抽取。</td> </tr> </table> </div> <div style="font-size: 0.92em; line-height: 1.6; color: #1e293b; margin-top: 50px; border-top: 2px solid #0f172a; padding: 15px 25px; background-color: #f8fafc; border-radius: 0 0 10px 10px;"> <span style="color: #0f172a; font-weight: bold; font-size: 1.05em; display: inline-block; margin-bottom: 15px;">关键参考文献</span> <p style="margin: 12px 0; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px;"> [1] <strong>Edge D, et al. (2024).</strong> <em>From Local to Global: A Graph RAG Approach to Query-Focused Summarization.</em> <strong>[[Microsoft Research]]</strong>.<br> <span style="color: #475569;">[奠基之作]:微软团队正式提出了 GraphRAG 的概念,证明了其在处理大规模数据集的全局性问题(Global Sensemaking)上显著优于传统 RAG。</span> </p> <p style="margin: 12px 0; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px;"> [2] <strong>Pan S, et al. (2023).</strong> <em>Unifying Large Language Models and Knowledge Graphs: A Roadmap.</em> <strong>[[IEEE TKDE]]</strong>.<br> <span style="color: #475569;">[综述]:系统阐述了 LLM 与 KG 结合的三种模式:KG 增强 LLM(即 GraphRAG)、LLM 增强 KG(用 AI 建图)以及协同进化。</span> </p> </div> <div style="margin: 40px 0; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 0.9em;"> <div style="background-color: #eff6ff; color: #1e40af; padding: 8px 15px; font-weight: bold; text-align: center; border-bottom: 1px solid #dbeafe;"> GraphRAG · 知识图谱 </div> <table style="width: 100%; border-collapse: collapse; background-color: #ffffff;"> <tr style="border-bottom: 1px solid #f1f5f9;"> <td style="width: 85px; background-color: #f8fafc; color: #334155; font-weight: 600; padding: 10px 12px; text-align: right; vertical-align: middle; white-space: nowrap;">上级技术</td> <td style="padding: 10px 15px; color: #334155;">[[RAG]] (检索增强生成) • [[知识图谱]]</td> </tr> <tr style="border-bottom: 1px solid #f1f5f9;"> <td style="width: 85px; background-color: #f8fafc; color: #334155; font-weight: 600; padding: 10px 12px; text-align: right; vertical-align: middle; white-space: nowrap;">应用场景</td> <td style="padding: 10px 15px; color: #334155;">[[临床决策支持]] (CDSS) • [[复杂病例分析]] • [[药物研发]]</td> </tr> <tr style="border-bottom: 1px solid #f1f5f9;"> <td style="width: 85px; background-color: #f8fafc; color: #334155; font-weight: 600; padding: 10px 12px; text-align: right; vertical-align: middle; white-space: nowrap;">技术难点</td> <td style="padding: 10px 15px; color: #334155;">[[实体对齐]] • [[知识更新]] • [[检索延迟]]</td> </tr> <tr> <td style="width: 85px; background-color: #f8fafc; color: #334155; font-weight: 600; padding: 10px 12px; text-align: right; vertical-align: middle; white-space: nowrap;">工具栈</td> <td style="padding: 10px 15px; color: #334155;">[[Neo4j]] • [[LangChain]] • [[LlamaIndex]]</td> </tr> </table> </div> </div>
返回至
GraphRAG
。
导航
导航
症状百科
疾病百科
药品百科
中医百科
中药百科
人体穴位图
全国医院列表
功能菜单
最近更改
随机页面
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志