‹ 返回 2026-07-21

RAGU:一种多步骤GraphRAG引擎,包含紧凑型领域适配LLM

RAGU: A Multi-Step GraphRAG Engine with a Compact Domain-Adapted LLM

▲ 83 💬 3 2026-07-21

Mikhail Komarov, Ivan Bondarenko, Stanislav Shtuka, Oleg Sedukhin, Roman Shuvalov, Yana Dementyeva, Matvey Solovyov, Nikolay O. Nikitin

摘要

图检索增强生成技术(GraphRAG)通过引入结构化知识来提升大型语言模型的性能。不过,现有的系统通常会在一次提取过程中就构建出知识图谱,这会导致数据质量不佳以及检索效果不稳定。RAGU是一种开源的模块化GraphRAG引擎,它通过将提取与整合过程分离开来解决了这一问题:实体和关系经过两阶段的提取过程、基于DBSCAN的去重机制、LLM的总结功能以及Leiden社区检测算法来处理。这一设计思路促使我们开发了一个高效的提取器:管道中的LLM所需的技能——理解能力、提取能力以及对上下文的推理能力——属于语言技能,这些技能随着模型规模的增长而增长的程度相对有限,与事实性知识不同。因此,我们训练了Meno-Lite-0.1模型,这是一个针对语言技能优化的7B参数模型,它在构建知识图谱方面优于Qwen2.5-32B模型,相对和声平均值提升了12.5%,在英语GraphRAG任务中则与其相当。在GraphRAG-Bench(医学领域)测试中,RAGU能够在每个事实层面都获取最完整的上下文信息(证据召回率高达0.84,而leq为0.76),并且在合成任务上超越了HippoRAG2;而在多层级事实问答任务中,HippoRAG2的优势实际上只是由于答案格式的原因而已。RAGU可以通过pip install graph_ragu来安装,它可以在单个GPU上运行,且遵循MIT许可证。源代码可以在https://github.com/RaguTeam/RAGU上获取,而Meno-Lite-0.1模型则可以从https://hf-mirror.com/bond005/meno-lite-0.1获取。

English Abstract

Graph retrieval-augmented generation (GraphRAG) enhances large language models with structured knowledge, yet existing systems construct knowledge graphs in a single extraction pass, producing noisy entities and brittle retrieval. RAGU, an open-source modular GraphRAG engine, addresses this by separating extraction from consolidation: entities and relations pass through two-stage typed extraction, DBSCAN-backed deduplication, LLM summarization, and Leiden community detection. A key insight motivates a compact extractor: the skills an in-pipeline LLM needs - comprehension, extraction, reasoning over context - are language skills that grow only weakly with model size, unlike factual world knowledge. Accordingly, we train Meno-Lite-0.1, a 7B model optimized for language skills, which outperforms Qwen2.5-32B on knowledge-graph construction (+12.5% relative harmonic mean) and matches it on English GraphRAG tasks. On GraphRAG-Bench (Medical), RAGU retrieves the most complete context at every factoid level (evidence recall up to 0.84 vs. leq0.76) and overtakes HippoRAG2 on synthesis tasks; on multi-hop factoid QA, the apparent HippoRAG2 advantage is shown to be largely an answer-format artifact. RAGU is installable via pip install graph_ragu, runs on a single GPU, and is released under MIT. The source code is publicly available at https://github.com/RaguTeam/RAGU, and the Meno-Lite-0.1 model can be obtained from https://hf-mirror.com/bond005/meno-lite-0.1.