AB
AiBoss
project

NodeRAG - An open-source intelligent retrieval and generation system based on heterogeneous graphs

NodeRAG is a heterogeneous graph-based Retrieval-Augmented Generation (RAG) system. It integrates document information and insights generated by language models by constructing heterogeneous graphs containing various node types...

What is NodeRAG?

NodeRAG is a heterogeneous graph-based Retrieval-Augmented Generation (RAG) system. By constructing heterogeneous graphs containing various node types, it integrates document information and insights generated by language models, supporting multi-hop retrieval and fine-grained information extraction. NodeRAG's heterogeneous graphs include various node types such as entities, relations, and semantic units, enabling context-aware retrieval and significantly improving retrieval accuracy and efficiency. It supports incremental updates, dynamically adapting to data changes and improving retrieval speed and performance through algorithm optimization.

Main functions of NodeRAG

  • Multi-hop information retrievalNodeRAG supports multi-hop information retrieval by constructing heterogeneous graphs. It can extract and integrate information from multiple nodes to solve complex query tasks. For example, in multi-document question answering, NodeRAG can find relevant information scattered across different documents through multi-hop retrieval and generate accurate answers.
  • Fine-grained information extractionNonodeRAG's heterogeneous graph contains various node types (such as entities, relations, semantic units, etc.), enabling fine-grained classification and organization of information. This allows the system to retrieve and extract relevant information more accurately, improving the interpretability of search results.
  • Incremental update supportNonodeRAG supports incremental updates to heterogeneous graphs, allowing for the dynamic addition or modification of nodes and edges. This enables the system to adapt to rapidly changing data environments; for example, in the news industry, new events and information can be integrated into the graph in a timely manner without requiring the reconstruction of the entire graph structure.
  • Optimize performance and efficiencyNodeRAG is optimized for retrieval speed and storage efficiency. Through efficient indexing and query algorithms, NodeRAG can quickly retrieve information from large-scale datasets, reducing storage costs.
  • Visualization and User InterfaceNonodeRAG provides a user-friendly visual interface and a complete Web UI, allowing users to explore and manage heterogeneous graphs graphically.
  • Context-aware generationNodraG's generation module leverages contextual information from heterogeneous graphs to generate more accurate and coherent text content. Combining retrieved information with the generative capabilities of a language model, it can produce high-quality text output, such as news summaries and question-and-answer formats.
  • Flexible deployment and expansionNodeRAG supports installation via Conda and PyPI, allowing users to easily deploy a local web interface. Its architecture is flexibly scalable, supports multiple languages and domains, and is suitable for various application scenarios such as news, finance, and healthcare.

The technical principles of NodeRAG

  • Heterogeneous graph structure designAt its core, NodaRAG is a heterogeneous graph structure that comprehensively represents knowledge in a corpus by integrating various types of nodes (such as entities, relations, semantic units, attributes, high-level elements, high-level overviews, and text nodes). Each node type plays a specific role and has a function, together forming a powerful and flexible graph structure.
  • Graph construction processGraph construction consists of three main steps:
    • Graph DecompositionThe text blocks are decomposed into basic nodes such as semantic units, entities, and relations using a large language model to construct an initial graph structure.
    • Image EnhancementThe graph structure is further enriched by methods such as node importance evaluation (e.g., K-core decomposition and betweenness centrality) and community detection (e.g., Leiden algorithm), adding high-level elements and attribute nodes.
    • Rich in imagesInsert original text blocks and selectively embed partial data, use the Hierarchical Navigation Small World (HNSW) algorithm to organize data into a multi-level graph structure, and efficiently retrieve semantically similar nodes.
  • Graph search mechanismNonodeRAG uses a dual search mechanism and a shallow personalized PageRank (PPR) algorithm to achieve efficient retrieval.
    • Dual search mechanismBy combining exact matching on the title node and vector similarity search on the rich information node, entry points in the graph are identified.
    • Shallow PPR algorithmBy simulating a biased random walk starting from the entry point, relevant nodes are identified, and an early stopping strategy is used to limit the number of iterations to ensure that the correlation remains within a local range.
  • Incremental update mechanismNodeRAG supports incremental graph updates. When new documents are added, the system can intelligently integrate the new information into the existing graph structure without rebuilding the entire knowledge graph.
  • Optimized sparse personalized PageRankNonodeRAG implements an optimized, sparse, personalized PageRank algorithm that leverages SciPy's sparse matrix computation capabilities to efficiently handle large-scale graph structures. This enables NonodeRAG to efficiently calculate node importance on complex heterogeneous graphs, supporting accurate retrieval.

NodeRAG project address

Application scenarios of NodeRAG

  • academic researchResearchers can use NodeRAG to organize literature data and build paper relationship graphs. By importing paper datasets, the system can extract information such as keywords, authors, and citation relationships to generate knowledge graphs.
  • Enterprise knowledge managementEnterprises can use NodeRAG to manage internal documents and build knowledge bases. By importing technical documents, project reports, etc., the system can generate document relationship diagrams, helping employees quickly locate the information they need and improving knowledge sharing efficiency.
  • Question answering systems for complex knowledge domainsIn professional fields such as medicine, law, and finance, NonodeRAG's heterogeneous graph structure can accurately capture professional concepts and their relationships, providing more accurate question-and-answer support.
  • Personalized recommendation systemNonodeRAG's heterogeneous graphs can simultaneously model multiple information such as user preferences, product characteristics, and rating sentiment, capturing the complex relationships between them through graph structures to provide more accurate recommendations.
  • Data Analysis and VisualizationData analysts can use NonodeRAG to analyze complex datasets, such as social network or customer relationship data. The system visualizes data relationships through graphs, helping to uncover hidden patterns, and is suitable for market analysis, risk assessment, or recommendation system development.